.eslintrc.json 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. {
  2. "root": true,
  3. "parser": "babel-eslint",
  4. "env": {
  5. "browser": true,
  6. "es6": true
  7. },
  8. "extends": ["eslint:recommended"],
  9. "rules": {
  10. // Possible Errors
  11. "no-await-in-loop": "error",
  12. "no-extra-parens": "error",
  13. "no-prototype-builtins": "error",
  14. "no-template-curly-in-string": "error",
  15. "valid-jsdoc": "error",
  16. // Best Practices
  17. "accessor-pairs": "error",
  18. "array-callback-return": "error",
  19. "block-scoped-var": "error",
  20. "class-methods-use-this": "off",
  21. "complexity": "error",
  22. "consistent-return": "error",
  23. "curly": "error",
  24. "default-case": "error",
  25. "dot-location": ["error", "property"],
  26. "dot-notation": "error",
  27. "eqeqeq": "error",
  28. "guard-for-in": "error",
  29. "no-alert": "error",
  30. "no-caller": "error",
  31. "no-div-regex": "error",
  32. "no-else-return": "error",
  33. "no-empty-function": "error",
  34. "no-eq-null": "error",
  35. "no-eval": "error",
  36. "no-extend-native": "error",
  37. "no-extra-bind": "error",
  38. "no-extra-label": "error",
  39. "no-floating-decimal": "error",
  40. "no-implicit-coercion": "error",
  41. "no-implicit-globals": "error",
  42. "no-implied-eval": "error",
  43. "no-invalid-this": "off",
  44. "no-iterator": "error",
  45. "no-labels": "error",
  46. "no-lone-blocks": "error",
  47. "no-loop-func": "error",
  48. "no-magic-numbers": ["error", {
  49. "ignore": [-1, 0, 1],
  50. "ignoreArrayIndexes": true
  51. }
  52. ],
  53. "no-multi-spaces": ["error", {
  54. "ignoreEOLComments": true,
  55. "exceptions": {
  56. "AssignmentExpression": true,
  57. "ArrowFunctionExpression": true,
  58. "CallExpression": true,
  59. "VariableDeclarator": true
  60. }
  61. }
  62. ],
  63. "no-multi-str": "error",
  64. "no-new": "error",
  65. "no-new-func": "error",
  66. "no-new-wrappers": "error",
  67. "no-octal-escape": "error",
  68. "no-param-reassign": "off",
  69. "no-proto": "error",
  70. "no-restricted-properties": "error",
  71. "no-return-assign": "error",
  72. "no-return-await": "error",
  73. "no-script-url": "error",
  74. "no-self-compare": "error",
  75. "no-sequences": "error",
  76. "no-throw-literal": "error",
  77. "no-unmodified-loop-condition": "error",
  78. "no-unused-expressions": "error",
  79. "no-useless-call": "error",
  80. "no-useless-concat": "error",
  81. "no-useless-return": "error",
  82. "no-void": "error",
  83. "no-warning-comments": "off",
  84. "no-with": "error",
  85. "prefer-promise-reject-errors": "error",
  86. "radix": "error",
  87. "require-await": "error",
  88. "vars-on-top": "error",
  89. "wrap-iife": "error",
  90. "yoda": "error",
  91. // Strict Mode
  92. "strict": "error",
  93. // Variables
  94. "init-declarations": "off",
  95. "no-catch-shadow": "error",
  96. "no-label-var": "error",
  97. "no-restricted-globals": "error",
  98. "no-shadow": "off",
  99. "no-shadow-restricted-names": "error",
  100. "no-undef-init": "error",
  101. "no-undefined": "error",
  102. "no-use-before-define": "off",
  103. // Node.js and CommonJS
  104. "callback-return": "off",
  105. "global-require": "error",
  106. "handle-callback-err": "error",
  107. "no-mixed-requires": "error",
  108. "no-new-require": "error",
  109. "no-path-concat": "error",
  110. "no-process-env": "error",
  111. "no-process-exit": "error",
  112. "no-restricted-modules": "error",
  113. "no-sync": "error",
  114. // Stylistic Issues
  115. "array-bracket-spacing": "error",
  116. "block-spacing": "error",
  117. "brace-style": "error",
  118. "camelcase": "error",
  119. "capitalized-comments": "off",
  120. "comma-dangle": "error",
  121. "comma-spacing": "error",
  122. "comma-style": "error",
  123. "computed-property-spacing": "error",
  124. "consistent-this": "error",
  125. "eol-last": "error",
  126. "func-call-spacing": "error",
  127. "func-name-matching": "error",
  128. "func-names": "off",
  129. "func-style": ["error", "declaration"],
  130. "id-blacklist": "error",
  131. "id-length": "off",
  132. "id-match": "error",
  133. "indent": ["error", 2, { "SwitchCase": 1 }],
  134. "jsx-quotes": "error",
  135. "key-spacing": "off",
  136. "keyword-spacing": "error",
  137. "linebreak-style": ["error", "unix"],
  138. "line-comment-position": "off",
  139. "lines-around-comment": "off",
  140. "lines-around-directive": "error",
  141. "max-depth": ["error", 10],
  142. "max-len": "off",
  143. "max-lines": "off",
  144. "max-nested-callbacks": "error",
  145. "max-params": "off",
  146. "max-statements": "off",
  147. "max-statements-per-line": "error",
  148. "multiline-ternary": "off",
  149. "new-cap": ["error", { "capIsNewExceptionPattern": "$.*" }],
  150. "newline-after-var": "off",
  151. "newline-per-chained-call": ["error", { "ignoreChainWithDepth": 5 }],
  152. "new-parens": "error",
  153. "no-array-constructor": "error",
  154. "no-bitwise": "error",
  155. "no-continue": "off",
  156. "no-inline-comments": "off",
  157. "no-lonely-if": "error",
  158. "no-mixed-operators": "off",
  159. "no-multi-assign": "error",
  160. "no-multiple-empty-lines": "error",
  161. "nonblock-statement-body-position": "error",
  162. "no-negated-condition": "off",
  163. "no-nested-ternary": "error",
  164. "no-new-object": "error",
  165. "no-plusplus": "off",
  166. "no-restricted-syntax": "error",
  167. "no-tabs": "error",
  168. "no-ternary": "off",
  169. "no-trailing-spaces": "error",
  170. "no-underscore-dangle": "off",
  171. "no-unneeded-ternary": "error",
  172. "no-whitespace-before-property": "error",
  173. "object-curly-newline": ["error", { "minProperties": 1 }],
  174. "object-curly-spacing": ["error", "always"],
  175. "object-property-newline": "error",
  176. "one-var": ["error", "never"],
  177. "one-var-declaration-per-line": "error",
  178. "operator-assignment": "error",
  179. "operator-linebreak": "error",
  180. "padded-blocks": ["error", "never"],
  181. "padding-line-between-statements": "off",
  182. "quote-props": ["error", "as-needed"],
  183. "quotes": ["error", "single"],
  184. "require-jsdoc": "off",
  185. "semi": ["error", "never"],
  186. "semi-spacing": "error",
  187. "sort-keys": "off",
  188. "sort-vars": "error",
  189. "space-before-blocks": "error",
  190. "space-before-function-paren": ["error", {
  191. "anonymous": "always",
  192. "named": "never"
  193. }],
  194. "space-in-parens": "error",
  195. "space-infix-ops": "error",
  196. "space-unary-ops": "error",
  197. "spaced-comment": "error",
  198. "template-tag-spacing": "error",
  199. "unicode-bom": "error",
  200. "wrap-regex": "off",
  201. // ECMAScript 6
  202. "arrow-body-style": ["error", "as-needed"],
  203. "arrow-parens": "error",
  204. "arrow-spacing": "error",
  205. "generator-star-spacing": "error",
  206. "no-confusing-arrow": "error",
  207. "no-duplicate-imports": "error",
  208. "no-restricted-imports": "error",
  209. "no-useless-computed-key": "error",
  210. "no-useless-constructor": "error",
  211. "no-useless-rename": "error",
  212. "no-var": "error",
  213. "object-shorthand": "error",
  214. "prefer-arrow-callback": "error",
  215. "prefer-const": "error",
  216. "prefer-destructuring": "off",
  217. "prefer-numeric-literals": "error",
  218. "prefer-rest-params": "error",
  219. "prefer-spread": "error",
  220. "prefer-template": "error",
  221. "rest-spread-spacing": "error",
  222. "sort-imports": "error",
  223. "symbol-description": "error",
  224. "template-curly-spacing": "error",
  225. "yield-star-spacing": "error"
  226. }
  227. }