{
"files.autoSaveDelay": 1000,
"files.autoSave": "afterDelay",
"editor.tabSize": 2,
// "terminal.integrated.shell.windows": "powershell.exe",
"terminal.integrated.shell.windows": "cmd.exe",
// "terminal.integrated.shell.windows": "D:/Software/Git/bin/bash.exe",
"code-runner.ignoreSelection": true,
"window.restoreWindows": "none",
"code-runner.runInTerminal": true,
"terminal.integrated.automationShell.windows": "",
"terminal.integrated.automationShell.linux": "",
"terminal.integrated.shellArgs.windows": null,
"oneDarkPro.editorTheme": "Onedark Pro",
"typescript.npm": "",
"code-runner.languageIdToFileExtensionMap": {
"bat": ".bat",
"powershell": ".ps1",
"typescript": ".ts"
},
"code-runner.executorMapByGlob": {
"pom.xml": "cd $dir && mvn clean package"
},
"explorer.compactFolders": false,
"eslint.options": {
"plugins": ["html"]
},
"vetur.experimental.templateInterpolationService": true,
//格式化插件配置
// vscode默认启用了根据文件类型自动设置tabsize的选项
"editor.detectIndentation": false,
// #值设置为true时,每次保存的时候自动格式化;值设置为false时,代码格式化请按shift+alt+F
"editor.formatOnSave": true,
// 添加 vue 支持
"eslint.validate": ["javascript", "javascriptreact", "vue"],
// #让prettier使用eslint的代码格式进行校验
"prettier.eslintIntegration": true,
"prettier.tabWidth": 4,
// #让函数(名)和后面的括号之间加个空格
"javascript.format.insertSpaceBeforeFunctionParenthesis": false,
// #这个按用户自身习惯选择
"vetur.format.defaultFormatter.html": "js-beautify-html",
// #让vue中的js按"vscode-typescript"格式进行格式化
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
// #vue组件中html代码格式化样式
"wrap_attributes": "force-aligned", //也可以设置为“auto”,效果会不一样
"wrap_line_length": 200,
"end_with_newline": false,
"semi": false,
"singleQuote": true
},
"prettier": {
"semi": false,
"singleQuote": true
}
},
"prettier.useTabs": true,
"explorer.confirmDelete": false,
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"diffEditor.ignoreTrimWhitespace": false,
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
// 每次保存的时候将代码按eslint格式进行修复
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
//代码中对变量名的提示
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true
},
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"html.format.enable": false,
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
}
备一份vscode的setting.json文件(保存格式化,遵循ESlint规范)
最新推荐文章于 2024-04-30 15:40:21 发布