VS Code direct formating doesn’t work. I am told to use CSS. Why cant I use direct formating via the text editor?
I tried using direct formating in the VS Code BEFOR I move to learning how to use CSS. I was/am expecting the VS Code editor to allow Direct Formating.
2
Answers
Use Shift + alt + F to format in VScode.
You need to setup your VSCode to format your code be default. From the extensions tab install the Prettier extension.
Prettier Extension
Now open the settings in VSCode from the bottom left corner, search for format on save option, and make sure it’s enabled. Now try to save your changes and hopefully, the auto-format feature will work.
In case the auto-format feature does not work, then right-click in the js or CSS file click on Format Document with option, and then configure the prettier as your default code format.