Skip to content

Perhaps trailing commas should be enabled by default #103

@ell1e

Description

@ell1e

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:

  1. User config example:

    Image
  2. Standalone .jsonc file example:

    Image
  3. Only in .json is it shown as an error:

    Image

Visual Studio Code's own uses of JSONC seem for uses where trailing commas are desired, like the user config. A strength of the JSONC format seems to be meant to be to allow 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 people will disagree, but the option to turn it off would remain in any case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions