eslint.json 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. {
  2. "env": { "browser": true, "es6": true },
  3. "extends": "eslint:recommended",
  4. "parserOptions": { "sourceType": "module" },
  5. "rules": {
  6. "accessor-pairs": "error",
  7. "array-bracket-spacing": "error",
  8. "array-callback-return": "error",
  9. "arrow-body-style": "error",
  10. "arrow-parens": ["error", "as-needed"],
  11. "arrow-spacing": "error",
  12. "block-spacing": "error",
  13. "callback-return": "error",
  14. "class-methods-use-this": "error",
  15. "comma-dangle": "error",
  16. "comma-spacing": "error",
  17. "comma-style": "error",
  18. "complexity": "error",
  19. "computed-property-spacing": "error",
  20. "consistent-return": "error",
  21. "consistent-this": "error",
  22. "curly": ["error", "multi-or-nest"],
  23. "default-case": "error",
  24. "dot-location": ["error", "property"],
  25. "dot-notation": "error",
  26. "eol-last": "error",
  27. "eqeqeq": "off",
  28. "func-call-spacing": ["error", "always"],
  29. "func-name-matching": "error",
  30. "func-style": ["error", "declaration", { "allowArrowFunctions": true }],
  31. "generator-star-spacing": ["error", "both"],
  32. "global-require": "error",
  33. "guard-for-in": "error",
  34. "handle-callback-err": "error",
  35. "id-blacklist": "error",
  36. "id-match": [
  37. "error",
  38. "^([A-Z]+(_[A-Z]+)*|[_A-Z]?[a-z\\d]+(_[a-z\\d]+)*\\$*)$",
  39. { "onlyDeclarations": true }
  40. ],
  41. "key-spacing": "error",
  42. "keyword-spacing": "error",
  43. "linebreak-style": ["error", "unix"],
  44. "lines-around-directive": "error",
  45. "max-depth": "error",
  46. "max-len": ["error", 80],
  47. "max-nested-callbacks": ["error", 3],
  48. "max-params": "error",
  49. "max-statements": "off",
  50. "max-statements-per-line": "error",
  51. "new-cap": "error",
  52. "new-parens": "error",
  53. "newline-per-chained-call": "error",
  54. "no-alert": "error",
  55. "no-array-constructor": "off",
  56. "no-await-in-loop": "error",
  57. "no-bitwise": "error",
  58. "no-caller": "error",
  59. "no-catch-shadow": "error",
  60. "no-compare-neg-zero": "error",
  61. "no-confusing-arrow": "error",
  62. "no-div-regex": "error",
  63. "no-duplicate-imports": "error",
  64. "no-empty-function": "error",
  65. "no-eq-null": "error",
  66. "no-eval": "error",
  67. "no-extend-native": "error",
  68. "no-extra-bind": "error",
  69. "no-floating-decimal": "error",
  70. "no-implicit-coercion": "error",
  71. "no-implicit-globals": "error",
  72. "no-implied-eval": "error",
  73. "no-invalid-this": "error",
  74. "no-iterator": "error",
  75. "no-labels": "error",
  76. "no-lone-blocks": "error",
  77. "no-lonely-if": "error",
  78. "no-loop-func": "error",
  79. "no-magic-numbers": ["error", { "ignore": [1] }],
  80. "no-mixed-operators": "error",
  81. "no-mixed-requires": "error",
  82. "no-multi-assign": "error",
  83. "no-multi-spaces": "error",
  84. "no-multiple-empty-lines": "error",
  85. "no-native-reassign": "error",
  86. "no-negated-in-lhs": "error",
  87. "no-nested-ternary": "error",
  88. "no-new-func": "error",
  89. "no-new-object": "error",
  90. "no-new-require": "error",
  91. "no-new-wrappers": "error",
  92. "no-octal-escape": "error",
  93. "no-param-reassign": "error",
  94. "no-path-concat": "error",
  95. "no-plusplus": "error",
  96. "no-process-env": "error",
  97. "no-process-exit": "error",
  98. "no-proto": "error",
  99. "no-restricted-globals": "error",
  100. "no-restricted-imports": "error",
  101. "no-restricted-modules": "error",
  102. "no-restricted-properties": "error",
  103. "no-restricted-syntax": "error",
  104. "no-return-assign": "error",
  105. "no-return-await": "error",
  106. "no-script-url": "error",
  107. "no-self-compare": "error",
  108. "no-sequences": "error",
  109. "no-shadow": "error",
  110. "no-shadow-restricted-names": "error",
  111. "no-sync": "error",
  112. "no-tabs": "error",
  113. "no-template-curly-in-string": "error",
  114. "no-throw-literal": "error",
  115. "no-trailing-spaces": "error",
  116. "no-undef-init": "error",
  117. "no-undefined": "error",
  118. "no-underscore-dangle": "error",
  119. "no-unmodified-loop-condition": "error",
  120. "no-unneeded-ternary": "error",
  121. "no-unused-expressions": "error",
  122. "no-use-before-define": "off",
  123. "no-useless-call": "error",
  124. "no-useless-computed-key": "error",
  125. "no-useless-concat": "error",
  126. "no-useless-constructor": "error",
  127. "no-useless-rename": "error",
  128. "no-useless-return": "error",
  129. "no-void": "error",
  130. "no-whitespace-before-property": "error",
  131. "no-with": "error",
  132. "object-curly-newline": "error",
  133. "object-curly-spacing": ["error", "always"],
  134. "object-property-newline": [
  135. "error",
  136. { "allowMultiplePropertiesPerLine": true }
  137. ],
  138. "object-shorthand": "error",
  139. "one-var": ["error", "never"],
  140. "one-var-declaration-per-line": "error",
  141. "operator-assignment": "error",
  142. "operator-linebreak": [
  143. "error",
  144. "before",
  145. { "overrides": { "=" : "after", "?": "after", ":": "after" } }
  146. ],
  147. "padded-blocks": ["error", "never"],
  148. "prefer-arrow-callback": "error",
  149. "prefer-numeric-literals": "error",
  150. "prefer-promise-reject-errors": "error",
  151. "prefer-rest-params": "error",
  152. "prefer-spread": "error",
  153. "quote-props": ["error", "as-needed"],
  154. "quotes": ["error", "double"],
  155. "radix": "error",
  156. "require-await": "error",
  157. "require-jsdoc": "off",
  158. "rest-spread-spacing": "error",
  159. "semi": "error",
  160. "semi-spacing": "error",
  161. "sort-imports": "error",
  162. "space-before-blocks": "error",
  163. "space-before-function-paren": "error",
  164. "space-in-parens": ["error", "never"],
  165. "space-infix-ops": "error",
  166. "space-unary-ops": "error",
  167. "spaced-comment": [
  168. "error",
  169. "always",
  170. { "block": { "balanced": true, "exceptions": ["-"] } }
  171. ],
  172. "strict": "error",
  173. "symbol-description": "error",
  174. "template-curly-spacing": "error",
  175. "unicode-bom": "error",
  176. "valid-jsdoc": "off",
  177. "wrap-iife": "error",
  178. "wrap-regex": "error",
  179. "yield-star-spacing": ["error", { "before": true, "after": false }],
  180. "yoda": "error"
  181. }
  182. }