Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint-config-react-app causing conflicts after updating @typescript-eslint to v6 #13286

Open
SuperKXT opened this issue Jul 12, 2023 · 3 comments

Comments

@SuperKXT
Copy link

Describe the bug

I updated a project to the newly released version 6 of @typescript-eslint. After the update, I'm getting eslint conflicts with eslint-plugin-imports and @typescript-eslint plugins. I think the fix is to update the dependencies in eslint-config-react-app but I am not sure.

Here is the full error

Uncaught exception received.
Error: Plugin "import" was conflicted between ".eslintrc.cjs#overrides[0] » eslint-config-react-app" and ".eslintrc.cjs".
    at mergePlugins (/home/superkxt/repos/personal/client-management/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:598:19)
    at createConfig (/home/superkxt/repos/personal/client-management/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:701:9)
    at ConfigArray.extractConfig (/home/superkxt/repos/personal/client-management/node_modules/.pnpm/@[email protected]/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:877:33)
    at CLIEngine.getConfigForFile (/home/superkxt/repos/personal/client-management/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/cli-engine/cli-engine.js:981:14)
    at ESLint.calculateConfigForFile (/home/superkxt/repos/personal/client-management/node_modules/.pnpm/[email protected]/node_modules/eslint/lib/eslint/eslint.js:667:26)
    at /home/superkxt/.vscode/extensions/dbaeumer.vscode-eslint-2.4.2/server/out/eslintServer.js:1:22644
    at Object.E [as withClass] (/home/superkxt/.vscode/extensions/dbaeumer.vscode-eslint-2.4.2/server/out/eslintServer.js:1:19218)
    at w.then.g.validate (/home/superkxt/.vscode/extensions/dbaeumer.vscode-eslint-2.4.2/server/out/eslintServer.js:1:22610)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

None.

Expected behavior

ESLint should work

Actual behavior

ESLint errors and lining stops working

@Asanio06
Copy link

Asanio06 commented Sep 10, 2023

I have the same issue. For the moment i resolve it by adding :

"resolutions": {
    "@typescript-eslint/eslint-plugin": "your typescript eslint version",
    "@typescript-eslint/parser": "your typescript eslint version"
  },

@dominicfraser
Copy link

I arrived here trying to debug the

Parsing error: DeprecationError: 'originalKeywordKind' has been deprecated since v5.0.0 and can no longer be used

warning message that comes from @typescript-eslint/* dependencies being below v6 when using TypeScript 5.2.2.

Similar to @Asanio06 I found that I had a nested dependency on eslint-config-react-app, and needed to use npm's overrides syntax to solve it (rather than yarn's resolutions).

This was pulled in via a storybook plugin in our case:

└─┬ @storybook/[email protected] 
  └─┬ [email protected]
    └─┬ [email protected]
      ├─┬ @typescript-eslint/[email protected]
      │ └── @typescript-eslint/[email protected] 
      └── @typescript-eslint/[email protected]

In our project we must now use:

  "overrides": {
    "typescript": "^5.2.2",
    "@typescript-eslint/parser": "^6.7.5"
  }

(with typescript being due to react-scripts only allowing up to v4 as a peer dependency:
#13283)

dgdavid added a commit to jangouts/jangouts that referenced this issue Nov 13, 2023
To avoid the

> Parsing error: DeprecationError: 'originalKeywordKind' has been
deprecated since v5.0.0 and can no longer be used. Use
'identifierToKeywordKind(identifier)' instead.

In this case, ESlint has to be fixed to version 8.47.0

Read more at below links:

  - https://stackoverflow.com/questions/76996326/parsing-error-deprecationerror-originalkeywordkind-has-been-deprecated-since
  - facebook/create-react-app#13286
acherkashin added a commit to acherkashin/codereview-analyzer that referenced this issue Feb 23, 2024
@nbkhope
Copy link

nbkhope commented Nov 12, 2024

I upgraded the following dependencies to the latest version as of Nov 12, 2024, and get the following problem with npm install:

package.json

    "@typescript-eslint/eslint-plugin": "^8.14.0",
    "@typescript-eslint/parser": "^8.14.0",

npm install

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @my/[email protected]        
npm ERR! Found: @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR!   @typescript-eslint/eslint-plugin@"^8.14.0" from the root project
npm ERR!   @typescript-eslint/eslint-plugin@"^5.5.0" from [email protected]
npm ERR!   node_modules/eslint-config-react-app
npm ERR!     eslint-config-react-app@"^7.0.1" from the root project       
npm ERR!   2 more (eslint-plugin-jest, eslint-plugin-jest)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @typescript-eslint/eslint-plugin@"^8.14.0" from the root project 
npm ERR!
npm ERR! Conflicting peer dependency: @typescript-eslint/[email protected]    
npm ERR! node_modules/@typescript-eslint/parser
npm ERR!   peer @typescript-eslint/parser@"^8.0.0 || ^8.0.0-alpha.0" from @typescript-eslint/[email protected]
npm ERR!   node_modules/@typescript-eslint/eslint-plugin
npm ERR!     @typescript-eslint/eslint-plugin@"^8.14.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\user\AppData\Local\npm-cache\_logs\2024-11-12T12_37_05_759Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: C:\Users\user\AppData\Local\npm-cache\_logs\2024-11-12T12_37_05_759Z-debug-0.log

Other packages

It's also blocking upgrading of other packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants