.eslintrc.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. module.exports = {
  2. "env": {
  3. "browser": true,
  4. "commonjs": true,
  5. "es6": true
  6. },
  7. "extends": "eslint:recommended",
  8. "parser": "babel-eslint",
  9. "parserOptions": {
  10. "ecmaVersion": 7,
  11. "sourceType": "module",
  12. "ecmaFeatures": {
  13. "classes": true
  14. },
  15. },
  16. "rules": {
  17. "accessor-pairs": "error",
  18. "array-bracket-spacing": "error",
  19. "array-callback-return": "error",
  20. "arrow-body-style": "error",
  21. "arrow-parens": "off",
  22. "arrow-spacing": [
  23. "error",
  24. {
  25. "after": true,
  26. "before": true
  27. }
  28. ],
  29. "block-scoped-var": "off",
  30. "block-spacing": [
  31. "error",
  32. "always"
  33. ],
  34. "brace-style": [
  35. "error",
  36. "1tbs",
  37. {
  38. "allowSingleLine": true
  39. }
  40. ],
  41. "callback-return": "off",
  42. "camelcase": "error",
  43. "class-methods-use-this": "off",
  44. "comma-dangle": "error",
  45. "comma-spacing": [
  46. "error",
  47. {
  48. "after": true,
  49. "before": false
  50. }
  51. ],
  52. "comma-style": [
  53. "error",
  54. "last"
  55. ],
  56. "complexity": "error",
  57. "computed-property-spacing": [
  58. "error",
  59. "never"
  60. ],
  61. "consistent-return": "off",
  62. "consistent-this": "off",
  63. "curly": "error",
  64. "default-case": "off",
  65. "dot-location": "off",
  66. "dot-notation": "error",
  67. "eol-last": "error",
  68. "eqeqeq": "off",
  69. "func-call-spacing": "error",
  70. "func-name-matching": "error",
  71. "func-names": [
  72. "error",
  73. "never"
  74. ],
  75. "func-style": "off",
  76. "generator-star-spacing": "error",
  77. "global-require": "error",
  78. "guard-for-in": "off",
  79. "handle-callback-err": "error",
  80. "id-blacklist": "error",
  81. "id-length": "off",
  82. "id-match": "error",
  83. "indent": [2, 4, { "SwitchCase": 1 }],
  84. "init-declarations": "off",
  85. "jsx-quotes": "error",
  86. "key-spacing": "off",
  87. "keyword-spacing": [
  88. "error",
  89. {
  90. "after": true,
  91. "before": true
  92. }
  93. ],
  94. "line-comment-position": "off",
  95. "linebreak-style": [
  96. "error",
  97. "unix"
  98. ],
  99. "lines-around-comment": "off",
  100. "lines-around-directive": "error",
  101. "max-depth": "error",
  102. "max-len": "off",
  103. "max-lines": "off",
  104. "max-nested-callbacks": "error",
  105. "max-params": "off",
  106. "max-statements": "off",
  107. "max-statements-per-line": "off",
  108. "multiline-ternary": "off",
  109. "new-cap": "error",
  110. "new-parens": "off",
  111. "newline-after-var": "off",
  112. "newline-before-return": "off",
  113. "newline-per-chained-call": "off",
  114. "no-redeclare": "error",
  115. "no-unused-vars": "off",
  116. "no-console": "off",
  117. "no-alert": "error",
  118. "no-array-constructor": "error",
  119. "no-bitwise": "off",
  120. "no-caller": "error",
  121. "no-catch-shadow": "error",
  122. "no-confusing-arrow": [
  123. "error",
  124. {
  125. "allowParens": true
  126. }
  127. ],
  128. "no-continue": "error",
  129. "no-div-regex": "error",
  130. "no-duplicate-imports": "error",
  131. "no-else-return": "error",
  132. "no-empty-function": "off",
  133. "no-eq-null": "off",
  134. "no-eval": "error",
  135. "no-extend-native": "error",
  136. "no-extra-bind": "error",
  137. "no-extra-label": "error",
  138. "no-extra-parens": "off",
  139. "no-floating-decimal": "error",
  140. "no-implicit-coercion": "off",
  141. "no-implicit-globals": "error",
  142. "no-implied-eval": "error",
  143. "no-inline-comments": "off",
  144. "no-inner-declarations": [
  145. "error",
  146. "functions"
  147. ],
  148. "no-invalid-this": "off",
  149. "no-iterator": "error",
  150. "no-label-var": "error",
  151. "no-labels": "error",
  152. "no-lone-blocks": "error",
  153. "no-lonely-if": "error",
  154. "no-loop-func": "error",
  155. "no-magic-numbers": "off",
  156. "no-mixed-operators": "off",
  157. "no-mixed-requires": "error",
  158. "no-multi-spaces": "error",
  159. "no-multi-str": "error",
  160. "no-multiple-empty-lines": "off",
  161. "no-native-reassign": "error",
  162. "no-negated-condition": "off",
  163. "no-negated-in-lhs": "error",
  164. "no-nested-ternary": "error",
  165. "no-new": "error",
  166. "no-new-func": "error",
  167. "no-new-object": "error",
  168. "no-new-require": "error",
  169. "no-new-wrappers": "error",
  170. "no-octal-escape": "error",
  171. "no-param-reassign": "off",
  172. "no-path-concat": "error",
  173. "no-plusplus": "off",
  174. "no-process-env": "error",
  175. "no-process-exit": "error",
  176. "no-proto": "error",
  177. "no-prototype-builtins": "error",
  178. "no-restricted-globals": "error",
  179. "no-restricted-imports": "error",
  180. "no-restricted-modules": "error",
  181. "no-restricted-properties": "error",
  182. "no-restricted-syntax": "error",
  183. "no-return-assign": "error",
  184. "no-script-url": "error",
  185. "no-self-compare": "error",
  186. "no-sequences": "error",
  187. "no-shadow": "off",
  188. "no-shadow-restricted-names": "error",
  189. "no-spaced-func": "error",
  190. "no-sync": "error",
  191. "no-tabs": "off",
  192. "no-template-curly-in-string": "error",
  193. "no-ternary": "off",
  194. "no-throw-literal": "off",
  195. "no-trailing-spaces": "error",
  196. "no-undef-init": "error",
  197. "no-undefined": "off",
  198. "no-underscore-dangle": "off",
  199. "no-unmodified-loop-condition": "error",
  200. "no-unneeded-ternary": "error",
  201. "no-use-before-define": "error",
  202. "no-useless-call": "error",
  203. "no-useless-computed-key": "error",
  204. "no-useless-concat": "error",
  205. "no-useless-constructor": "off",
  206. "no-useless-escape": "error",
  207. "no-useless-rename": "error",
  208. "no-useless-return": "error",
  209. "no-var": "error",
  210. "no-void": "error",
  211. "no-warning-comments": "off",
  212. "no-whitespace-before-property": "error",
  213. "no-with": "error",
  214. "object-curly-newline": "off",
  215. "object-curly-spacing": "off",
  216. "object-property-newline": "off",
  217. "object-shorthand": [
  218. "error",
  219. "methods",
  220. {
  221. avoidQuotes: true
  222. }
  223. ],
  224. "one-var": [
  225. "error",
  226. {
  227. var: "never",
  228. let: "never",
  229. const: "never"
  230. }
  231. ],
  232. "one-var-declaration-per-line": "error",
  233. "operator-assignment": "off",
  234. "operator-linebreak": "off",
  235. "padded-blocks": "off",
  236. "prefer-arrow-callback": "error",
  237. "prefer-const": "error",
  238. "prefer-numeric-literals": "error",
  239. "prefer-reflect": "off",
  240. "prefer-rest-params": "error",
  241. "prefer-spread": "error",
  242. "prefer-template": "off",
  243. "quote-props": "off",
  244. "quotes": [
  245. "error",
  246. "single"
  247. ],
  248. "radix": "off",
  249. "require-jsdoc": "error",
  250. "rest-spread-spacing": "error",
  251. "semi": "error",
  252. "semi-spacing": "error",
  253. "sort-imports": "off",
  254. "sort-keys": "off",
  255. "sort-vars": "off",
  256. "space-before-blocks": "off",
  257. "space-before-function-paren": "off",
  258. "space-in-parens": [
  259. "error",
  260. "never"
  261. ],
  262. "space-infix-ops": "off",
  263. "space-unary-ops": "off",
  264. "spaced-comment": "off",
  265. "strict": "error",
  266. "symbol-description": "error",
  267. "template-curly-spacing": "error",
  268. "unicode-bom": [
  269. "error",
  270. "never"
  271. ],
  272. "valid-jsdoc": "off",
  273. "vars-on-top": "off",
  274. "wrap-iife": "error",
  275. "wrap-regex": "error",
  276. "yield-star-spacing": "error",
  277. "yoda": "off"
  278. }
  279. };