Warn when package.json contains an invalid "type" value
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 122k
- Forks
- 37.3k
- Ø Merge
- 4 T. 2 Std.
- Gemergte PRs (30 T.)
- 283
Beschreibung
What is the problem this feature will solve?
Valid (meaningful) values are:
commonjsmodule
I had set CommonJS, and it behaves the same as if type was unset, which is so close to the actual commonjs behavior, that I thought I had set it correctly. But I kept having cases resulting in the MODULE_TYPELESS_PACKAGE_JSON warning, instead of failing hard.
Note that while tsconfig.js ignores case, the canonical version is CommonJS, so I never considered that I was using incorrect case.
What is the feature you are proposing to solve the problem?
Raise warning/error if "type" is set, but value is none of commonjs or module.
What alternatives have you considered?
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit nachzuverfolgen, wo Node.js das type-Feld von package.json verarbeitet und die Warnung MODULE_TYPELESS_PACKAGE_JSON ausgibt; das Issue nennt keine Quelldatei und keinen Test, daher sollte dieser Pfad und seine bestehende Abdeckung zuerst ermittelt werden. Definiere und teste das gewählte Warnungs- oder Fehlerverhalten für andere Werte als commonjs und module, wobei diese kanonischen Werte erhalten bleiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- backend
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100