'How vscade automatically formats when saving is only applicable to HTML files
The following settings will be formatted when any file is saved.
I just need to format the HTML file when it is saved
{
"editor.formatOnSave": true,
}
Solution 1:[1]
You can do it like this :-
{
"editor.formatOnSave": false,
"[html]": {
"editor.formatOnSave": true
}
}
Solution 2:[2]
You can globally disable VSCode Format On Save altogether and enable it for only a handful of programming languages ( identifiers for languages ).
so for HTML, check below,
{
"editor.formatOnSave": false,
"[html]": {
"editor.formatOnSave": true
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Rishit |
| Solution 2 | Abhijeet Vadera |
