1、安装Eslint 在项目文件夹内打开Git npm init -y npm install eslint --save-dev ./node_modules/.bin/eslint --init 初始化配置文件 一路回车配置完成 1、配置Eslint "eslint.autoFixOnSave": true, //用来进行保存时自动格式化 //配置作用的文件类型 "eslint.validate": [ "javascript", "javascriptreact", { "language": "html", "autoFix": true }, { "language": "vue", "autoFix": true } ]