[英]How to add custom lint rules in create-react-app without ejecting the boilerplate?
I'm trying to add custom lint rules on top of the lint rules that come out of the box with create-react-app. 我试图在使用create-react-app开箱即用的皮棉规则之上添加自定义皮棉规则。 Doing so throws error about versioning issue of certain lint packages while running the build.
这样做会在运行构建时引发有关某些lint软件包版本控制问题的错误。
Create new files .eslintrc
and add following code. 创建新文件
.eslintrc
并添加以下代码。 You can customize the rules as required. 您可以根据需要自定义规则。
{ "extends": ["equimper", "prettier"], "plugins": ["prettier"], "rules": { "prettier/prettier": "error", "experimentalDecorators":"true" } }
Also add following packages as dev depencency. 还要添加以下软件包作为dev依赖。 You can modify as required.
您可以根据需要进行修改。
*
will install latest version in this case. *
在这种情况下将安装最新版本。
"devDependencies": { "eslint": "*", "eslint-config-equimper": "*", "eslint-config-prettier": "*", "eslint-plugin-prettier": "*", "prettier": "*" }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.