在settings.json里填写
"editor.codeActionsOnSave": {
"source.fixAll": true
},
在settings.json里填写
"prettier.configPath": "C:\\Users\\Default\\.prettierrc",
"eslint.alwaysShowStatus": true,
"prettier.trailingComma": "none",
"prettier.semi": false,
// 每行文字个数超出此限制会将被迫换行
"prettier.printWidth": 300,
// 使用单引号替换双引号
"prettier.singleQuote": true,
"prettier.arrowParens": "avoid",
// 设置.vue文件中,html代码的格式化插件
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.ignoreProjectWarning": true,
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "false"
},
"prettier": {
"printWidth": 300,
"semi":false,
"singleQuote":true,
"arrowParens":"avoid",
"trailingComma":"none"
}
}
路径下找不到.prettierrc,自己配置一个里面写
{"semi": false, "singleQuote": true, "printWidth": 300}