95 lines
2.4 KiB
JSON
95 lines
2.4 KiB
JSON
{
|
||
// 全局保存时格式化
|
||
"editor.formatOnSave": true,
|
||
|
||
// 保存时执行的操作
|
||
"editor.codeActionsOnSave": {
|
||
"source.fixAll.eslint": "explicit",
|
||
"source.fixAll.stylelint": "explicit",
|
||
"source.organizeImports": "explicit"
|
||
},
|
||
|
||
// 指定不同文件的格式化工具
|
||
"[vue]": {
|
||
"editor.defaultFormatter": "Vue.volar"
|
||
},
|
||
|
||
"[javascript]": {
|
||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||
},
|
||
|
||
"[typescript]": {
|
||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||
},
|
||
|
||
"[json]": {
|
||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||
},
|
||
|
||
// SCSS/Sass 文件格式化
|
||
"[scss]": {
|
||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||
"editor.formatOnSave": true
|
||
},
|
||
|
||
"[sass]": {
|
||
"editor.defaultFormatter": "sass.sass-indented",
|
||
"editor.formatOnSave": true
|
||
},
|
||
|
||
"[css]": {
|
||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||
"editor.formatOnSave": true
|
||
},
|
||
|
||
// Vue 文件内部的语言格式化
|
||
"volar.format.defaultFormatter.scss": "prettier",
|
||
"volar.format.defaultFormatter.sass": "sass-formatter",
|
||
"volar.format.defaultFormatter.css": "prettier",
|
||
"volar.format.defaultFormatter.less": "prettier",
|
||
"volar.format.defaultFormatter.stylus": "prettier",
|
||
"volar.format.defaultFormatter.js": "prettier",
|
||
"volar.format.defaultFormatter.ts": "prettier",
|
||
"volar.format.defaultFormatter.json": "prettier",
|
||
|
||
// Prettier 详细配置
|
||
"prettier.enable": true,
|
||
"prettier.requireConfig": true,
|
||
"prettier.withNodeModules": false,
|
||
|
||
// Stylelint 配置
|
||
"stylelint.enable": true,
|
||
"stylelint.validate": ["css", "scss", "vue", "sass"],
|
||
"css.validate": false,
|
||
"scss.validate": false,
|
||
"less.validate": false,
|
||
|
||
// 缩进和空格设置
|
||
"editor.tabSize": 2,
|
||
"editor.insertSpaces": true,
|
||
"editor.detectIndentation": false,
|
||
"editor.trimAutoWhitespace": true,
|
||
"files.trimTrailingWhitespace": true,
|
||
"files.insertFinalNewline": true,
|
||
|
||
// 禁用 Vetur(如果安装了)
|
||
"vetur.format.enable": false,
|
||
"vetur.validation.template": false,
|
||
|
||
// Volar 配置
|
||
"volar.format.enable": true,
|
||
"volar.format.initialIndent": true,
|
||
"volar.format.options.tabSize": 2,
|
||
"volar.format.options.useTabs": false,
|
||
"volar.codeLens.pugTools": false,
|
||
|
||
// Uniapp 配置
|
||
"uni-app-vue.disable-auto-install": false,
|
||
"files.associations": {
|
||
"pages.json": "json",
|
||
"manifest.json": "json",
|
||
"*.scss": "scss",
|
||
"*.sass": "sass"
|
||
}
|
||
}
|