vscode配置

{
  /************** Editor *****************/
  "editor.fontSize": 16,
  "editor.tabSize": 2,
  "editor.wordWrap": "on",
  "editor.quickSuggestions": {
    "other": true,
    "comments": true,
    "strings": true
  },
  // 是否启用字体连字
  "editor.fontLigatures": true,
  // 保存时自动格式化代码
  // "editor.formatOnSave": true,
  // eslint配置项,保存时自动修复错误
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  //保存时使用自动格式化
  // "eslint.autoFixOnSave": true,
  // 显示隐藏字符
  "editor.renderControlCharacters": false,
  // 光标
  "editor.cursorBlinking": "smooth",
  "editor.cursorStyle": "line",
  "editor.minimap.showSlider": "always",
  // "editor.minimap.enabled": false,
  "explorer.confirmDragAndDrop": false,
  "explorer.openEditors.visible": 0,
  "explorer.confirmDelete": false,
  "editor.fontFamily": "Fira Code Light, Consolas, 'Courier New', monospace",
  // 忽略插件推荐
  "extensions.ignoreRecommendations": true,
  "emmet.triggerExpansionOnTab": true,
  "emmet.includeLanguages": {
    "wxml": "html",
    "vue-html": "html",
    "javascript": "javascriptreact"
  },
  "window.menuBarVisibility": "default",
  "workbench.startupEditor": "welcomePage",
  "workbench.sideBar.location": "left",
  "files.associations": {
    "*.cjson": "jsonc",
    "*.wxml": "html",
    "*.wxss": "css",
    "*.wxs": "javascript",
    "*.vue": "vue"
    // "*.vue": "html"
  },
  "files.exclude": {
    "**/.map": true
  },
  "files.trimTrailingWhitespace": true,
  "files.insertFinalNewline": true,
  //在使用搜索功能时,将这些文件夹/文件排除在外
  "search.exclude": {
    "**/node_modules": true,
    "**/bower_components": true,
    "**/target": true,
    "**/logs": true
  },
  "[html]": {
    "editor.defaultFormatter": "vscode.html-language-features"
  },
  "[json]": {
    "editor.defaultFormatter": "vscode.json-language-features"
  },
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },

  "[javascriptreact]": {
    "editor.defaultFormatter": "numso.prettier-standard-vscode"
  },
  "[vue]": {
    "editor.defaultFormatter": "octref.vetur"
  },
  "[javascript]": {
    // "editor.defaultFormatter": "esbenp.prettier-vscode"
    "editor.defaultFormatter": "numso.prettier-standard-vscode"
  },
  /************** ESlint *****************/
  "eslint.enable": true,
  "eslint.format.enable": true,
  "eslint.run": "onType",
  "eslint.nodePath": "",
  "eslint.options": {
    //指定项目根目录中的eslint配置文件
    "configFile": ".eslintrc.js",
    "extensions": [".js", ".vue", ".ts", ".tsx"]
  },
  "eslint.validate": ["javascript", "javascriptreact", "html", "vue", "jsx"],
  "eslint.codeAction.showDocumentation": {
    "enable": true
  },
  /************** Vetur *****************/
  // vetur验证模板
  "vetur.validation.template": false,
  // 让vetur使用vs自带的js格式化工具,以便在函数前面加个空格
  "vetur.format.defaultFormatter.js": "prettier",
  // 换行字符串阈值
  "prettier.printWidth": 200,
  // (x) => {} 是否要有小括号
  "prettier.arrowParens": "avoid",
  // 是否要换行
  "prettier.proseWrap": "preserve",
  "files.autoSave": "off",
  //将>多行JSX元素放在最后一行的末尾,而不是单独放在下一行
  "prettier.jsxBracketSameLine": true,
  // "prettier.singleQuote": true,
  // "prettier.semi": false,
  /************** Prettier *****************/
  "vetur.format.defaultFormatter.html": "js-beautify-html",
  "vetur.format.defaultFormatterOptions": {
    "prettier": {
      "semi": false, // 格式化不加分号
      "singleQuote": true, // 格式化以单引号为主
      "trailingComma": "none" //末尾不随便加,
    }
    //   "js-beautify-html": {
    //     "wrap_attributes": "force-expand-multiline"
    //   },
    //   "prettyhtml": {
    //     "printWidth": 100,
    //     "singleQuote": false,
    //     "wrapAttributes": false
    // "sortAttributes": true
    //   },
  },
  //方法括号之间插入空格
  "javascript.format.insertSpaceBeforeFunctionParenthesis": false,
  // "vetur.format.defaultFormatter.js": "vscode-typescript",
  "[typescriptreact]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  // 文件头部注释  crtl+alt+i(window),ctrl+cmd+t (mac)
  "fileheader.customMade": {
    "Descripttion": "",
    "version": "",
    "Author": "SunYaQun",
    "Date": "Do not edit",
    "LastEditors": "SunYaQun",
    "LastEditTime": "Do not Edit"
  },
  //函数注释 ctrl+alt+t (window), ctrl+alt+t(mac)
  "fileheader.cursorMode": {
    "name": "SunYaQun",
    "test": "",
    "msg": "",
    "param": "",
    "return": ""
  },

  // 可以为不同语言或文档单独配置
  "[typescript]": {
    "editor.formatOnSave": false
  },
  "[markdown]": {
    "editor.formatOnSave": true
  }
}

你可能感兴趣的:(vscode配置)