A Prettier plugin for formatting JSONV files.
- Header tooling on fix-headers 2.2.0 — the
@cldmv/fix-headersdev dependency moves to 2.2.0, so@Last modified byfollows content edits only, and@cldmv/configsmoves to 1.2.4, which turns off the forced author updates. The header pass was re-run and every file already matched, so nothing was restamped. No plugin code, published file or runtime dependency changed (#51, #54). - View full v1.1.4 Changelog
- v1.1.3 (October 2026) — the CI
✅ Required PR Checkmirror job runs on every path instead of being skipped on in-repo PRs (#49) (Changelog) - v1.1.2 (October 2026) — dev-dependency bumps, including
@cldmv/vitest-runner1.5.1 and@cldmv/jsonv1.1.1 in development (#46, #47) (Changelog) - v1.1.1 (October 2026) — uniform file headers from the shared CLDMV fix-headers config, and a skipped PR run no longer satisfies Required PR Check (#44, #45) (Changelog)
- v1.1.0 (September 2026) — lossless printing from
@cldmv/jsonv's source AST (fixing key, comment and number corruption),trailingCommasupport and a typed plugin (#26, #31, #32) (Changelog)
📚 For complete version history, see docs/changelog/ and the GitHub Releases.
- Formats
.jsonvfiles using the @cldmv/jsonv parser - Supports all ES2015-2025 features (JSON5, binary/octal literals, BigInt, numeric separators, etc.)
- Configurable year-based feature detection
- Proper handling of comments and whitespace
- Integrates with Prettier's configuration system
npm install --save-dev @cldmv/prettier-plugin-jsonv prettier @cldmv/jsonvAdd the plugin to your Prettier configuration:
import jsonv from "prettier-plugin-jsonv";
export default {
plugins: [jsonv],
overrides: [
{
files: "*.jsonv",
options: {
jsonvYear: 2025,
strictBigInt: false
}
}
]
};module.exports = {
plugins: ["prettier-plugin-jsonv"],
overrides: [
{
files: "*.jsonv",
options: {
jsonvYear: 2025,
strictBigInt: false
}
}
]
};| Option | Type | Default | Description |
|---|---|---|---|
jsonvYear |
number | 2025 | The year to use for JSONV features (2015-2025) |
strictBigInt |
boolean | false | Whether to enforce strict BigInt parsing |
The plugin honours Prettier's trailingComma option the way Prettier's JavaScript printer does for object and array literals:
"all"(Prettier's default) and"es5"put a comma after the last entry of every object or array that breaks across lines. Non-empty objects and arrays are always printed one entry per line, so only empty ones ({ },[]) are printed on a single line, and they never get a comma."none"never adds one.
Trailing commas already in the source are not kept as written: the option normalizes them, adding or removing the comma after the last entry. Every jsonv year (2011-2025) allows trailing commas, so the comma never makes a document invalid, and it never changes the parsed value. Comments next to the last entry stay in place: a: 1, // note keeps the comment after the comma, a: 1 /* note */, keeps it before.
Apache-2.0 © Shinrai / CLDMV