ljharb / json-stable-stringify

MIT License
52 stars 11 forks source link

Space before colon `:`? #11

Open Scvairy opened 8 months ago

Scvairy commented 8 months ago

I want to add a pre-commit hook to sort Contents.json files generated for Xcode (or by xcode), and in its flavor of json there is a space before colon. To reduce diff, I'd like to follow xcode's rules.

Let me know, if that is possible? Thank you!

ljharb commented 8 months ago

That's very bizarre and doesn't match any JSON examples or tooling I've ever used before.

We could certainly do it with some kind of callback option that gets the key and the value and returns the formatted pair (unindented), but that's a lot of complexity to add for a feature this uncommonly needed.