How to format file | project folder | all project files (using hot keys AND using menu) in Visual Studio Code?
How to format file | project folder | all project files (using hot keys AND using menu) in Visual Studio Code?
In case you are not able to format your code with any of these commands it's maybe because you did not set up your formatter configuration
I recommend you to use Prettier (install from Extensions)
prettier: Create Configuration File+1. also you are able to set your environment to automatically format your file at save.
You can do it writing this line in settings.json:
"editor.formatOnSave": true
Hint: Access it using the command palette again and writing settings.json, and select
Preference: Open Settings (JSON)