Feedback: json vs jsonc #402

Closed
opened 2026-10-05 02:45:10 +02:00 by adam · 7 comments
Owner

I don't know what JSON parsers this project uses for the configuration file, but sometimes I wish I could add some form of a comment to some of my settings. Having JSONC as a format would enable us to just add some inline comments. I know it looks like a proprietary format, but adding faux elements to my JSON to comment on things feels bloated and false :D

Other formats like YAML and TOML have commenting features.

I don't know what JSON parsers this project uses for the configuration file, but sometimes I wish I could add some form of a comment to some of my settings. Having JSONC as a format would enable us to just add some inline comments. I know it looks like a [proprietary format](https://github.com/Microsoft/node-jsonc-parser), but adding faux elements to my JSON to comment on things feels bloated and false :D Other formats like YAML and TOML have commenting features. <!-- github-sync-id:1593648156 -->
adam closed this issue 2026-10-05 02:45:10 +02:00
Author
Owner

I would love to be able to use JSONC or YAML as the configuration document language. Much more maintainable for me and I use comments extensively.

I would _love_ to be able to use JSONC or YAML as the configuration document language. Much more maintainable for me and I use comments extensively. <!-- github-comment-id:1438773228 -->
Author
Owner

Front Matter uses the parser you mentioned.

You can also add your file association that VSCode should treat your JSON file as JSONC.

"files.associations": {
  "frontmatter.json": "jsonc"
}

I will check if this file association can be added by the extension itself.

Front Matter uses the parser you mentioned. You can also add your file association that VSCode should treat your JSON file as JSONC. ```json "files.associations": { "frontmatter.json": "jsonc" } ``` I will check if this file association can be added by the extension itself. <!-- github-comment-id:1473736158 -->
Author
Owner

Added the file association in the default configuration of the extension. That way, you don't have to do anything.

Xnapper-2023-03-17-13 12 33

Added the file association in the default configuration of the extension. That way, you don't have to do anything. ![Xnapper-2023-03-17-13 12 33](https://user-images.githubusercontent.com/2900833/225901008-ccd525a3-3c20-4bd3-ae56-06d2cf6f9246.png) <!-- github-comment-id:1473741389 -->
Author
Owner

Immediately going to update my repos to use this. It looks like this is scoped to make frontmatter.jsonc "just work" - would be great to get this for the other config files if possible (and happy to add an issue for that if it's considered a different scope).

Immediately going to update my repos to use this. It looks like this is scoped to make `frontmatter.jsonc` "just work" - would be great to get this for the other config files if possible (and happy to add an issue for that if it's considered a different scope). <!-- github-comment-id:1473926211 -->
Author
Owner

In the beta and upcoming version, you can just keep using the frontmatter.json file, no use to update it to jsonc. VSCode will use it as jsonc as I defined to treat frontmatter.json like that.

In the beta and upcoming version, you can just keep using the `frontmatter.json` file, no use to update it to `jsonc`. VSCode will use it as `jsonc` as I defined to treat `frontmatter.json` like that. <!-- github-comment-id:1473943828 -->
Author
Owner

Ohhh! I misunderstood. That's rad. Similar question though about comments/format in the other files (like in the .frontmatter folder).

Ohhh! I misunderstood. That's rad. Similar question though about comments/format in the other files (like in the `.frontmatter` folder). <!-- github-comment-id:1473951698 -->
Author
Owner

I can add it for any json file in the .frontmatter/config folder as well, makes sense!

I can add it for any `json` file in the `.frontmatter/config` folder as well, makes sense! <!-- github-comment-id:1473973638 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#402