官方说明
Note that even if you customise your ESLint config, these changes will only affect the editor integration. They won’t affect the terminal and in-browser lint output. This is because Create React App intentionally provides a minimal set of rules that find common mistakes.
Experimental: Extending the ESLint config
We recognise that in some cases, further customisation is required. It is now possible to extend the base ESLint config by setting the EXTEND_ESLINT
environment variable to true
. See advanced configuration for more information on available environment variables. Note that any rules set to "error"
will stop the project from building.
解决方法
根目录添加.env
EXTEND_ESLINT=true
网友评论