简体   繁体   中英

ESlint throw errors instead of warnings

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?

--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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM