Documentation
¶
Overview ¶
Package jsoncfmt provides a Formatter for JSONC (JSON with Comments) files.
The formatter uses tailscale/hujson's CST (concrete syntax tree) for lossless parsing and serialization. Comments (line and block) and trailing commas are preserved through the format cycle.
Formatting walks the CST to apply indentation and normalize spacing. This is idempotent by construction — the same tree always produces the same output regardless of original formatting.
Standard JSON input produces standard JSON output (no trailing commas added). JSONC input preserves trailing commas on multiline structures.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultOptions ¶
DefaultOptions returns the default formatting options for JSONC.