In VS Code, disable error "Comments are not permitted in JSON"

Wallace Kelly picture Wallace Kelly · Dec 15, 2017 · Viewed 26.3k times · Source

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.)

enter image description here

Answer

Wallace Kelly picture Wallace Kelly · Dec 15, 2017

Follow these steps:

  1. Click on the letters JSON in the bottom right corner. (A drop-down will appear to "Select the Language Mode.")
  2. Select "Configure File Association for '.json'..."

enter image description here

  1. Type jsonc and press Enter.

enter image description here

If you only want to disable the error message for a single file, skip step #2.