Skip to content

renovate: Suggest using .jsonc instead of .json5 - #1149

Open
hashcatHitman wants to merge 1 commit into
rust-lang:mainfrom
hashcatHitman:jsonc-over-json5-please
Open

hashcatHitman wants to merge 1 commit into
rust-lang:mainfrom
hashcatHitman:jsonc-over-json5-please

Conversation

@hashcatHitman

@hashcatHitman hashcatHitman commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Renovate recommends we prefer using a .jsonc file if we want to add comments to our configuration, instead of a .json5 file. I'm not sure what their reasoning is, but here are my reasons:

  • VSCode/VSCodium do not and will not support JSON5, and require third-party extensions for it.
  • None of the extensions that do so are particularly widespread or well maintained, and I don't really want to install an extension like that for a file format that can definitely just be avoided.
  • I think unquoted JSON keys are weird and a misfeature.

Rendered

Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 4, 2026
@rustbot

rustbot commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

r? @emilyalbini

rustbot has assigned @emilyalbini.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: infra
  • infra expanded to 8 candidates
  • Random selection from 8 candidates

@apiraino

apiraino commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

ah, standards! (you already know where the link leads, right 😉 )

I have no dog in this fight but looking at Wikipedia, it looks like that:

  • JSON5 is an ECMAScript standard adding trailing commas, unquoted object keys, single quoted and multiline strings, additional number formats, and comments
  • JSONC (json with comments) is a proprietary extension of Microsoft that only adds comments - so no surprise they don't want to support JSON5

@hashcatHitman

Copy link
Copy Markdown
Member Author

ah, standards! (you already know where the link leads, right 😉 )

Sadly.

  • JSONC (json with comments) is a proprietary extension of Microsoft that only adds comments - so no surprise they don't want to support JSON5

Yeah. Love it or hate it though, the JSON5 support in VSCode and friends is quite poor. And given VS Code was the single most popular editor in the last three Annual State Of Rust surveys (by a decent margin) (which isn't necessarily including derivatives like VSCodium, listed separately), I think it makes sense to prefer JSONC anyway.

Anyway, I don't feel super strongly about this, but it has been mildly annoying me. So I figured I'd just see where this goes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants