Plugin "react" was conflicted between ".eslintrc.json » eslint-config-airbnb and "BaseConfig eslint-config-react-app

524 Views Asked by At

after upgrading react-scripts to v5.0.1 , I did upgrade to eslint plugins too . when I try to run the app I'm getting this Error message that show conflict between eslinrc file at eslint-config-airbnb and eslint-config-react-app

 [eslint] Plugin "react" was conflicted between ".eslintrc.json » eslint-config-airbnb » /node_modules/eslint-config-airbnb/rules/react-a11y.js" and "BaseConfig » 
/node_modules/eslint-config-react-app/base.js".

package.json file :

"devDependencies": {
        "eslint-config-react": "1.1.7",
        "eslint-plugin-json": "3.1.0",
        "@babel/eslint-parser": "^7.18.9",
        "@babel/preset-env": "^7.16.11",
        "@babel/preset-react": "^7.18.6",
        "eslint-config-airbnb": "^18.1.0",
        "eslint-config-prettier": "8.5.0",
        "eslint-plugin-cypress": "^2.12.1",
        "eslint-plugin-import": "2.25.3",
        "eslint-plugin-jsx-a11y": "6.5.1",
        "eslint-plugin-prettier": "4.2.1",
        "eslint-plugin-react": "7.30.1",
        "eslint-plugin-react-hooks": "4.3.0",
        "prettier": "2.3.2"
    },
    "eslintConfig": {
        "extends": [
            "react-app"
        ]
    }

.eslintrc.js :

{
  "root": true,
  "parser": "@babel/eslint-parser",
  "env": {
    "browser": true,
    "es6": true,
    "node": true
  },
  "parserOptions": {
    "ecmaVersion": 2020,
    "sourceType": "module",
    "requireConfigFile": false,
    "babelOptions": {
      "presets": ["@babel/preset-react"]
    },
    "ecmaFeatures": {
      "jsx": true,
      "modules": true
    }
  },
  "extends": [
    "airbnb",
    "plugin:prettier/recommended",
    "plugin:cypress/recommended"
  ],
  "globals": {
    "Atomics": "readonly",
    "SharedArrayBuffer": "readonly"
  },
  "settings": {
    "react": {
      "version": "detect"
    },
    "import/resolver": {
      "node": {
        "paths": [
          "src",
          "cypress"
        ],
        "extensions": [
          ".js",
          ".jsx",
          ".ts",
          ".tsx"
        ]
      }
    }
  },
  "plugins": [
    "react-hooks",
    "cypress",
    "json"
  ],

tried to downgrade eslint-config-airbnb version .

0

There are 0 best solutions below