This is a VS code extension to alphabetically sort the keys in selected js objects keys in your code.
Use babylon to parse the code, and sort the parsed code, then use @babel/generator to genertate the code back to document
- Select a js object in your source
Note: it uses full lines so ensure the selected lines are a valid js object, start from the "{" and end from the "}" - Run the extension command
- Sort JS object keys
Keybinding:Alt+S
- Sort JS object keys (Reverse)
- Sort JS object keys