vscode-eslint格式化问题


eslint的vertu插件更新后的坑。

vscode配置eslint

eslint的作用是什么我就不再多说了

太长不看版

在setting.json 文件中加一下代码,前提是你安装使用的vertu

1
2
3
4
5
6
7
8
9
10
11
12
13
"eslint.autoFixOnSave": true,
"files.autoSave":"off",
"eslint.validate": [
"javascript",
"javascriptreact",
"html",
{ "language": "vue", "autoFix": true }
],
"eslint.options": {
"plugins": ["html"]
},
//为了符合eslint的两个空格间隔原则
"editor.tabSize": 2

情况复杂不想打字版

参考:

vscode配置eslint

使用VSCode写Vue项目,ESLint如何自动格式化不符合规范的代码

vue eslint 代码自动格式化