eslint

作者: 风吹过的空气 | 来源:发表于2018-07-19 17:20 被阅读9次

    eslint配置

    • "off" or 0 - 关闭规则
    • "warn" or 1 - 将规则视为一个警告
    • "error" or 2 - 将规则视为一个错误

    如果是一般的项目想要写点小东西,就不用配置的太麻烦

    {
      "parserOptions": {
        "ecmaVersion": 6,
        "sourceType": "module",
        "ecmaFeatures": {
          "jsx": false
        }
      },
      "extends": "eslint:recommended",
      "rules": {
        "semi": 2,
        "no-console": 0
      },
      "env": {
        "browser": true,
        "node": true
      },
      "ecmaFeatures": {
        "arrowFunctions": true,
        "blockBindings": true,
        "classes": true,
        "defaultParams": true,
        "destructuring": true,
        "forOf": true,
        "generators": false,
        "modules": true,
        "objectLiteralComputedProperties": true,
        "objectLiteralDuplicateProperties": false,
        "objectLiteralShorthandMethods": true,
        "objectLiteralShorthandProperties": true,
        "spread": true,
        "superInFunctions": true,
        "templateStrings": true,
        "jsx": true
      }
    }
    

    相关文章

      网友评论

          本文标题:eslint

          本文链接:https://www.haomeiwen.com/subject/zputmftx.html