![](/img/trans.png)
[英]Eslint Plugin "react"was conflicted between .eslintrc.json >> eslint-config-airbnb
[英]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-react
和eslint-plugin-react-hooks
是eslint-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',
或者我可以將其刪除,因為我正在使用airbnb
和airbnb-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.