My full setting overwrites are
{
"sublimeTextKeymap.promptV3Features": true,
"prettier.trailingComma": "es5",
"prettier.tabWidth": 2,
"editor.tabSize": 2,
"editor.detectIndentation": false,
"[javascript]": {
"editor.formatOnSave": true
}
}
But formatting still gives me a tab width of 4.
The only extensions I currently have installed are vscode-styled-components, Sublime Text Keymap, and Prettier - Code formatter.
I have tried running prettier on a .js file in an otherwise empty directory and it behaves as it should, indenting with 2 spaces, but the problem persists in multiple projects.
In an attempt to override whatever is causing this I have added a .prettierrc file at the top level of a project with the contents
{
"tabWidth": 2
}
But that hasn't worked either.
do you have any editorconfig file?
I would still say a prettierrc file should win...
Where should I look for that? I can't find one anywhere in the offending directory.
from the file and upwards I think
Wow, I had a .editorconfig in the directory above my project. I'm not sure why that would override .prettierrc and I've no idea where it came from, but I've edited it now and Prettier is indenting as expected.
Thanks for your help, that was driving me mad.
.editorconfig shouldn't override .prettierrc.
It overrides vscode settings tho.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Wow, I had a .editorconfig in the directory above my project. I'm not sure why that would override .prettierrc and I've no idea where it came from, but I've edited it now and Prettier is indenting as expected.
Thanks for your help, that was driving me mad.