Reputation: 1025
Is it possible to throw errors instead of warnings using Eslint?
I am working with a create-react-app
and want to have a really strict lint policy in my team, and thought that this might be a good start.
Is that possible?
Upvotes: 36
Views: 22693
Reputation: 726
--max-warnings
can serve this purpose: --max-warnings=0
means that any warnings cause eslint to report an error.
https://github.com/eslint/eslint/issues/2309#issuecomment-219828044
Upvotes: 71
Reputation: 17
Yes It is possible to edit the ESlint Configuration in create-react-app setup. All you need to do is run npm run eject
in your project setup. This will allow you to edit the default project configurations according to your needs.
After ejecting you will find a eslintConfig
key in your project root's package.json
file. Just delete this option from the package.json. You can add your own custom configuration for the Eslint by adding a .eslintrc
file in your project root directory. You can read about different rules and configurations here
Upvotes: -5