在配置文件中加入以下代码
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
},
// "eslint.autoFixOnSave": true,
"eslint.validate": [
"javascript",
"typescript",
"typescriptreact",
"javascriptreact",
"jsx",
"html",
"vue",
],