eslintrc.json 9.0 KB

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