I am using prettier
extension in vscode
to format both html
and md
files, it is beautiful to set tabwidth = 4
in html
files, but ugly in md
.
I set prettier.tabWidth
in vscode settings.json
"prettier.tabWidth": 4
But this setting will take effect for all languages. Is there a method that can set the prettier
in settings.json
and only sets the indentation of HTML
files without affecting the indentation of MD
files?
Unfortunately, prettier doesn't work that way in settings.json or even with a global rc file. At this point I have a directory with presets for prettier which I copy/paste to my package.json per project within vscode.
package.json(per project🤡):
"prettier": {
"tabWidth": 2,
"useTabs": false,
"singleQuote": true
}