zoukankan      html  css  js  c++  java
  • 用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格式进行格式化了。

  • 相关阅读:
    ln 硬链接与软链接
    Fujitsu存储多路径管理
    Ansible 模块详解
    思科光纤交换机9124管理手册
    Fujitsu DX100S3配置方案
    富士通存储的TPP池和SDPV池
    Solaris 10 ZFS文件系统挂载
    经分测试M5000重启进入维护模式
    finally在return之后还是之前运行
    gradle构建
  • 原文地址:https://www.cnblogs.com/LanTianYou/p/9817965.html
Copyright © 2011-2022 走看看