E021Error

Comments are not allowed in strict JSON

A // or /* comment appeared in strict JSON.

What it means

Standard JSON has no comments. They are valid in JSONC (used by tsconfig.json, VS Code settings, and similar config files), so switch to JSONC mode if this input is a config file.

Example

Invalid
{
  "port": 8080 // dev
}
Valid
{
  "port": 8080
}

How to fix it

Remove the comment, or enable JSONC mode for config files.

Validate your JSON to see this and every other issue highlighted in one pass.


Diagnostics on this page come from @jsonlint/core, the open-source engine that powers the JSONLint validator. Install it with npm install @jsonlint/core.