ESlint 协同开发标准配置文件,保存自动格式化

ESlint作为前端开发的有力格式修改工具,配置规则还是很重要的,记录一下我的配置规则,防止某天换电脑找不到。

{
    "eslint.codeAction.showDocumentation": {

    "#ff0000"
        "enable": true
    }
    

    "editor.renderIndentGuides": false,

    "path-intellisense.mappings": {
      "@": "${workspaceRoot}/src"
    },
    "autoprefixer.ignoreFiles": [
      "ie >= 6", //ie6以上
      "firefox >= 8",
      "chrome >= 24",
      "Opera>=10"
    ],
    "workbench.tree.indent": 4,
    "git.path": "C:\\Program Files\\Git\\cmd\\git.exe",
    "git.enableSmartCommit": true,
    "editor.tabSize": 2,
    // 100 列后换行git.exe
    "editor.wordWrapColumn": 100,
    // 保存时格式化
    "editor.formatOnSave": true,
    // #每次保存的时候将代码按eslint格式进行修复
    "editor.codeActionsOnSave": { "source.fixAll.eslint": false },
    // 开启 vscode 文件路径导航
    "breadcrumbs.enabled": true,
    // prettier 设置语句末尾不加分号
    "prettier.semi": false,
    // prettier 设置强制单引号
    "prettier.singleQuote": true,
    // 去掉对象最后的逗号
    "prettier.trailingComma": "none",
    // 选择 vue 文件中 template 的格式化工具
    "vetur.format.defaultFormatter.html": "prettyhtml",
    // 显示 markdown 中英文切换时产生的特殊字符
    "editor.renderControlCharacters": true,
    // eslint 检测文件类型
    "eslint.validate": [
      "vue",
      "html",
      "javascript",
      "typescript",
      "javascriptreact",
      "typescriptreact"
    ],
    // vetur 的自定义设置
    "vetur.format.defaultFormatterOptions": {
      "prettier": {
        "singleQuote": true,
        "semi": false
      }
    },
    "[vue]": {
      "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[json]": {
      "editor.quickSuggestions": {
          "strings": true
      },
      "editor.suggest.insertMode": "replace",
      "gitlens.codeLens.scopes": [
          "document"
      ]
  }
  }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值