hluisson / eslint-plugin-jsx-expressions

Rules for safe logical expressions in JSX
95 stars 12 forks source link

Update peer dependencies to include `@typescript-eslint/parser` v6 #13

Closed SuperKXT closed 8 months ago

SuperKXT commented 1 year ago

Typescript-eslint just released v6. I'm getting a peer dependency mismatch warning after updating.

bcentdev commented 1 year ago

Hello, @hluisson , please :) πŸ”

karlhorky commented 11 months ago

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
karlhorky commented 10 months ago

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
karlhorky commented 10 months ago

@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:

https://github.com/hluisson/eslint-plugin-jsx-expressions/blob/cb612d1be4c184542987b563422562b42b41486a/package.json#L26-L29

hluisson commented 10 months ago

Hey - this is on my radar, but for fastest resolution feel free to submit a PR!

DerTimonius commented 10 months ago

I'm currently looking into it and noticed the following:

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

stianjensen commented 9 months ago

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!

karlhorky commented 8 months ago

Workaround

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)

hluisson commented 8 months ago

Hey all - thanks for your patience. I will publish 1.3.2 as soon as possible.

hluisson commented 8 months ago

1.3.2 is now live!

karlhorky commented 8 months ago

@hluisson Thanks so much, I can confirm this is working now, no more peer dependency warnings πŸ™Œ