eslint

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)