import-js / eslint-plugin-import

ESLint plugin with rules that help validate proper imports.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possibly confusing error message due to bias in package manager

handeyeco opened this issue · comments

While working on our code (source), one of my peers encountered this error message:

'package-name' should be listed in the project's dependencies. Run 'npm i -S package-name' to add it

(source)

However when they ran the suggested fix, they ran into a series of confusing issues - because we use yarn!

With the rise of yarn and now pnpm, I wonder if it'd be beneficial to either:

  • Remove the npm suggestion so as to not confuse users
  • Allow this to be configurable, maybe with a set of options:
    • npm
    • yarn
    • pnpm
    • exclude suggestion

I'd be glad to work on a PR if either of these suggestions would be accepted.

This isn't a "bias" - npm is the de facto standard, and anyone using an alternative package manager always needs to "just know" how to translate npm commands to their package manager of choice.

yarn already has a suggested way of avoiding this problem, which is to use corepack.