microsoft / microsoft/node-jsonc-parser
Perhaps trailing commas should be enabled by default
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 759
- Fork
- 66
- Merge medio
- 5g 10h
- PR unite (30g)
- 7
Descrizione
For any use of JSONC that is user-facing in VS code, for example in a .jsonc file saved by the user, or even the user settings JSONC file, trailing commas don't trigger an error:
-
User config example:
-
Standalone
.jsoncfile example: -
Only in
.jsonis it shown as an error:
Visual Studio Code's own uses of JSONC seem for uses where trailing commas are desired, like the user config. An intended strength of the JSONC format seems to be easy user editing and writing. For "strict" uses of automatically generated files where the syntax is meant to stay super correct, there's still JSON as there always was as the more common choice.
Based on this, I would suggest that perhaps trailing commas should be enabled in the parser by default, so that e.g. parsing the VS Code config in JSONC works without manual changes.
I'm sure some will disagree, but the option to turn it off would remain in any case.
(Please note I'm not suggesting to remove the warning in the VS Code UI about trailing commas as discussed here, since I realize other JSONC parsers might still treat this differently.)
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 dal valore predefinito dell’opzione del parser in src/impl/parser.ts, nella posizione collegata, quindi esamina come vengono gestite le virgole finali nelle altre parti del repository. Determina se abilitarle per impostazione predefinita preserva il comportamento di opt-out e aggiorna i test pertinenti del parser per confermare entrambi i valori predefiniti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- devtools
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100