Skip to content

✅ Sort JSONC without mangling comments! (lib and CLI)

License

Notifications You must be signed in to change notification settings

duniul/sort-jsonc

Repository files navigation

sort-jsonc monorepo

Mini-monorepo for sort-jsonc and sort-jsonc-cli.

Packages

Package Version Description
sort-jsonc npm Sort JSONC without mangling comments!
sort-jsonc-cli npm Use sort-jsonc directly via the CLI.

Motivation

Lots of JSON files today are actually JSONC, or "JSON with comments", under the hood. Files like tsconfig.json or .vscode/settings.json.

Tools for deep-sorting JSON files are common and frequently used, but they tend to either strip, mangle or simply not support comments. I needed an easy util (and CLI tool) for this specific use case and couldn't find a nice one, so I made these.