一、安裝插件: 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" ] }