Coding⏱️ 2 min read📅 2026-05-31

How to Fix: In VS Code, disable error "Comments are not permitted in JSON"

Disable error "Comments are not permitted in JSON" in VS Code.

Quick Answer: To disable the error, add the following configuration to your VS Code settings: "json.validateComment": false

In VS Code, you can disable the error message "Comments are not permitted in JSON" without having to remove the comments. This issue occurs because JSON files do not support comments by design.

🔍 Why This Happens

  • [Cause]

✅ Best Solutions to Fix It

Method 1: Disable Comments in JSON Files

  1. Step 1: Open the VS Code settings by pressing Ctrl + , (Windows/Linux) or Cmd + , (Mac).

Method 2: Use a Linter that Ignores Comments

  1. Step 1: Install the ESLint extension in VS Code.

💡 Conclusion

By following these methods, you can disable the error message "Comments are not permitted in JSON" and continue editing your JSON files with comments.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions