I'm getting a warning when installing via npm npm install -g eslint-plugin-jsx-a11y
I have latest eslint installed, ergo [email protected]
But still I get:
UNMET PEER DEPENDENCY eslint@^2.10.2 || 3.x
npm WARN [email protected] requires a peer of eslint@^2.10.2 || 3.x but none was installed.
So what am I getting wrong here?
@almadsen are you still running into this?
It might not be a bad idea to instead of installing eslint and eslint plugins globally, to include them as devDependencies on your projects. That will allow you to control the versions of the plugins in the same place you configure them, and make it so everyone who works on the package keeps their versions in sync with each other. I think it would also help out with issues like this one.
I have the same problem. Why does v3.16.1 not qualify as 3.x? No, I don't want to install eslint locally.
@H2CO3 eslint should only ever be installed locally, as should almost everything else.
Peer deps are troublesome with global installs.
That is ridiculous.
Why is that ridiculous? linting is a highly project-specific concern, and any linting done on a project by one dev should be trivially repeatable by every other dev on the project. Local installs + package.json is both the way that's possible, and the way it's done throughout the entire ecosystem.
A system-level linter running on an unlinted project benefits nobody.
Have you tried running both of them together?
npm install -g eslint-plugin-jsx-a11y [email protected]
In my experiences, if there are no errors about peer dependencies from npm -g list, it means they play well together.
Most helpful comment
Why is that ridiculous? linting is a highly project-specific concern, and any linting done on a project by one dev should be trivially repeatable by every other dev on the project. Local installs + package.json is both the way that's possible, and the way it's done throughout the entire ecosystem.
A system-level linter running on an unlinted project benefits nobody.