Why does it not work after setting 4 space indents?

paste the code in the setting file
{

first.
"editor.formatOnSave": true,
"eslint.autoFixOnSave": true,
"eslint.validate": [
    "javascript",
    "javascriptreact",
    {
        "language": "vue",
        "autoFix": true
    }
],
"editor.detectIndentation": true,
"vetur.format.defaultFormatter.js": "none",
"workbench.colorTheme": "Palenight Theme",
"window.zoomLevel": 2,
"editor.lineHeight": 30,
"editor.tabSize": 4,
"prettier.tabWidth": 4,
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatterOptions": {
    "wrap_attributes": "force-aligned"
}

}
in "editor.tabSize": 4,
"prettier.tabWidth": 4, I set 4 in both settings, but the page formatting code is still indented by 2 spaces, how to solve this problem?


just refer to [VS Code indentation problem] https://codeshelper.com/q/10... solved
" editor.detectIndentation ": false
" editor.tabSize ": 4,

when you're done, restart vscode. You can try


the number of spaces equal to a tab. When Editor: Detect Indentation is enabled, this setting may be overwritten depending on the contents of the file.
check to see if Detect Indentation is on (if enabled, it checks the format of the file itself), and if so, change it to off.

Menu