Warn when package.json contains an invalid "type" value
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 122k
- Fork
- 37.4k
- Merge medio
- 4g 3h
- PR unite (30g)
- 272
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando dove Node.js gestisce il campo type di package.json ed emette l’avviso MODULE_TYPELESS_PACKAGE_JSON; l’issue non indica alcun file sorgente né alcun test, quindi mappa prima quel percorso e la relativa copertura esistente. Definisci e testa il comportamento scelto di avviso o errore per i valori diversi da commonjs e module, preservando questi valori canonici.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript
- Ambito
- backend
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100