.eslintrc.json 7.6 KB

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