繁体   English   中英

在已经使用和扩展“eslint-config-airbnb”的同时,我是否必须在 eslintrc.js 配置中使用和“扩展”eslint-plugin-react

[英]Do I have to use and 'extend' eslint-plugin-react in eslintrc.js config while using and extending 'eslint-config-airbnb' already

我在我的 React typescript 项目中使用 airbnb 更新了我的 Eslint 规则。

我的项目不使用“create-reac-app”。 所以我必须扩展airbnb因为我也在使用和扩展airbnb-typescript

eslint-plugin-reacteslint-plugin-react-hookseslint-config-airbnb的对等依赖。 那么我需要扩展plugin:react/recommended'吗?

我在 eslintrc.js 的extend属性中有这个:

extends: [
    'airbnb',
    'airbnb-typescript',
    'airbnb/hooks',
    // "plugin:@typescript-eslint/recommended",
    // "plugin:@typescript-eslint/recommended-requiring-type-checking",
    // "plugin:eslint-comments/recommended",
    'plugin:react/recommended',
    'plugin:jest/recommended',
    'plugin:prettier/recommended',
  ],

为了充分利用 Eslint 和 React,我是否必须扩展'plugin:react/recommended',或者我可以将其删除,因为我正在使用airbnbairbnb-typescript吗?

我对扩展 yes or no 'plugin:react-hooks/recommended'有同样的问题(因为eslint-plugin-react-hooks也是eslint-config-airbnb的对等依赖,如上所述)。

据我了解,您不需要添加plugin:react/recommended因为您使用的是airbnb plugin:react-hooks/recommended如果你使用airbnb/hooks

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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