Closed SuperKXT closed 8 months ago
Hello, @hluisson , please :) π
Here's the warning that appears (with pnpm
):
$ pnpm install
βWARNβ Issues with peer dependencies found
.
βββ¬ eslint-plugin-jsx-expressions 1.3.1
βββ β unmet peer @typescript-eslint/parser@"^4.0.0 || ^5.0.0": found 6.2.1
And this actually causes a failure with npm
when running npm install
in a project that uses @typescript-eslint/*@^6.0.0
packages, since npm
is a bit more picky with peer dependencies:
$ npm i
npm notice
npm notice New major version of npm available! 8.19.2 -> 10.0.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.0.0
npm notice Run npm install -g npm@10.0.0 to update!
npm notice
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: eslint-plugin-jsx-expressions@1.3.1
npm ERR! Found: @typescript-eslint/parser@6.6.0
npm ERR! node_modules/@typescript-eslint/parser
npm ERR! peer @typescript-eslint/parser@"^6.3.0" from eslint-config-upleveled@5.0.4
npm ERR! node_modules/eslint-config-upleveled
npm ERR! dev eslint-config-upleveled@"^5.0.4" from the root project
npm ERR! peer @typescript-eslint/parser@"^6.0.0 || ^6.0.0-alpha" from @typescript-eslint/eslint-plugin@6.6.0
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR! peer @typescript-eslint/eslint-plugin@"^6.3.0" from eslint-config-upleveled@5.0.4
npm ERR! node_modules/eslint-config-upleveled
npm ERR! dev eslint-config-upleveled@"^5.0.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @typescript-eslint/parser@"^4.0.0 || ^5.0.0" from eslint-plugin-jsx-expressions@1.3.1
npm ERR! node_modules/eslint-plugin-jsx-expressions
npm ERR! peer eslint-plugin-jsx-expressions@"^1.3.1" from eslint-config-upleveled@5.0.4
npm ERR! node_modules/eslint-config-upleveled
npm ERR! dev eslint-config-upleveled@"^5.0.4" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @typescript-eslint/parser@5.62.0
npm ERR! node_modules/@typescript-eslint/parser
npm ERR! peer @typescript-eslint/parser@"^4.0.0 || ^5.0.0" from eslint-plugin-jsx-expressions@1.3.1
npm ERR! node_modules/eslint-plugin-jsx-expressions
npm ERR! peer eslint-plugin-jsx-expressions@"^1.3.1" from eslint-config-upleveled@5.0.4
npm ERR! node_modules/eslint-config-upleveled
npm ERR! dev eslint-config-upleveled@"^5.0.4" 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! See /home/runner/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2023-09-05T11_35_09_217Z-debug-0.log
@hluisson would you be open to upgrading the peer dependency on @typescript-eslint/parser@^6
?
It may also need a switch away from the @typescript-eslint/experimental-utils
package to @typescript-eslint/utils
, used here:
Hey - this is on my radar, but for fastest resolution feel free to submit a PR!
I'm currently looking into it and noticed the following:
@typescript-eslint/parser
to ^6
(which I guess would be necessary if the peer dependency is updated) only works if the switch from the @typescript-eslint/experimental-utils package to @typescript-eslint/utils is made as @karlhorky mentionedRuleTester
is now a separate package
utils
package, I can't get the tests to run locally:
Test suite failed to run
Cannot find module '@typescript-eslint/utils/eslint-utils' from 'node_modules/@typescript-eslint/rule-tester/dist/RuleTester.js'
Require stack:
node_modules/@typescript-eslint/rule-tester/dist/RuleTester.js
node_modules/@typescript-eslint/rule-tester/dist/index.js
tests/lib/rules/strict-logical-expressions.test.ts
Another thing I noticed was that a change to the tsconfig.build.json
(switching from node
to node16
or similar in the moduleResolution
) would have to be made according to this issue
I recently tackled upgrading this with what seems like mostly similar issues here: https://github.com/gund/eslint-plugin-deprecation/pull/71
You can look at that for inspiration, otherwise I might get around to making a similar PR here as well soon!
Until this is fixed, you can override the dependencies to the latest version:
Eg using npm Overrides:
package.json
{
"overrides": {
"@typescript-eslint/eslint-plugin": "6.9.1",
"@typescript-eslint/parser": "6.9.1"
}
}
(or Yarn Resolutions or pnpm Overrides)
Hey all - thanks for your patience. I will publish 1.3.2 as soon as possible.
1.3.2 is now live!
@hluisson Thanks so much, I can confirm this is working now, no more peer dependency warnings π
Typescript-eslint just released v6. I'm getting a peer dependency mismatch warning after updating.