Rather than Formatting your code using Shift + Alt + F on Windows or on Shift + Option + F on Mac, consider just formatting on save instead.
To turn this on go to:
- Or just hit CTRL + Comma on Windows to bypass steps 1-3
- search for editor.formatOnSave and change that to true
- Note: this UI is a little confusing. The left side is the default settings and the right side is your custom settings you’ve overriden. You can either copy the setting over to the right or hover over the setting on the left and click the pencil and select true.