[Change] Make deprecation notices less scary
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
npm v10.4.0
What I did
npm install
What I saw
$ npm i
npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated glob@8.1.0: Glob versions prior to v9 are no longer supported
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
What's happening
The default behavior of npm is to warn about every deprecated packages in the entire installation, regardless of how deep it is inside of the dependency tree. In this case, these packages are used by eslint, and therefore, I personally don't have the ability to make any changes.
And as the maintainer of ESLint, we've been getting inundated with complaints about this even though these packages work fine.
Proposal
I'd like to propose the following changes:
- npm only shows an explicit deprecation warning for a package when install the package, specifically. So
npm install eslintwould show a deprecation warning foreslintbut if I donpm installin my project that useseslint, that would not report an explicit deprecation. - If I do
npm installin my project and any of my direct dependencies are deprecated, output something along the lines of:
16 dependencies are deprecated
run `npm deprecated` for details
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by reproducing the npm install output shown above and trace how npm reports deprecations for transitive and direct dependencies. Done means implementing the proposed warning behavior and summary command, with tests covering explicit installs and project installs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100