安装eslint插件 然后在settings.json加入下面配置
"eslint.validate": [ "javascript", "javascriptreact", "html", "vue" ], "editor.codeActionsOnSave": { "source.fixAll.eslint": true },