JSON5 Essentials
JSON5 language support for Visual Studio Code: syntax highlighting, live syntax
validation, and formatting that preserves comments.
Features
- Theme-aware highlighting for JSON5 syntax, including comments and unquoted keys.
- Live syntax errors in the editor and Problems panel.
- Format Document with comment preservation and editor indentation settings.
- Comment toggling, automatic quote and bracket closing, and folding.
Validation covers JSON5 syntax; JSON Schema is not supported.
Add to your VS Code settings.json:
{
"[json5]": {
"editor.defaultFormatter": "local-json5.json5-essentials",
"editor.formatOnSave": true
}
}
Settings
| Setting |
Default |
Description |
json5Essentials.validation.enabled |
true |
Enable syntax validation |
json5Essentials.validation.delay |
250 |
Validation delay in milliseconds |
json5Essentials.format.enabled |
true |
Enable document formatting |
json5Essentials.format.printWidth |
80 |
Preferred line width |
json5Essentials.format.singleQuote |
true |
Prefer single quotes |
json5Essentials.format.trailingComma |
"all" |
Trailing commas: "all" or "none" |
Development
Requires Bun 1.3.14+ and VS Code 1.85+.
bun install
bun run test
bun run package
The VSIX is created in the project directory. Press F5 in VS Code to debug.
Dependencies
JSON5 for parsing and
Prettier for formatting.
| |