[英]Do I have to use and 'extend' eslint-plugin-react in eslintrc.js config while using and extending 'eslint-config-airbnb' already
I updated my Eslint rules using airbnb in my React typescript project.我在我的 React typescript 项目中使用 airbnb 更新了我的 Eslint 规则。
My project doesn't use 'create-reac-app'.我的项目不使用“create-reac-app”。 So I have to extend
airbnb
since I am also using and extending airbnb-typescript
.所以我必须扩展
airbnb
因为我也在使用和扩展airbnb-typescript
。
eslint-plugin-react
and eslint-plugin-react-hooks
are peer dependencies of eslint-config-airbnb
. eslint-plugin-react
和eslint-plugin-react-hooks
是eslint-config-airbnb
的对等依赖。 So do I need to extend plugin:react/recommended'
?那么我需要扩展
plugin:react/recommended'
吗?
I have this in the extend
property inside eslintrc.js:我在 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',
],
To get the best out of Eslint and React, do I have to extend 'plugin:react/recommended',
or something else or can I remove it since I am using airbnb
and airbnb-typescript
?为了充分利用 Eslint 和 React,我是否必须扩展
'plugin:react/recommended',
或者我可以将其删除,因为我正在使用airbnb
和airbnb-typescript
吗?
And the same question I have with extending yes or no 'plugin:react-hooks/recommended'
(since eslint-plugin-react-hooks
is also a peer dependency of eslint-config-airbnb
as mentioned above).我对扩展 yes or no
'plugin:react-hooks/recommended'
有同样的问题(因为eslint-plugin-react-hooks
也是eslint-config-airbnb
的对等依赖,如上所述)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.