[RRFC] Add a field to package.json recommending that the package be unique.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 777
- Forks
- 267
- PR merge metrics
- No merged PRs in 30d
Description
Motivation ("The Why")
There can be a problem when multiple versions of a package in dependencies. but we generally find it difficult to issue warnings without false positives.
However, in the case of a package that uses a global store, such as React, multiple versions are not expected to be used at the same time in most cases. This often occurs as a runtime error and is a source of confusion.
Therefore, I think it would be better to add a field like recommendUnique: boolean that recommend such a package to be unique and issue a warning on any lint tools or npm ownself.
Example
package.json
{
"recommendUnique": true
}
How
Current Behaviour
Desired Behaviour
$ some-linting-tool or npm install
[warn] `React` recommend unique version but detect multiple version. please run `npm ls` and solve it.
References
- Related React Issue: https://github.com/facebook/react/issues/13991
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 with the proposed package.json field and the referenced React issue, then review how npm install, npm ls, or linting tools could consume the recommendation. Before implementation, the RFC needs agreement on field semantics, warning ownership, and how multiple versions are detected; done means those behaviors are specified and accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100