Terminal: Use JSONC / allow comments in JSON per other Microsoft products

Created on 6 Aug 2019  路  4Comments  路  Source: microsoft/terminal

Windows 10.0.18362.0, Terminal Preview 3.

I needed to add a comment explaining why I'd disabled a config option

image

This is correct, comments aren't permitted in JSON. Terminal, like vsCode, should use JSONC (whether it has a .json or .jsonc extension):

image

I know Code and Terminal are different teams but consistency would be good here, and comments are useful.

Issue-Feature Needs-Tag-Fix Needs-Triage Resolution-Answered

Most helpful comment

It highlights it like this because things with a .json extension are supposed to be JSON and not JSONC. Adding an exception in VS Code will only fix it there, not for any other editor. The file should be renamed to reflect its real type.

All 4 comments

We actually do allow comments in the json file as of #1005. Dunno why VS Code is tagging the file like that, but they're definitely allowed.

OK I'll file it with vscode. 馃憤馃徏

It highlights it like this because things with a .json extension are supposed to be JSON and not JSONC. Adding an exception in VS Code will only fix it there, not for any other editor. The file should be renamed to reflect its real type.

@zadjii-msft The settings.json file of Windows Terminal is not a valid JSON, so it will alert linters in most code editors. Why don't you rename the file to settings.jsonc?

Was this page helpful?
0 / 5 - 0 ratings