eslint格式化不起作用的问题

这篇文章不错
我这次遇到的问题是:eslint和其他格式化程序冲突的问题

  1. 首先通过设置vscode的setting.json,使其支持格式化.vue文件

"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},

  1. 解决eslint和其他格式化程序冲突的问题
// 保存时使用VSCode 自身格式化程序格式化
"editor.formatOnSave": true,
// 保存时用eslint格式化
"editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
}
// 两者会在格式化js时冲突,所以需要关闭默认js格式化程序 
"javascript.format.enable": false

你可能感兴趣的:(eslint格式化不起作用的问题)