[RRFC] Stop removing or give option not to remove `dependencies`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 777
- Forks
- 267
- PR merge metrics
- No merged PRs in 30d
Description
Motivation ("The Why")
Hi,
I like to preserve dependencies (and devDependencies, etc.) even when it is empty in package.json. I can search through a large file to find the dependencies (without getting a thunk noise from my IDE that it doesn't exist), and it just makes clear at a glance to those browsing the status (e.g., of having no dependencies).
Example
As others have pointed out, not removing dependencies would help avoid diff noise.
How
Current Behaviour
The property currently gets removed upon performing npm install or npm uninstall.
Desired Behaviour
Please don't remove dependencies or other dependency fields when performing npm install or npm uninstall, etc., even if they are left empty. Or, at the very least, please consider configuration to disable this behavior.
Thanks!
References
- n/a
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
Start by reviewing the issue's examples and the referenced npm feedback discussion. Examine how npm install and npm uninstall currently handle dependency fields in package.json, then determine the intended behavior or configuration boundary. Done means an agreed proposal covering empty dependencies, devDependencies, and related fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100