E008Error

Trailing comma

A comma appears before a closing brace or bracket.

What it means

Standard JSON (RFC 8259) does not allow a comma after the last element of an object or array. Trailing commas are valid in JSONC and JSON5, which is why editors often leave them behind.

Example

Invalid
{ "a": 1, "b": 2, }
Valid
{ "a": 1, "b": 2 }

How to fix it

Remove the trailing comma, or parse the input in JSONC mode if it is a config file.

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.