eslint-plugin-github icon indicating copy to clipboard operation
eslint-plugin-github copied to clipboard

`peerDependencies` incompatible with dependency `@eslint/compat`

Open silverwind opened this issue 1 year ago • 2 comments

This package depends on "@eslint/compat": "^1.2.3" which specifies:

  "peerDependencies": {
    "eslint": "^9.10.0"
  },

which is incompatible with the module's peer dependencies:

https://github.com/github/eslint-plugin-github/blob/abcfc3bdfb4628c75fcbdca1b6fae1fa82cddb1c/package.json#L60

This results in a npm warning upon installation when eslint@8 is present:

npm warn ERESOLVE overriding peer dependency
npm warn While resolving: @eslint/[email protected]
npm warn Found: [email protected]
npm warn node_modules/eslint
npm warn   dev eslint@"8.57.0" from the root project
npm warn   41 more (@babel/eslint-parser, ...)
npm warn
npm warn Could not resolve dependency:
npm warn peerOptional eslint@"^9.10.0" from @eslint/[email protected]
npm warn node_modules/eslint-plugin-github/node_modules/@eslint/compat
npm warn   @eslint/compat@"^1.2.3" from [email protected]
npm warn   node_modules/eslint-plugin-github

The peer dependency was added in https://github.com/eslint/rewrite/pull/106.

silverwind avatar Dec 08 '24 09:12 silverwind

Any suggestions for a fix?

akielbas avatar Jan 07 '25 20:01 akielbas

The only fix I see is to to downgrade @eslint/compat to v1.1.1, the last version which did not have this peer dependency.

The problem only affects package managers that handle peer dependencies strictly like npm does without legacy-peer-deps. It's not an issue with pnpm for example.

Oh and there's one more option of course: drop eslint 8 support.

silverwind avatar Jan 13 '25 10:01 silverwind

I've moved to eslint 9 now, so I don't care about 8 any more

silverwind avatar Sep 14 '25 08:09 silverwind