{
"files.eol": "\n",
"typescript.preferences.quoteStyle": "single",
"javascript.preferences.quoteStyle": "single",
// tab 大小为2个空格
"editor.tabSize": 2,
// 编辑器换行
"editor.wordWrap": "off",
"css.validate": false,
"less.validate": false,
"scss.validate": false,
// 开启 vscode 文件路径导航
"breadcrumbs.enabled": true,
// prettier 设置语句末尾不加分号
"prettier.semi": false,
// prettier 设置强制单引号
"prettier.singleQuote": true,
// 选择 vue 文件中 template 的格式化工具
"vetur.format.defaultFormatter.html": "js-beautify-html",
// vetur 的自定义设置
"vetur.format.defaultFormatterOptions": {
// 让html的attributes不换行,看起来更美观
"js-beautify-html": {
// aligned-multiple 、auto
"wrap_attributes": "auto",
"wrap_line_length": 240,
"end_with_newline": false
},
"prettier": {
"singleQuote": true,
"semi": false,
"printWidth": 100,
"wrapAttributes": false,
"sortAttributes": false
// "trailingComma": "none" // 禁止随时添加逗号
}
},
"tabnine.experimentalAutoImports": true,
// 保存代码,自动格式化
"editor.formatOnSave": true,
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.configPath": "./prettier.config.js",
"prettier.useEditorConfig": false,
"settingsSync.ignoredSettings": [],
"security.workspace.trust.untrustedFiles": "open",
"workbench.editor.enablePreview": false,
"editor.stickyScroll.enabled": false,
// 配置elint
"eslint.enable": true,
"eslint.validate": [
"javascript",
// 用eslint的规则检测JS代码
{
"language": "vue", // 检测Vue文件
"autoFix": true //为vue文件开启保存自动修复的功能
},
{
"language": "html",
"autoFix": true
},
"vue"
]
// "editor.codeActionsOnSave": {
// "source.fixAll.eslint": "explicit"
// }
}
// 当保存的时候,eslint自动帮我们修复错误
// "editor.codeActionsOnSave": {
// "source.fixAll": true
// }
vscode settings.json(自动修复、保存格式化)
于 2024-06-23 11:39:21 首次发布