Gatsby - Conflicting peer dependency: with eslint-config-react-app and @typescript-eslint/eslint-plugin

131 Views Asked by At

I am using gatsby (5.12.3). I found that it has a dependency on "@typescript-eslint/eslint-plugin": "^5.60.1" and "eslint-config-react-app": "^6.0.0",

The "eslint-config-react-app" has a dependency on "@typescript-eslint/eslint-plugin": "^4.0.0"

The latest "@typescript-eslint/eslint-plugin" is "^6.4.1"

So I am getting the "conflicting peer dependency". It works only if i use --legacy-peer-dep

gatsby (5.12.3)
--- "@typescript-eslint/eslint-plugin": "^5.60.1",
--- "eslint-config-react-app": "^6.0.0",
   --- "@typescript-eslint/eslint-plugin": "^4.0.0",
1

There are 1 best solutions below

0
datawookie On

Try this set of dependencies:

"dependencies": {
  "@babel/core": "^7.12.3",
  "@typescript-eslint/eslint-plugin": "^4.0.0",
  "@typescript-eslint/parser": "^4.0.0",
  "babel-eslint": "^10.0.0",
  "eslint": "^7.0.0",
  "gatsby": "5.12.3",
  "react": "18.2.0",
  "react-dom": "18.2.0",
  "typescript": "5.3.3",
  "webpack": "^5.0.0"
}

You might get a warning about react-server-dom-webpack but I believe that's benign.

You should be able to bump Gatsby up to 5.13.3 with the same set of dependencies if you want to be closer to the bleeding edge.