Skip to content

Use // comments for .json#3388

Merged
JoeKar merged 2 commits intomicro-editor:masterfrom
injust:patch-1
Jul 30, 2024
Merged

Use // comments for .json#3388
JoeKar merged 2 commits intomicro-editor:masterfrom
injust:patch-1

Conversation

@injust
Copy link
Contributor

@injust injust commented Jul 14, 2024

Add comments to .json files using // instead of the default #.

Even though JSON does not support comments, JSON5 and JSONC exist, so // is a much more sane default. It also improves the experience of editing micro's own config files.

@plutonium-239
Copy link

Thanks, hoping this gets merged soon

@JoeKar
Copy link
Member

JoeKar commented Jul 30, 2024

From my perspective it's good to chain the default from # to // in case the comment plugin is used within json.
But the user has to keep in mind, that he can add potential issues to JSONs which aren't parsed with json5 or jsonc. Since before a # was added it's most probably not a big deal and adds at least the correct comment type for newer JSONs.

@JoeKar JoeKar merged commit b8772b6 into micro-editor:master Jul 30, 2024
@injust injust deleted the patch-1 branch July 30, 2024 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants