richie5um / vscode-sort-json

VSCode Extension to Sort JSON objects
https://marketplace.visualstudio.com/items?itemName=richie5um2.vscode-sort-json
MIT License
110 stars 19 forks source link

Do not delete commas after sorting. #81

Closed CHRIBUR0309 closed 1 year ago

CHRIBUR0309 commented 1 year ago

For example, there is a json file:

{
    "a": "あ",
    "c": {
        "0": "foo",
        "1": "bar",
    },
    "b": "い",
}

After sorting it with the extension, it will be:

{
    "a": "あ",
    "b": "い",
    "c": {
        "0": "foo",
        "1": "bar"
    }
}

I want an option not to delete the last comma. I mean, I want this json file:

{
    "a": "あ",
    "b": "い",
    "c": {
        "0": "foo",
        "1": "bar",
    },
}
CHRIBUR0309 commented 1 year ago

JSON syntax doesn't allow the last comma...?🤔️

richie5um commented 1 year ago

Yep. Trailing comma is not allowed syntax. Sorry.