Awesome
vscode-sort-package-json
A Visual Studio Code extension to sort package.json with sort-package-json.
Features
Sort your package.json sensibly.
Sort Manually
- Open a
package.json
file - Open the Command Palette with <kbd>ctrl</kbd>-<kbd>shift</kbd>-<kbd>P</kbd> (<kbd>cmd</kbd>-<kbd>shift</kbd>-<kbd>P</kbd> for macOS)
- Select
Sort package.json
Sort on Save
To sort all package.json
files automatically on save, configure your user settings:
- Open the Command Palette with <kbd>ctrl</kbd>-<kbd>shift</kbd>-<kbd>P</kbd> (<kbd>cmd</kbd>-<kbd>shift</kbd>-<kbd>P</kbd> for macOS)
- Select
Preferences: Open User Settings (JSON)
- Add
"source.sortPackageJson"
to"editor.codeActionsOnSave"
as shown below
"editor.codeActionsOnSave": [
// Sort package.json keys with
// https://marketplace.visualstudio.com/items?itemName=unional.vscode-sort-package-json
"source.sortPackageJson"
],