Option to print comma at the beginning of the line
It would be cool to have an option for the formatter to print the comma at the beginning of the line. So instead of
{
"key1": "value1",
"key2": "value2"
}
it should print
{
"key1": "value1"
, "key2": "value2"
}
This would help when the file is version controlled because adding a new value in the first case would cause a 2 line diff while adding a value in the second case, would only cause a single line diff:
{
"key1": "value1",
"key2": "value2",
"key3": "value3"
}
vs.
{
"key1": "value1"
, "key2": "value2"
, "key3": "value3"
}
This is inspired by the format elm decided to use. Actually for better formatting, having the opening bracet and the first key/value pair in the same line would be nice to:
{ "key1": "value1"
, "key2": "value2"
}
You could implement a format optimized for version controll while still be human readable
Sorry for the long response delay. This notification must have slipped through.
I'd be willing to accept a pr for this!