首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在使用和扩展‘eslintrc.js airbnb’的同时,我是否必须在eslintrc.js配置中使用和“扩展”eslint-plugin-react?

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

Stack Overflow用户
提问于 2022-07-05 08:48:36
回答 1查看 258关注 0票数 0

我更新了我的Eslint规则使用airbnb在我的反应类型成绩单项目。

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

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

我在extend属性eslintrc.js中有这样的内容:

代码语言:javascript
复制
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并做出反应,我是否需要扩展'plugin:react/recommended',或其他东西,或者我可以删除它,因为我使用的是airbnbairbnb-typescript

与扩展“是”或“否”'plugin:react-hooks/recommended'的问题相同(因为如上所述,eslint-plugin-react-hooks也是eslint-config-airbnb的对等依赖项)。

EN

回答 1

Stack Overflow用户

发布于 2022-11-29 08:18:25

据我所知,您不需要添加plugin:react/recommended,因为您使用的是爱彼迎。如果您使用plugin:react-hooks/recommended,也可以使用airbnb/hooks

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72866515

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档