{
"extensions.autoUpdate": "onlySelectedExtensions",
"workbench.iconTheme": "material-icon-theme",
"vsicons.dontShowNewVersionMessage": true,
"editor.fontSize": 16,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"workbench.editor.enablePreview": false,
"search.followSymlinks": false, //关闭rg.exe进程
"editor.lineNumbers": "on", //开启行数提示
"editor.quickSuggestions": {
//开启自动显示建议
"other": true,
"comments": true,
"strings": true
}, //每次保存自动格式化
"prettier.eslintIntegration": true, //让prettier使用eslint的代码格式进行校验
"prettier.semi": true, //使用带引号替代双引号
"javascript.format.insertSpaceBeforeFunctionParenthesis": true, //让函数(名)和后面的括号之间加个空格
"vetur.format.defaultFormatter.html": "js-beautify-html", //格式化.vue中html
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-aligned" //属性强制折行对齐
},
"prettier": {
"printWidth": 80,
"singleQuote": true,
"semi": false,
"trailingComma": "es5",
"tabWidth": 2,
"useTabs": false
}
},
"eslint.format.enable": true, // eslint格式化开启
"eslint.validate": [
// eslint校验的文件列表
"javascript",
"vue",
"html",
"javascriptreact",
"vue-html"
],
/* 添加如下配置 */
"vetur.format.defaultFormatter.js": "vscode-typescript", // 取消vetur默认的JavaScript格式化工具
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features" // 只采用eslint的格式化
},
"[vue]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint" // vue文件还是采用vetur格式化
},
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
//"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"terminal.integrated.defaultProfile.windows": "C:\\Windows\\System32\\cmd.exe",
"javascript.updateImportsOnFileMove.enabled": "always",
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"extensions.ignoreRecommendations": true,
"scm.diffDecorationsGutterAction": "none",
"scm.diffDecorations": "none",
"intelephense.diagnostics.languageConstraints": false,
"workbench.colorTheme": "Monokai",
"editor.minimap.enabled": false,
"breadcrumbs.enabled": false,
"editor.unicodeHighlight.allowedCharacters": {
" ": true
},
"editor.unicodeHighlight.ambiguousCharacters": false,
"[css]": {
"editor.defaultFormatter": "vscode.css-language-features"
},
"settingsSync.ignoredExtensions": [
"daxiang.tp5-snippet"
],
"px-to-rpx.baseWidth": 450,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"px-to-rpx.fixedDigits": 2,
"php.validate.executablePath": "C:/Users/xfstu/AppData/Local/BtSoft/php/82/php.exe",
"vetur.completion.scaffoldSnippetSources": {
"workspace": "
标签:常用,false,vscode,配置,defaultFormatter,editor,eslint,true,prettier
From: https://www.cnblogs.com/xfstu/p/18256324