Remove eslint-plugin-prettier from eslint-config-react-native#41877
Remove eslint-plugin-prettier from eslint-config-react-native#41877LukaRusadze wants to merge 2 commits intofacebook:mainfrom
Conversation
|
Hi @LukaRusadze! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Base commit: 0c02b26 |
|
Adding on top of the Prettier docs, this stackoverflow post also provides more context of this as well as points to the recently published post from ESLint on deprecating formatting rules. This seems a reasonable change to me, but it might miss reporting formatting issues if someone using RN doesn't have prettier setup in their IDE/dev environment, which could be a regression (although less severe to production regressions). I think we should send a deprecating message first before removing this. |
|
Besides, could you help with identifying the gaps after we removing This would help us find a better way roll out the change without causing surprises. |
|
This could be a migration issue for those who check code style validity with Also your point of people not having prettier installed is valid but I don't think it's an issue. I'd say, in general, Prettier's already mostly adopted and every project, where it's necessary, has it enforced. The adoption issue can quickly be caught be a CI process as well. I've seen a few developers disable ESLint altogether because of the styling errors/warnings you get while writing code, something that gets fixed the moment you save/format. This is just the |
|
Closed by 727f30b. |
@ryancat you had predicted this 👏🏼 |
Summary:
Citing Prettier docs:
Linters usually contain not only code quality rules, but also stylistic rules. Most stylistic rules are unnecessary when using Prettier, but worse – they might conflict with Prettier! Use Prettier for code formatting concerns, and linters for code-quality concerns, as outlined in Prettier vs. Linters.
This plugin was especially useful when Prettier was new. By running Prettier inside your linters, you didn’t have to set up any new infrastructure and you could re-use your editor integrations for the linters. But these days you can run prettier --check . and most editors have Prettier support.
The downsides of those plugins are:
This PR aims to remove eslint-plugin-prettier from eslint-config-react-native. This will offload code stylistic rules to prettier from eslint. This will also remove all of the eslint(prettier/prettier) warnings and errors while typing which gets fixed by formatting with prettier but gets quickly annoying until you save to format.
I'd also go as far as to remove some/all of the styling ESLint rules and move everything to Prettier config instead (if they aren't already in it) so linter doesn't do formatter's job.
Changelog:
Test Plan:
Before:

After:

This was tested by making the proposed changes in node_modules of a newly initialised project