.eslintrc.json 3.6 KB

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