.eslintrc.json 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. {
  2. "parserOptions": {
  3. "ecmaVersion": 2017,
  4. "sourceType": "module",
  5. "ecmaFeatures": {
  6. "experimentalObjectRestSpread": true
  7. }
  8. },
  9. "env": {
  10. "es6": true,
  11. "node": true
  12. },
  13. "extends": "eslint:recommended",
  14. "plugins": [
  15. "html"
  16. ],
  17. "settings": {
  18. "html/html-extensions": [".vue"]
  19. },
  20. "rules": {
  21. "no-console": "off",
  22. "no-extra-parens": ["warn", "all", { "nestedBinaryExpressions": false }],
  23. "accessor-pairs": "warn",
  24. "array-callback-return": "error",
  25. "complexity": "warn",
  26. "consistent-return": "error",
  27. "curly": ["error", "multi-line", "consistent"],
  28. "dot-location": ["error", "property"],
  29. "dot-notation": "error",
  30. "eqeqeq": "error",
  31. "no-empty-function": "error",
  32. "no-floating-decimal": "error",
  33. "no-implied-eval": "error",
  34. "no-invalid-this": "error",
  35. "no-lone-blocks": "error",
  36. "no-multi-spaces": "error",
  37. "no-new-func": "error",
  38. "no-new-wrappers": "error",
  39. "no-new": "error",
  40. "no-octal-escape": "error",
  41. "no-return-assign": "error",
  42. "no-self-compare": "error",
  43. "no-sequences": "error",
  44. "no-throw-literal": "error",
  45. "no-unmodified-loop-condition": "error",
  46. "no-unused-expressions": "error",
  47. "no-useless-call": "error",
  48. "no-useless-concat": "error",
  49. "no-useless-escape": "error",
  50. "no-void": "error",
  51. "no-warning-comments": "warn",
  52. "wrap-iife": "error",
  53. "yoda": "error",
  54. "no-label-var": "error",
  55. "no-shadow": "error",
  56. "no-undef-init": "error",
  57. "handle-callback-err": "error",
  58. "no-mixed-requires": "error",
  59. "no-new-require": "error",
  60. "no-path-concat": "error",
  61. "array-bracket-spacing": "error",
  62. "block-spacing": "error",
  63. "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
  64. "camelcase": "error",
  65. "comma-dangle": "error",
  66. "comma-spacing": "error",
  67. "comma-style": "error",
  68. "computed-property-spacing": "error",
  69. "consistent-this": "error",
  70. "eol-last": "error",
  71. "func-style": ["error", "declaration", { "allowArrowFunctions": true }],
  72. "id-length": ["error", { "exceptions": ["i", "j", "a", "b", "_"] }],
  73. "indent": ["error", "tab", { "SwitchCase": 1 }],
  74. "key-spacing": "error",
  75. "keyword-spacing": ["error", {
  76. "overrides": {
  77. "if": { "after": true },
  78. "for": { "after": true },
  79. "while": { "after": true },
  80. "catch": { "after": true },
  81. "switch": { "after": true }
  82. }
  83. }],
  84. "max-depth": "error",
  85. "max-len": ["error", 120, 2],
  86. "max-nested-callbacks": ["error", { "max": 4 }],
  87. "max-statements-per-line": ["error", { "max": 2 }],
  88. "new-cap": "error",
  89. "newline-per-chained-call": ["error", { "ignoreChainWithDepth": 3 }],
  90. "no-array-constructor": "error",
  91. "no-bitwise": "warn",
  92. "no-inline-comments": "error",
  93. "no-lonely-if": "error",
  94. "no-mixed-operators": "error",
  95. "no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }],
  96. "no-new-object": "error",
  97. "no-spaced-func": "error",
  98. "no-trailing-spaces": "error",
  99. "no-unneeded-ternary": "error",
  100. "no-whitespace-before-property": "error",
  101. "object-curly-newline": "error",
  102. "object-curly-spacing": ["error", "always"],
  103. "operator-assignment": "error",
  104. "operator-linebreak": ["error", "before"],
  105. "padded-blocks": ["error", "never"],
  106. "quote-props": ["error", "as-needed"],
  107. "quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
  108. "semi-spacing": "error",
  109. "semi": "off",
  110. "space-before-blocks": "error",
  111. "space-before-function-paren": ["error", "never"],
  112. "space-in-parens": "error",
  113. "space-infix-ops": "error",
  114. "space-unary-ops": "error",
  115. "spaced-comment": "error",
  116. "unicode-bom": "error",
  117. "arrow-spacing": "error",
  118. "no-duplicate-imports": "error",
  119. "no-useless-computed-key": "error",
  120. "no-useless-constructor": "error",
  121. "prefer-arrow-callback": "error",
  122. "prefer-rest-params": "error",
  123. "prefer-spread": "error",
  124. "prefer-template": "error",
  125. "rest-spread-spacing": "error",
  126. "template-curly-spacing": "error",
  127. "yield-star-spacing": "error",
  128. "no-unused-vars": "warn"
  129. }
  130. }