简体   繁体   中英

Prettier and ESLint jQuery spacing

I have code that when formatted with Prettier ESLint gives me an error

ORIGINAL:

  $(document).trigger('HideDropDown').trigger('UpdateDropDowns');

FIXED with Prettier

  $(document)
    .trigger('HideDropDown')
    .trigger('UpdateDropDowns');

ESLINT complains that I need extra spaces as such:

  $(document)
      .trigger('HideDropDown')
      .trigger('UpdateDropDowns');

Is this something that needs to be adjusted through Prettier or ESLint? I do prefer only two spaces rather than 4 but I am not sure how to adjust it so that ESLint doesn't complain about it.

就我而言,我发现以下设置将使ESLint和Prettier可以很好地协同工作:

"MemberExpression": 1 // default is 2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM