prettier / eslint-config-prettier

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

[cli] How to ignore known conflict rules like `arrow-body-style` and `prefer-arrow-callback`? #174

Closed JounQin closed 3 years ago

JounQin commented 3 years ago

It is said You can still use these rules together with this plugin if you want, because the bug does not occur all the time. But if you do, you need to keep in mind that you might end up with invalid code, where you manually have to insert a missing closing parenthesis to get going again., but I found no way to ignore it with command eslint-config-prettier .eslintrc.js.

lydell commented 3 years ago

Hi!

So it seems like if you enable both the prettier/prettier rule and arrow-body-style, the CLI helper prints this and exits with status 2:

❯ npx eslint-config-prettier index.js
The following rules are enabled with config that might conflict with Prettier. See:
https://github.com/prettier/eslint-config-prettier#special-rules

- arrow-body-style

Just to see if I understood correctly, that’s what you mean?

Can you tell me more about how you use the CLI helper tool? Do you run it in CI or something?

JounQin commented 3 years ago

Yes, I'm running it on CI

https://github.com/1stG/configs/runs/1933571863?check_suite_focus=true#step:8:16

lydell commented 3 years ago

Thanks. I think we should change so that those rules always print warnings, but never cause non-zero exit.

JounQin commented 3 years ago

I think error is fine to enforce users notice about the known issue and an option to disable the check if the user decide to risk after reading the document.

lydell commented 3 years ago

Fixed in v8.0.0. You should be able to just upgrade and not have to do anything special in your CI setup.