Click in turn: File-Preferences-Settings, select ESlint, click Edit in settings.json
Replace the contents with the following code:
{
"editor.formatOnSave": true,
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"eslint.run": "onSave", // 点击保存自动修复
"eslint.options": {
"extensions": [
".js",
".vue"
]
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.codeAction.showDocumentation": {
"enable": true
},
}
Original link: https://my.oschina.net/jjyuangu/blog/2998993