安装eslint setting.json 配置如下代码 // 配置 ESLint 检查的文件类型 "eslint.validate": [ "javascript", "vue", "html" ], //自动缩进的开关 (关键配置),设置为true则打开自动缩进 "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "eslint.format.enable": true,