prettier / eslint-config-prettier

Turns off all rules that are unnecessary or might conflict with Prettier.
MIT License
5.4k stars 254 forks source link

Prettier 2.0 rules update #139

Closed ghost closed 4 years ago

ghost commented 4 years ago

Arrow Function Parentheses First available in v1.9.0, default value changed from avoid to always in v2.0.0

Corrected by removing the arrow-parens rule.

Trailing Commas Default value changed from none to es5 in v2.0.0

I've tried correcting the trailing commas notice by removing comma-dangle and no-comma-dangle but it still reports it.

Edit: I've realized there's README and other things to edit before this can be merged.

lydell commented 4 years ago

Hi!

What changes are you planning? As far as I can tell, the changes in Prettier 2.0 does not make any changes needed in eslint-config-prettier. For example, arrow-parens is still unnecessary when using Prettier, regardless of the value of arrowParens in Prettier.

ghost commented 4 years ago

Hey!

I was too quick in making this PR, sorry about that. I'm unable to reproduce the arrow-parens again after re-installing eslint-config-prettier. On the first Prettier 2.0 run all functions changed from singleParam => {} to (singleParam) => {} got reported.

However the comma-dangle is being reported in lints, so I've added the trailingComma: 'none' to the .prettierrc.js to avoid it. Is this the intended behavior or should comma-dangle be silent in case of es5 or all being set?

Thank you for responding and have a great Sunday!

lydell commented 4 years ago

comma-dangle is turned off:

https://github.com/prettier/eslint-config-prettier/blob/a188a3c50774fcf721b3e8420aa6159613243538/index.js#L29

ghost commented 4 years ago

Exactly, any ideas why it could still show up?

image

I can add the rule in .eslintrc.js itself and it's ignored, but shouldn't it already be due to what you just posted above or is my understanding wrong?

image

lydell commented 4 years ago

You seem to have forgot to extend eslint-config-prettier? You need something like this:

extends: ['plugin:react/recommended', 'standard', 'prettier', 'prettier/react', 'prettier/standard']
ghost commented 4 years ago

What a dummy. :man_facepalming:

Thank you for taking the time to help out. I'm glad this got squeezed in the last 3 hours of week 12 and I'm not starting the next one on such a Homer Simpson moment.