Reputation: 17379
I sometimes use Visual Studio Code to edit JSON files that include comments. VS Code displays an error saying, "Comments are not permitted in JSON." It would be nice to disable that error message (without having to remove the comments.)
Upvotes: 247
Views: 86813
Reputation: 19
answer: enter associations
in VScode setting, add item *.json
jsonc
.
btw: What is your screenshot software? pleassssse tell me, and which font on screenshot img?
Upvotes: -3
Reputation: 24191
Just rename file to test.jsonc
Reasons to use JSONC
and not to allow comments in the regular JSON
files are:
Upvotes: 37
Reputation: 1993
Add this to your User Settings:
"files.associations": {
"*.json": "jsonc"
},
If you don't already have a user settings file, you can create one. Hit Ctrl+, or ⌘+, (that's a comma) to open your settings, then hit the Open Settings (JSON) button in the upper right. It looks like this:
Upvotes: 125
Reputation: 17379
Follow these steps:
jsonc
and press Enter.If you only want to disable the error message for a single file, skip step #2.
Upvotes: 449