简体   繁体   English

如何在不弹出样板的情况下在create-react-app中添加自定义棉绒规则?

[英]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.

相关问题 create-react-app 使用自定义 service worker 而不弹出 - create-react-app use custom service worker without ejecting create-react-app + Webpack 5 不弹出 - create-react-app + Webpack 5 without ejecting 如何在不弹出的情况下将 CopyWebpackPlugin 添加到 create-react-app? - How can I add the CopyWebpackPlugin to create-react-app without ejecting? 在 create-react-app 项目中使用 dotenv 文件而不弹出 - Using dotenv files in create-react-app project without ejecting 有没有办法在不弹出的情况下为 create-react-app 更改 webpack 的 eslint - Is there a way to change the eslint of the webpack for the create-react-app without ejecting 使用 styled-jsx 而不弹出 create-react-app - Use styled-jsx without ejecting create-react-app 如何在create-react-app中禁用CSS构建而不弹出? - How can I disable CSS builds in create-react-app without ejecting? 如何在不弹出的情况下将 Webpack 模块联合插件与 create-react-app 一起使用 - How to use Webpack Module Federation plugin with create-react-app without ejecting 如何在不弹出的情况下将 WebPack polyfill 添加到使用 React Create App 创建的 React App? - How do I add WebPack polyfill to React App created with React Create App without ejecting? 使用babel-preset-env进行转换,而无需从create-react-app弹出 - Transpile using babel-preset-env without ejecting from create-react-app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM