VS Code Cheat Sheet/Enable format on save

Format files automatically when saved.

Section: Settings, Debugging, and Git

Enable format on save

json
json
{
  "editor.formatOnSave": true
}

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Settings, Debugging, and Git
Open Settings UI
Search and edit settings through the UI.
OpenIn sheettextsame section
Start debugging
Launch the current debug configuration.
OpenIn sheettextsame section
Basic Node.js launch.json
Minimal launch config for debugging a Node script.
OpenIn sheetjsonsame section
Open Source Control view
Jump to the SCM panel quickly.
OpenIn sheettextsame section
Format document
Format the entire active file.
OpenIn sheettext1 tag match
Open Command Palette
Run any VS Code command quickly.