Skip to content
uencoder

JSON5 Comments

JSON5 allows single-line // and multiline /* */ comments; as a superset of JSON it lets configuration files carry comments.

Purpose

To add comments to JSON configuration, improving readability and maintainability, as a humane extension of JSON.

Mechanism

JSON5 allows on top of JSON: // and /* */ comments, trailing commas, unquoted key names (identifiers), single-quoted strings, NaN/Infinity/-Infinity, and hexadecimal numbers.

Use cases

  • Configuration file comments
  • tsconfig.json
  • Babel configuration

Related tools

References