ESlint throw errors instead of warnings

☆樱花仙子☆ 提交于 2020-01-05 04:21:12

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/51346302/eslint-throw-errors-instead-of-warnings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!