一、安装插件: Pretty Formatter
Windows上的Visual Studio代码 - Shift+ Alt+F
二、关闭文件自动化保存
菜单文件 → 首选项 → 工作区设置
{ // Controls if the editor should automatically format the line after typing
"beautify.onSave": true,
"editor.formatOnSave": true,
// You can auto format any files based on the file extensions type.
"beautify.JSfiles": [
"js",
"json",
"jsbeautifyrc",
"jshintrc",
"ts"
]
}