我必须使用和扩展' Eslint-Plugin-react在Eslintrc.js config中的使用和扩展' eslint-config-airbnb'已经
我在React TypeScript项目中使用Airbnb更新了我的ESLINT规则。
我的项目不使用“ create-reac-app”。因此,我必须扩展 airbnb
,因为我还使用并扩展了airbnb-typescript
。
ESLINT-PLUGIN-REACT
和Eslint-Plugin-react-Hooks
是Eslint-Config-airbnb
的同伴依赖性。那么,我需要扩展插件:react/推荐'
吗?
我在Eslintrc.js中的扩展
属性中都有这个:
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中获得最佳还有其他东西,或者我可以将其删除,因为我正在使用airbnb
和airbnb-typescript
?
以及我在扩展是或否'插件的问题上也有同样的问题:react-hooks/puseed'
(因为eSlint-plugin-react-hooks
也是<的同行依赖性<代码> Eslint-Config-airbnb ,如上所述)。
I updated my Eslint rules using airbnb in my React typescript project.
My project doesn't use 'create-reac-app'. So I have to extend airbnb
since I am also using and extending airbnb-typescript
.
eslint-plugin-react
and eslint-plugin-react-hooks
are peer dependencies of eslint-config-airbnb
. So do I need to extend plugin:react/recommended'
?
I have this in the extend
property inside eslintrc.js:
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
?
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).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知href =“ https://www.npmjs.com/package/eslint-config-airbnb#:%7e:text=OUR%20Default%20Export%20Contains%20Contains%20Most%20OF%20OF%20OF%20OF%20ESLINT%20ESLINT%20RULES%20RULES%2C%20INCLUDINGINGIMPIM20ECMASSCMASSCMASSCMASSCRAPTERCMASSCRAPT %206%2B%20和%20REACT“ rel =” nofollow noreferrer“> airbnb 。与
插件相同:React-Hooks/推荐
如果使用airbnb/hooks
。As far as I understand you don't need to add
plugin:react/recommended
since you are using airbnb. Same withplugin:react-hooks/recommended
if you useairbnb/hooks
.