I installed prettier extension for vscode and configured tab width as 4 spaces but it still indents new lines with 2 spaces. Anything I am doing wrong?
Here is the gif showing when I format the file:
EDIT: Contents of .prettierrc file:
{
"trailingComma": "none",
"overrides": [
{
"files": "**/lwc/**/*.html",
"options": { "parser": "lwc" }
},
{
"files": "*.{cmp,page,component}",
"options": { "parser": "html" }
}
]
}
I think it was because, tabWidth:4 was specified in user's settings. while in workspace setting nothing was specified, so it uses default value for workspace i.e. tabWidth:2
as mentioned in comments also adding tabWidth:2
in .prettier.js would fix it!
https://prettier.io/docs/en/options.html#tab-width