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

ESLint peer dependency causing issues

Open fab1o opened this issue 2 years ago • 2 comments

I've been using this plugin version 8.0.0 in my projects to run ESLint 6.8.0 for over a year and it was working fine until today. Because today, I ran a fresh npm install

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   eslint@"6.8.0" from the root project

So this comment is not 100% correct. As showed above, it does not only cause a warning, it causes an error

My point is: if 8.0.0 doesn't require a higher version of ESLint (and thus we could still use an earlier version) then there should not be a peerDependency or that should be of a version that is still compatible.

fab1o avatar Apr 11 '22 21:04 fab1o

ESLint v7 is already declared as a peer dependency since eslint-plugin-mocha v7. So this is nothing new.

The comment you mentioned seems also correct given the context that it was written 2 years ago. Back then npm ignored peerDependency incompatibilities and printed only a warning. This has changed with npm v7 which now automatically installs missing peer dependencies. So my guess is that you are now using npm > 7. Could that be the case?

lo1tuma avatar Apr 12 '22 07:04 lo1tuma

It sure is. I was able to downgrade this to 6.3.0 without issues so that solved it, but I just wanted to leave this here for future reference and knowledge sharing.

If you could release a 8.0.1 with a peerDependency ESLint >=6 that would be another way of solving this (since it supports ESLint 6 right?) but downgrading was okay for me for now so not a big deal.

Eventually I'd like to upgrade ESLint and all plugins, but this is the only one that caused this issue

fab1o avatar Apr 12 '22 21:04 fab1o