Use the extension called ”Format Files”. Here are the steps:
- Download the extension called ”Format Files” on VSCode.
- Select and open the folder with files to format on VSCode.
- Press Ctrl+Shift+P to open command palette.
- Enter “Start Format Files: Workspace” and select this option.
Source: https://marketplace.visualstudio.com/items?itemName=jbockle.jbockle-format-files