1.安装插件vscode
2.项目中要使用vscode
3.启动Eslint
红线报错:ESLint is disabled since its execution has not been approved or denied yet. Use the light bulb menu to open the approval dialog.eslint
点击右下角
4.就成功全局启动了Eslint
5.保存文件自动按照Eslint格式保存
setting.json里面增加
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}