Pass .vscode/settings.json
vscode performance of non-aware control members
By adding a .vscode/setings.json file in the project root directory, the project members' vscode performance can be consistent. Common requirements include saving file auto-fix, saving auto-formatting code, etc. In order to respect the individual needs of members, do not control themes, fonts, etc.
.vscode/settings.json
{
// 避免非 ts 的 vue 项目提示 n 多红线提示 Property ‘xxx‘ does not exist on type
"vetur.validation.interpolation": false,
// 文件保存时自动格式化
"editor.formatOnSave": true,
// 可选,文件自动保存
"files.autoSave": "afterDelay",
// eslint规则对以下几种后缀文件生效. 默认为["javascript", "javascriptreact"]
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue"],
"stylelint.validate": ["css", "scss", "less", "acss"],
// 文件保存时自动修复 eslint 与stylelint 中可修复的问题
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
// "source.fixAll.markdownlint": true
},
// 语言默认格式化规则
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
Principle: The project-level configuration has a higher priority than the configuration of the vscode editor.
It is better to configure it together with .vscode/extensions.json 😁
The front-end code specification vscode has basically been introduced, and then the author will start to roll eslint.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。