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

Can this extension sort on a certain value (like displayName in this example) #61

Closed jamilhaddadin closed 2 years ago

jamilhaddadin commented 2 years ago

can this add-in sort this JSON? image

richie5um commented 2 years ago

It can't.

That is because you want to sort an array based on a property - because you are sorting an array, you are changing the meaning of the JSON. Sort-JSON aims to preserve the meaning of the JSON, but make it better organized (which is especially useful for source-control diffs).