.eslintrc.json 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. {
  2. "parserOptions": {
  3. "ecmaVersion": 8,
  4. "ecmaFeatures": {
  5. "experimentalObjectRestSpread": true,
  6. "jsx": true
  7. },
  8. "sourceType": "module"
  9. },
  10. "env": {
  11. "es6": true,
  12. "node": true
  13. },
  14. "plugins": [
  15. "import",
  16. "node",
  17. "promise",
  18. "standard"
  19. ],
  20. "globals": {
  21. "document": false,
  22. "navigator": false,
  23. "window": false
  24. },
  25. "rules": {
  26. "accessor-pairs": "error",
  27. "arrow-spacing": ["error", { "before": true, "after": true }],
  28. "block-spacing": ["error", "always"],
  29. "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
  30. "camelcase": ["error", { "properties": "never" }],
  31. "comma-dangle": ["error", {
  32. "arrays": "never",
  33. "objects": "never",
  34. "imports": "never",
  35. "exports": "never",
  36. "functions": "never"
  37. }],
  38. "comma-spacing": ["error", { "before": false, "after": true }],
  39. "comma-style": ["error", "last"],
  40. "constructor-super": "error",
  41. "curly": ["error", "multi-line"],
  42. "dot-location": ["error", "property"],
  43. "eol-last": "error",
  44. "eqeqeq": ["error", "always", { "null": "ignore" }],
  45. "func-call-spacing": ["error", "never"],
  46. "generator-star-spacing": ["error", { "before": true, "after": true }],
  47. "handle-callback-err": ["error", "^(err|error)$" ],
  48. "indent": ["error", 2, {
  49. "SwitchCase": 1,
  50. "VariableDeclarator": 1,
  51. "outerIIFEBody": 1,
  52. "MemberExpression": 1,
  53. "FunctionDeclaration": { "parameters": 1, "body": 1 },
  54. "FunctionExpression": { "parameters": 1, "body": 1 },
  55. "CallExpression": { "arguments": 1 },
  56. "ArrayExpression": 1,
  57. "ObjectExpression": 1,
  58. "ImportDeclaration": 1,
  59. "flatTernaryExpressions": false,
  60. "ignoreComments": false
  61. }],
  62. "key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
  63. "keyword-spacing": ["error", { "before": true, "after": true }],
  64. "new-cap": ["error", { "newIsCap": true, "capIsNew": false }],
  65. "new-parens": "error",
  66. "no-array-constructor": "error",
  67. "no-caller": "error",
  68. "no-class-assign": "error",
  69. "no-compare-neg-zero": "error",
  70. "no-cond-assign": "error",
  71. "no-const-assign": "error",
  72. "no-constant-condition": ["error", { "checkLoops": false }],
  73. "no-control-regex": "error",
  74. "no-debugger": "error",
  75. "no-delete-var": "error",
  76. "no-dupe-args": "error",
  77. "no-dupe-class-members": "error",
  78. "no-dupe-keys": "error",
  79. "no-duplicate-case": "error",
  80. "no-empty-character-class": "error",
  81. "no-empty-pattern": "error",
  82. "no-eval": "error",
  83. "no-ex-assign": "error",
  84. "no-extend-native": "error",
  85. "no-extra-bind": "error",
  86. "no-extra-boolean-cast": "error",
  87. "no-extra-parens": ["error", "functions"],
  88. "no-fallthrough": "error",
  89. "no-floating-decimal": "error",
  90. "no-func-assign": "error",
  91. "no-global-assign": "error",
  92. "no-implied-eval": "error",
  93. "no-inner-declarations": ["error", "functions"],
  94. "no-invalid-regexp": "error",
  95. "no-irregular-whitespace": "error",
  96. "no-iterator": "error",
  97. "no-label-var": "error",
  98. "no-labels": ["error", { "allowLoop": false, "allowSwitch": false }],
  99. "no-lone-blocks": "error",
  100. "no-mixed-operators": ["error", {
  101. "groups": [
  102. ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
  103. ["&&", "||"],
  104. ["in", "instanceof"]
  105. ],
  106. "allowSamePrecedence": true
  107. }],
  108. "no-mixed-spaces-and-tabs": "error",
  109. "no-multi-spaces": "error",
  110. "no-multi-str": "error",
  111. "no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }],
  112. "no-negated-in-lhs": "error",
  113. "no-new": "error",
  114. "no-new-func": "error",
  115. "no-new-object": "error",
  116. "no-new-require": "error",
  117. "no-new-symbol": "error",
  118. "no-new-wrappers": "error",
  119. "no-obj-calls": "error",
  120. "no-octal": "error",
  121. "no-octal-escape": "error",
  122. "no-path-concat": "error",
  123. "no-proto": "error",
  124. "no-redeclare": "error",
  125. "no-regex-spaces": "error",
  126. "no-return-assign": ["error", "except-parens"],
  127. "no-return-await": "error",
  128. "no-self-assign": "error",
  129. "no-self-compare": "error",
  130. "no-sequences": "error",
  131. "no-shadow-restricted-names": "error",
  132. "no-sparse-arrays": "error",
  133. "no-tabs": "error",
  134. "no-template-curly-in-string": "error",
  135. "no-this-before-super": "error",
  136. "no-throw-literal": "error",
  137. "no-trailing-spaces": "error",
  138. "no-undef": "error",
  139. "no-undef-init": "error",
  140. "no-unexpected-multiline": "error",
  141. "no-unmodified-loop-condition": "error",
  142. "no-unneeded-ternary": ["error", { "defaultAssignment": false }],
  143. "no-unreachable": "error",
  144. "no-unsafe-finally": "error",
  145. "no-unsafe-negation": "error",
  146. "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true, "allowTaggedTemplates": true }],
  147. "no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }],
  148. "no-use-before-define": ["error", { "functions": false, "classes": false, "variables": false }],
  149. "no-useless-call": "error",
  150. "no-useless-computed-key": "error",
  151. "no-useless-constructor": "error",
  152. "no-useless-escape": "error",
  153. "no-useless-rename": "error",
  154. "no-useless-return": "error",
  155. "no-whitespace-before-property": "error",
  156. "no-with": "error",
  157. "object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }],
  158. "one-var": ["error", { "initialized": "never" }],
  159. "operator-linebreak": ["error", "after", { "overrides": { "?": "before", ":": "before" } }],
  160. "padded-blocks": ["error", { "blocks": "never", "switches": "never", "classes": "never" }],
  161. "prefer-promise-reject-errors": "error",
  162. "quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
  163. "rest-spread-spacing": ["error", "never"],
  164. "semi": ["error", "never"],
  165. "semi-spacing": ["error", { "before": false, "after": true }],
  166. "space-before-blocks": ["error", "always"],
  167. "space-before-function-paren": ["error", "always"],
  168. "space-in-parens": ["error", "never"],
  169. "space-infix-ops": "error",
  170. "space-unary-ops": ["error", { "words": true, "nonwords": false }],
  171. "spaced-comment": ["error", "always", {
  172. "line": { "markers": ["*package", "!", "/", ",", "="] },
  173. "block": { "balanced": true, "markers": ["*package", "!", ",", ":", "::", "flow-include"], "exceptions": ["*"] }
  174. }],
  175. "symbol-description": "error",
  176. "template-curly-spacing": ["error", "never"],
  177. "template-tag-spacing": ["error", "never"],
  178. "unicode-bom": ["error", "never"],
  179. "use-isnan": "error",
  180. "valid-typeof": ["error", { "requireStringLiterals": true }],
  181. "wrap-iife": ["error", "any", { "functionPrototypeMethods": true }],
  182. "yield-star-spacing": ["error", "both"],
  183. "yoda": ["error", "never"],
  184. "import/export": "error",
  185. "import/first": "error",
  186. "import/no-duplicates": "error",
  187. "import/no-webpack-loader-syntax": "error",
  188. "node/no-deprecated-api": "error",
  189. "node/process-exit-as-throw": "error",
  190. "promise/param-names": "error",
  191. "standard/array-bracket-even-spacing": ["error", "either"],
  192. "standard/computed-property-even-spacing": ["error", "even"],
  193. "standard/no-callback-literal": "error",
  194. "standard/object-curly-even-spacing": ["error", "either"]
  195. }
  196. }