jsonlint
jsonlint copied to clipboard
Sort keys but not top-level keys
A package.json looks like this:
{
"name": "...",
"dependencies": {
"a": "...",
"b": "..."
}
}
I want to keep the order of name and dependencies, but want to make sure that the list of dependencies are sorted. I think a good approach for this would be to let the --sort-keys
flag accept a number, which is the minimum depth at which it begins sorting.
npx jsonlint -s 1 -i -q package.json