.eslintrc.json 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. {
  2. "extends": [
  3. "eslint:recommended"
  4. ],
  5. "ignorePatterns": [
  6. "docs",
  7. "tools",
  8. "dist",
  9. "website.js",
  10. "test/files/*",
  11. "benchmarks"
  12. ],
  13. "overrides": [
  14. {
  15. "files": [
  16. "**/*.{ts,tsx}"
  17. ],
  18. "extends": [
  19. "plugin:@typescript-eslint/eslint-recommended",
  20. "plugin:@typescript-eslint/recommended"
  21. ],
  22. "plugins": [
  23. "@typescript-eslint"
  24. ],
  25. "rules": {
  26. "@typescript-eslint/triple-slash-reference": "off",
  27. "@typescript-eslint/no-non-null-assertion": "off",
  28. "spaced-comment": [
  29. "error",
  30. "always",
  31. {
  32. "block": {
  33. "markers": [
  34. "!"
  35. ],
  36. "balanced": true
  37. },
  38. "markers": [
  39. "/"
  40. ]
  41. }
  42. ],
  43. "@typescript-eslint/no-explicit-any": "off",
  44. "@typescript-eslint/ban-types": "off",
  45. "@typescript-eslint/no-unused-vars": "off",
  46. "@typescript-eslint/explicit-module-boundary-types": "off",
  47. "@typescript-eslint/indent": [
  48. "error",
  49. 2,
  50. {
  51. "SwitchCase": 1
  52. }
  53. ],
  54. "@typescript-eslint/prefer-optional-chain": "error",
  55. "@typescript-eslint/brace-style": "error",
  56. "@typescript-eslint/no-dupe-class-members": "error",
  57. "@typescript-eslint/no-redeclare": "error",
  58. "@typescript-eslint/type-annotation-spacing": "error",
  59. "@typescript-eslint/object-curly-spacing": [
  60. "error",
  61. "always"
  62. ],
  63. "@typescript-eslint/semi": "error",
  64. "@typescript-eslint/space-before-function-paren": [
  65. "error",
  66. "never"
  67. ],
  68. "@typescript-eslint/space-infix-ops": "off"
  69. }
  70. }
  71. ],
  72. "plugins": [
  73. "mocha-no-only"
  74. ],
  75. "parserOptions": {
  76. "ecmaVersion": 2020
  77. },
  78. "env": {
  79. "node": true,
  80. "es6": true
  81. },
  82. "rules": {
  83. "comma-style": "error",
  84. "indent": [
  85. "error",
  86. 2,
  87. {
  88. "SwitchCase": 1,
  89. "VariableDeclarator": 2
  90. }
  91. ],
  92. "keyword-spacing": "error",
  93. "no-whitespace-before-property": "error",
  94. "no-buffer-constructor": "warn",
  95. "no-console": "off",
  96. "no-constant-condition": "off",
  97. "no-multi-spaces": "error",
  98. "func-call-spacing": "error",
  99. "no-trailing-spaces": "error",
  100. "no-undef": "error",
  101. "no-unneeded-ternary": "error",
  102. "no-const-assign": "error",
  103. "no-useless-rename": "error",
  104. "no-dupe-keys": "error",
  105. "space-in-parens": [
  106. "error",
  107. "never"
  108. ],
  109. "spaced-comment": [
  110. "error",
  111. "always",
  112. {
  113. "block": {
  114. "markers": [
  115. "!"
  116. ],
  117. "balanced": true
  118. }
  119. }
  120. ],
  121. "key-spacing": [
  122. "error",
  123. {
  124. "beforeColon": false,
  125. "afterColon": true
  126. }
  127. ],
  128. "comma-spacing": [
  129. "error",
  130. {
  131. "before": false,
  132. "after": true
  133. }
  134. ],
  135. "array-bracket-spacing": 1,
  136. "arrow-spacing": [
  137. "error",
  138. {
  139. "before": true,
  140. "after": true
  141. }
  142. ],
  143. "object-curly-spacing": [
  144. "error",
  145. "always"
  146. ],
  147. "comma-dangle": [
  148. "error",
  149. "never"
  150. ],
  151. "no-unreachable": "error",
  152. "quotes": [
  153. "error",
  154. "single"
  155. ],
  156. "quote-props": [
  157. "error",
  158. "as-needed"
  159. ],
  160. "semi": "error",
  161. "no-extra-semi": "error",
  162. "semi-spacing": "error",
  163. "no-spaced-func": "error",
  164. "no-throw-literal": "error",
  165. "space-before-blocks": "error",
  166. "space-before-function-paren": [
  167. "error",
  168. "never"
  169. ],
  170. "space-infix-ops": "error",
  171. "space-unary-ops": "error",
  172. "no-var": "warn",
  173. "prefer-const": "warn",
  174. "strict": [
  175. "error",
  176. "global"
  177. ],
  178. "no-restricted-globals": [
  179. "error",
  180. {
  181. "name": "context",
  182. "message": "Don't use Mocha's global context"
  183. }
  184. ],
  185. "no-prototype-builtins": "off",
  186. "mocha-no-only/mocha-no-only": [
  187. "error"
  188. ],
  189. "no-empty": "off",
  190. "eol-last": "warn"
  191. }
  192. }