Offloading the work of formatting our code to the editor saves time and headache, plus keeps our code predictable and easy to read.
When working in a Vue.js project, it’s simple to rely on Volar for formatting .vue
files and built in VS Code formatters for everything else. However, for a more portable and version control friendly solution consider using the popular formatter Prettier.
In this lesson, I’ll show you to get auto formatting on save setup with both built in formatters and Prettier.
Links
Keyboard Shortcuts
Shift+Option+F
(Mac)Shift+Alt+F
(Windows)Cmd+Z
(Mac)Ctrl+Z
(Windows)Cmd+S
(Mac)Ctrl+S
(Windows)Cmd+Shift+X
(Mac)Ctrl+Shift+X
(Windows)