In vscode, html and JavaScript are indented to four spaces, but they are automatically formatted and changed to two spaces when saved.

problem description

In

vscode, I have set indentation to four spaces, but when I save it, I automatically format it and change it to two spaces. How can I set it to make it four spaces after automatic formatting?

the platform version of the problem and what methods you have tried

vscode version: 1.29.1

"editor.detectIndentation": false false

related codes

"editor.tabSize": 4,
"editor.detectIndentation": false

what result do you expect? What is the error message actually seen?

how can I set up html, JavaScript or four spaces after automatic formatting?

Dec.14,2021

needs to modify the default configuration of prettier. The default tabWidth of prettier is 2, so you need to add "prettier.tabWidth": 4 to the setting.json of vscode.


there is an option at the bottom of the software that can be indented according to the space tab character, which will eventually prevail
clipboard.png

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38952-e675.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38952-e675.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?