xxxxxxxxxx
Configure Default Formatter to Prettier
xxxxxxxxxx
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
// "editor.formatOnSave": true,
},
xxxxxxxxxx
// Set the default"editor.formatOnSave": false,// Enable per-language"[javascript]": { "editor.formatOnSave": true}
xxxxxxxxxx
To automatically format the file on save, In Visual Studio Code,
- Press Ctrl + Shift + P to open the command palette
- and type setting and then select Preferences: Open User Settings option.
- Search for format on save setting and check the checkbox.