It seems as though the typescript formatting is ignoring editor.tabSize and always formatting with a tab size of 2.
I made a recording to demonstrate the issue (in this recording I have every plugin except for prettier disabled):
If I disable prettier-vscode, then the file gets formatted correctly with an indent of 4.
The setting is prettier.tabWidth (default: 2)
We are inferring from eslintrc only with eslintIntegration and on JS files.
any particular reason not to infer from either .editorconfig or tslint.json?
For tslint, see prettier/prettier-eslint#92
For editorconfig, see #81
I may want at some point to support editor.tabSize & editor.insertSpace
This was not done before as prettier wasn't supporting tabs. And now we have those settings.
Considering that prettier now supports more than just JS, it'd be wise to support editor.tabSize as VSCode supports language-based editor.tabSize, as in:
"[js]": {
"editor.tabSize": 2
},
"[json]": {
"editor.tabSize": 4
}
@flagello that's a great solution.
There still is the trouble with printWidth / trailingComma we also want to support. see #130
Closing as the initial post has been replied
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
Considering that prettier now supports more than just JS, it'd be wise to support
editor.tabSizeas VSCode supports language-basededitor.tabSize, as in: