vuecli3创建的项目,代码规范eslint+prettier
标签多属性时换行提示警告:"Replace `⏎······alt=\"Vue·logo\"⏎······src=\"../assets/logo.png\"⏎···` with `·alt=\"Vue·logo\"·src=\"../assets/logo.png\"`",
vue文件的template部分是用js-beautify-html格式化的,vscode配置如下:
{
// 终端字体大小
"terminal.integrated.fontSize": 16,
"explorer.confirmDelete": false,
"window.zoomLevel": 0,
"editor.tabSize": 2,
/* 代码保存自动格式化--------------------------------------开始 */
//保存自动格式化
"editor.formatOnSave": true,
// 保存时的task
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": true
},
//.vue文件template格式化支持,并使用js-beautify-html插件
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatterOptions": {
//js-beautify-html格式化配置
"js-beautify-html": {
"wrap_attributes": "force-expand-multiline"
// "wrap_attributes": "force-aligned"
},
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
/* 代码保存自动格式化--------------------------------------结束 */
}
求解??????