vscode 格式化配置

179 阅读1分钟
{
  "editor.fontSize": 16,
  "editor.detectIndentation": false,
  "editor.tabSize": 2,
  "workbench.colorTheme": "One Dark Pro Flat",
  "workbench.iconTheme": "material-icon-theme",
  "workbench.startupEditor": "welcomePage",
  "editor.wordWrap": "on",
  "material-icon-theme.showUpdateMessage": false,
  "gitlens.keymap": "alternate",
  "gitlens.advanced.messages": {
    "suppressCommitHasNoPreviousCommitWarning": false,
    "suppressCommitNotFoundWarning": false,
    "suppressFileNotUnderSourceControlWarning": false,
    "suppressGitVersionWarning": false,
    "suppressLineUncommittedWarning": false,
    "suppressNoRepositoryWarning": false
  },
  "git.enableSmartCommit": true,
  //   // 修改注释颜色
  //   "editor.tokenColorCustomizations": {
  //     // "comments": {
  //     //   "fontStyle": "bold",
  //     //   "foreground": "#82e0aa"
  //     // }
  //   },
  // 配置文件类型识别
  "files.associations": {
    "*.js": "javascript",
    "*.json": "jsonc",
    "*.cjson": "jsonc",
    "*.wxss": "css",
    "*.wxs": "javascript"
  },
  "extensions.ignoreRecommendations": false,
  "files.exclude": {
    "**/.DS_Store": true,
    "**/.git": true,
    "**/.hg": true,
    "**/.svn": true,
    "**/CVS": true,
    "**/node_modules": false,
    "**/tmp": true
  },
  "prettier.printWidth": 120,
  "javascript.updateImportsOnFileMove.enabled": "always",
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "explorer.confirmDragAndDrop": false,
  "typescript.updateImportsOnFileMove.enabled": "prompt",
  "git.confirmSync": false,
  "editor.fontWeight": "500",
  "editor.tabCompletion": "on",
  "vsicons.projectDetection.autoReload": true,
  // "editor.fontFamily": "Monaco, 'Courier New', monospace, Meslo LG M for Powerline",
  "[html]": {
    "editor.defaultFormatter": "vscode.html-language-features"
  },
  //   // // 指定 *.js 文件的格式化工具为vscode自带
  "[javascript]": {
    "editor.defaultFormatter": "vscode.typescript-language-features"
  },
  "explorer.confirmDelete": false,
  "debug.console.fontSize": 14,
  "vsicons.dontShowNewVersionMessage": true,
  "editor.minimap.enabled": true,
  "emmet.extensionsPath": [
    ""
  ],
  "editor.codeActionsOnSave": {
  
    "source.fixAll.eslint": true
  },
  "vetur.ignoreProjectWarning": true,
  "[typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "bracketPairColorizer.depreciation-notice": false,
  "editor.unicodeHighlight.ambiguousCharacters": false,
  // 让vetur使用vs自带的js格式化工具
  // uni-app和vue 项目使用
  "vetur.format.defaultFormatter.js": "vscode-typescript",
  "javascript.format.semicolons": "remove",
  "[vue]": {
    // "editor.defaultFormatter": "esbenp.prettier-vscode"
    "editor.defaultFormatter": "octref.vetur"
  },
  //   // 默认使用prettier格式化支持的文件
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  // 函数前面加个空格
  "javascript.format.insertSpaceBeforeFunctionParenthesis": false,
  "prettier.singleQuote": true,
  "prettier.semi": false,
  "prettier.trailingComma": "none", // 去掉结尾的逗号
  //   // eslint end
  //   // react
  //   // 当按tab键的时候,会自动提示
  "emmet.triggerExpansionOnTab": true,
  "emmet.showAbbreviationSuggestions": true,
  "emmet.includeLanguages": {
    // jsx的提示
    "javascript": "javascriptreact",
    "vue-html": "html",
    "vue": "html",
    "wxml": "html"
  },
  "minapp-vscode.disableAutoConfig": true,
  "eslint.options": {},
  "eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
  ],
  "eslint.nodePath": "",
  "vetur.validation.template": false,
  "vetur.completion.autoImport": false,
  "editor.rulers": [],
  //   // end
  "[jsonc]": {
    "editor.defaultFormatter": "vscode.json-language-features"
  },
  //   // @路径提示
  "path-intellisense.mappings": {
    "@": "${workspaceRoot}/src"
  },
  "security.workspace.trust.untrustedFiles": "open",
  "git.ignoreMissingGitWarning": true,
  "editor.suggest.snippetsPreventQuickSuggestions": false,
  "editor.guides.bracketPairs": true,
  // "window.zoomLevel": 1
}