Remove prettier from eslint-config-react-native-community
See original GitHub issueHi.
I use prettier as a plugin in my code editor (Sublime Text), and use eslint-config-prettier to disable formatting rules from Eslint. But eslint keep popping up a lot of formatting rules. After some time searching i found that the origin of these rules was the prettier plugin in the eslint-config-react-native-community package.
I don’t know why these rules are in this package, but i think they don’t need to be there.
Steps to reproduce:
Follow the configuration tutorial in the readme page: https://github.com/facebook/react-native/blob/master/packages/eslint-config-react-native-community/README.md
Run the bellow command to check the enabled rules: yarn eslint --print-config *.tsx (replace *.tsx with your project file format)
Output:
"plugins": [
"jest",
"react-native",
"prettier",
"eslint-comments",
"react-hooks",
"react",
"@typescript-eslint"
]
These are the enabled plugins with the extension.
Now i disabled it and run the print-config again:
"plugins": [
"react-hooks",
"react",
"@typescript-eslint"
]
As you can see, these plugins are added by the @react-native-community extension:
- “jest”,
- “react-native”,
- “prettier”,
- “eslint-comments”,
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:11 (2 by maintainers)
Top GitHub Comments
Until a decision is made for those wanting to get “most of this config except prettier stuff”, you can
Install eslint-config-prettier
And use this config
Why does React-Native force developers to use prettier by default? Why add dependencies unnecessarily? IMO, we should remove prettier eslint configuration by default and let developers add it if required. It shouldn’t be the other way where react-native adds it by default and users have to disable it if not required. Already react-native takes lot of effort to start a simple project and run for new developers, why then add more configurations. Let’s keep it simple and clean.