vscode安装vue的eslint工具
- 首先安装eslint
2. 进入设置setting.json
{
"eslint.autoFixOnSave": true,
"eslint.alwaysShowStatus": true,
"editor.tabSize": 2,
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"eslint.validate": [
"javascript",{
"language": "vue",
"autoFix": true
},"html",
"vue"
],
"window.zoomLevel": 0,
"workbench.activityBar.visible": true,
}
-
然后在项目根路径新建.prettierrc文件
配置如下:
‘trailingComma’:none 表示逗号
-
括号之前需要加一个小空格
则在.eslintrc.js的rules对象中添加这行代码