前言


我是歌谣 我有个兄弟 巅峰的时候排名c站总榜19 叫前端小歌谣 曾经我花了三年的时间创作了他 现在我要用五年的时间超越他 今天又是接近兄弟的一天人生难免坎坷 大不了从头再来 歌谣的意志是永恒的 放弃很容易 但是坚持一定很酷


导语


歌谣 歌谣 你的vs code重装了 是不是要做格式化了


#yyds干货盘点# 【Vs code工作记录三】设置Vs code格式化_javascript#yyds干货盘点# 【Vs code工作记录三】设置Vs code格式化_html_02

解决思路


打开vs code ctrl+shift+p 复制进去



{
"eslint.codeAction.showDocumentation": {
"enable": true
},
// Set the default
"editor.formatOnSave": false,
// Enable per-language
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"editor.tabSize": 2,
"js/ts.implicitProjectConfig.experimentalDecorators": true,
"tabnine.experimentalAutoImports": true,
"javascript.updateImportsOnFileMove.enabled": "never",
// "[vue]": {
// "editor.defaultFormatter": "esbenp.prettier-vscode"
// },
// 强制单引号
"prettier.singleQuote":true,
// 尽可能控制尾随逗号的打印
"prettier.trailingComma": "all",
// 开启 eslint 支持
"prettier.eslintIntegration": true,
// 保存时自动fix
"eslint.autoFixOnSave": true,
// 添加 vue 支持
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "vue",
"autoFix": true
}
],
// 使用插件格式化 html
"vetur.format.defaultFormatter.html": "js-beautify-html",
// 格式化插件的配置
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
// 属性强制折行对齐
"wrap_attributes": "force-aligned"
}
},
"vetur.format.defaultFormatter": {
"html": "prettier",
"css": "prettier",
"postcss": "prettier",
"scss": "prettier",
"less": "prettier",
"js": "prettier",
"ts": "prettier",
"stylus": "stylus-supremacy"
},
// html颜色高亮
"files.associations": {
".eslintrc": "json",
"*.vue": "html",
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript"
},
"emmet.syntaxProfiles": {
"javascript": "jsx",
"vue": "html",
"vue-html": "html"
},
"[html]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"emmet.includeLanguages": {
"wxml": "html"
},
"minapp-vscode.disableAutoConfig": true,
"editor.fontLigatures": null
}

#yyds干货盘点# 【Vs code工作记录三】设置Vs code格式化_css_03

 总结


则问题解决