If format on save was previously not working for you, this is what fixed it for me.
- Install Prettier in VSCode (https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
- Open Settings pane (Command + ,)
- Make sure the Editor: Format on Save property is enabled (You can search and find the property in the search bar)
- Set the Editor: Default Formatter to Prettier – Code formatter