vs code auto format code on save extension code example
Example 1: organize imports on save vscode
//Organize imports on save & delete unused imports (vscode)
//Add in settings.json:
"editor.codeActionsOnSave": [
"source.organizeImports",
],
Example 2: autoformating for code in vscode when i save it
"editor.formatOnSave": true