vscode 配置 - davy-gan/web GitHub Wiki

{
  "emmet.syntaxProfiles": {
    "vue-html": "html",
    "vue": "html"
  },
  "emmet.includeLanguages": {
    "javascript": "javascriptreact",
    // "javascript": "html",
    "wxml": "html",
    "vue-html": "html",
    "vue": "html"
  },
  "emmet.triggerExpansionOnTab": true,
  "emmet.showAbbreviationSuggestions": true,
  "emmet.showExpandedAbbreviation": "always",
  "files.associations": {
    "*.ejs": "html",
    "*.twig": "html",
    "*.cjson": "jsonc",
    "*.wxss": "css",
    "*.wxs": "javascript",
    "*.json": "jsonc",
    "*.vue": "vue",
    "*.scss": "scss",
    "*.db": "sql"
  },
  "beautify.language": {
    "js": {
      "type": [
        "json"
      ],
      "filename": [
        ".jshintrc",
        ".jsbeautify"
      ]
    },
    "css": [
      "css",
      "scss"
    ],
    "html": [
      "htm",
      "html",
      "twig",
      "ejs"
    ],
  },
  "javascript.validate.enable": false,
  "css.validate": false,
  "editor.fontSize": 15,
  "editor.lineHeight": 22,
  "editor.tabSize": 2,
  "editor.quickSuggestions": {
    "other": true,
    "comments": true,
    "strings": true
  },
  // "editor.fontFamily": "Ayuthaya, Menlo, Monaco, 'Courier New', monospace",
  "editor.wordWrap": "on",
  // By default, common template. Do not modify it!!!!!
  "editor.detectIndentation": false,
  //保存时eslint自动修复错误
  "editor.formatOnSave": true,
  // Enable per-language
  //配置 ESLint 检查的文件类型
  // 开启eslint自动修复js/ts功能
  "editor.codeActionsOnSave": {
    "source.fixAll": true,
    "source.fixAll.eslint": true
  },
  "editor.largeFileOptimizations": false,
  // 控制选取范围是否有圆角
  "typescript.validate.enable": true,
  "git.confirmSync": false,
  "workbench.statusBar.visible": true,
  "workbench.activityBar.visible": true,
  "workbench.colorTheme": "One Dark Pro",
  "extensions.autoUpdate": false,
  "git.enableSmartCommit": true,
  "html.format.wrapAttributes": "force-expand-multiline",
  "vetur.format.defaultFormatter.html": "js-beautify-html",
  "vetur.format.defaultFormatter.js": "prettier",
  "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
  "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
  "vetur.format.defaultFormatterOptions": {
    "js-beautify-html": {
      "wrap_attributes": "force",
      "singleQuote": false
    },
    "prettyhtml": {
      "printWidth": 100,
      "singleQuote": false,
      "wrapAttributes": false,
      "sortAttributes": true
    },
    "prettier": {
      "semi": false,
      "singleQuote": true,
      "trailingComma": "none"
    }
  },
  "terminal.integrated.fontSize": 15,
  // "terminal.integrated.lineHeight": 1,
  // "terminal.integrated.shell.linux": "/bin/bash",
  // "terminal.integrated.shell.osx": "/bin/zsh",
  // "terminal.integrated.shell.windows": "D:\\Program Files\\Git\\bin\\bash.exe",
  "terminal.integrated.profiles.windows": { // Add a PowerShell profile that doesn't run the profile
    "Git Bash": {
      "path": "D:\\Program Files\\Git\\bin\\bash.exe",
      "args": [
        "--login"
      ],
    }
  },
  "terminal.integrated.defaultProfile.windows": "Git Bash",
  // "terminal.integrated.fontFamily": "Hack Nerd Font",
  // "eslint.validate": [
  //   "javascript",
  //   "javascriptreact",
  //   "html"
  //   "vue"
  //   {
  //   "language": "vue"
  //   "autoFix": true
  //   }
  // ],
  "workbench.iconTheme": "vscode-icons",
  "vsicons.dontShowNewVersionMessage": true,
  "search.exclude": {
    "**/node_modules": true,
    "**/bower_components": true
  },
  "search.followSymlinks": false,
  // "files.exclude": {
  //   "**/.git": true,
  //   "**/.svn": true,
  //   "**/.hg": true,
  //   "**/CVS": true,
  //   "**/.DS_Store": true,
  //   "**/tmp": true,
  //   "**/node_modules": true,
  //   "**/bower_components": true,
  //   "**/dist": true
  // },
  "files.watcherExclude": {
    "**/.git/objects/**": true,
    "**/.git/subtree-cache/**": true,
    "**/node_modules/**": true,
    "**/tmp/**": true,
    "**/bower_components/**": true,
    "**/dist/**": true
  },
  "diffEditor.ignoreTrimWhitespace": false,
  "minapp-vscode.disableAutoConfig": true,
  "git.autofetch": true,
  "path-intellisense.mappings": {
    "@": "${workspaceRoot}/src"
  },
  "gitlens.advanced.messages": {
    "suppressCommitHasNoPreviousCommitWarning": true,
    "suppressGitMissingWarning": true
  },
  // 是否已启用自动刷新
  "git.autorefresh": true,
  // 控制终端游标是否闪烁。
  "terminal.integrated.cursorBlinking": true,
  // Enable per-language
  "[vue]": {
    "editor.defaultFormatter": "octref.vetur"
  },
  "[html]": {
    "editor.defaultFormatter": "octref.vetur"
  },
  "[javascript]": {
    "editor.defaultFormatter": "octref.vetur"
  },
  "[typescriptreact]": {
    "editor.defaultFormatter": "octref.vetur"
  },
  // "[json]": {
  //   "editor.defaultFormatter": "octref.vetur"
  // },
  // "[less]": {
  //   "editor.defaultFormatter": "octref.vetur"
  // },
  // "[scss]": {
  //   "editor.defaultFormatter": "octref.vetur"
  // },
  "[scss]": {
    "editor.defaultFormatter": "michelemelluso.code-beautifier"
  },
  "[sass]": {
    "editor.defaultFormatter": "michelemelluso.code-beautifier"
  },
  "[jsonc]": {
    "editor.quickSuggestions": {
      "strings": true
    },
    "editor.suggest.insertMode": "replace",
    "gitlens.codeLens.scopes": [
      "document"
    ],
    "editor.defaultFormatter": "octref.vetur"
  },
  "prettier.printWidth": 100, // 每行最大宽度
  "prettier.tabWidth": 2, // 制表符宽度
  "prettier.useTabs": false, // 是否使用 tab 代替 space(空格)
  "prettier.semi": false, // 句尾是否自动补全“分号”
  "prettier.singleQuote": true, // 启用单引号
  "prettier.quoteProps": "consistent", // 对象引号 as-needed|consistent|preserve 按需|保持一致|遵循原格式
  "prettier.jsxSingleQuote": false, // JSX 文件中使用单引号代替双引号
  "prettier.trailingComma": "none", // 尾随逗号
  "prettier.bracketSpacing": true, // 括号空格
  "prettier.jsxBracketSameLine": true, // 将多行 JSX 元素的 > 放置于最后一行的末尾
  "prettier.arrowParens": "avoid", // 箭头函数圆括号
  "prettier.htmlWhitespaceSensitivity": "css", // 空格敏感度 css|strict|ignore
  "prettier.vueIndentScriptAndStyle": false,
  "prettier.endOfLine": "lf", // 收尾 auto|lf|crlf|cr
  "prettier.proseWrap": "never",
  "git.ignoreWindowsGit27Warning": true,
  "i18n-ally.displayLanguage": "zh",
  "i18n-ally.annotationInPlace": false,
  "i18n-ally.annotationDelimiter": "→",
  "i18n-ally.editor.preferEditor": true,
}