簡體   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