在setting.json中加入以下內容javascript
{ "eslint.autoFixOnSave": true, "eslint.validate": [ "javascript", "javascriptreact", { "language": "html", "autoFix": true }, { "language": "vue", "autoFix": true } ] }
參考:http://www.ptbird.cn/vscode-autosave-eslint-support-vue.htmlhtml