用VSCode写Vue要用到的配置用户设置

文件-首选项-设置-打开settings.json-用户设置区域填写:

{
  "workbench.colorTheme": "Monokai",
  "workbench.editor.enablePreview": false, // 打开文件不覆盖
  "search.followSymlinks": false, // 关闭rg.exe进程
  "editor.minimap.enabled": false, // 关闭快速预览
  "files.autoSave": "afterDelay", // 打开自动保存
  "editor.lineNumbers": "on", // 开启行数提示
  "editor.quickSuggestions": {
    // 开启自动显示建议
    "other": true,
    "comments": true,
    "strings": true
  },
  "editor.tabSize": 2, // 为了符合eslint的两个空格间隔原则
  "files.associations": {
    "*.vue": "vue"
  },
  "eslint.autoFixOnSave": true,
  "eslint.options": {
    "extensions": [".js", ".vue"]
  },
  "prettier.eslintIntegration": true, // 让prettier使用eslint的代码格式进行校验
  "prettier.semi": true, // 去掉代码结尾的分号
  "prettier.singleQuote": true, // 使用单引号替代双引号
  "javascript.format.insertSpaceBeforeFunctionParenthesis": true, // 让函数(名)和后面的括号之间加个空格
  "vetur.format.defaultFormatter.html": "js-beautify-html", // 格式化.vue中html
  "vetur.format.defaultFormatter.js": "vscode-typescript", // 让vue中的js按编辑器自带的ts格式进行格式化
  "vetur.format.defaultFormatterOptions": {
    "js-beautify-html": {
      "wrap_attributes": "force-aligned" // 属性强制折行对齐
    }
  },
  "eslint.validate": [
    "javascript",
    {
      "language": "vue",
      "autoFix": true
    },
    {
      "language": "html",
      "autoFix": true
    }
  ],
  "search.exclude": {
    "**/node_modules": true,
    "**/bower_components": true,
    "**/dist": true
  },
  "emmet.syntaxProfiles": {
    "javascript": "jsx",
    "vue": "html",
    "vue-html": "html"
  },
  "editor.fontSize": 22, // 编辑器文字大小
  "window.zoomLevel": 0
}
之后在VSCode中就可以通过 ctrl+shift+f 来按eslint格式进行格式化了。
欢迎使用66资源网
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
7. 本站有不少源码未能详细测试(解密),不能分辨部分源码是病毒还是误报,所以没有进行任何修改,大家使用前请进行甄别!

66源码网 » 用VSCode写Vue要用到的配置用户设置

提供最优质的资源集合

立即查看 了解详情