.eslintrc.json 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. {
  2. "env": {
  3. "es6": true,
  4. "node": true
  5. },
  6. "extends": [
  7. "eslint:recommended",
  8. "plugin:@typescript-eslint/recommended",
  9. "plugin:@typescript-eslint/recommended-requiring-type-checking",
  10. "plugin:@typescript-eslint/eslint-recommended",
  11. "plugin:import/errors",
  12. "plugin:import/warnings",
  13. "plugin:import/typescript",
  14. "prettier"
  15. ],
  16. "parser": "@typescript-eslint/parser",
  17. "parserOptions": {
  18. "ecmaVersion": 2018,
  19. "sourceType": "module",
  20. "ecmaFeatures": {
  21. "impliedStrict": true,
  22. "jsx": true
  23. },
  24. "project": "tsconfig.json",
  25. "extraFileExtensions": [
  26. ".ts",
  27. ".tsx"
  28. ]
  29. },
  30. "plugins": [
  31. "import",
  32. "@typescript-eslint"
  33. ],
  34. "rules": {
  35. "no-prototype-builtins": "off",
  36. "@typescript-eslint/explicit-module-boundary-types": "off",
  37. "arrow-parens": [
  38. "off"
  39. ],
  40. "brace-style": [
  41. "off",
  42. "stroustrup"
  43. ],
  44. "consistent-return": "off",
  45. "camelcase": "off",
  46. "@typescript-eslint/camelcase": "off",
  47. "curly": [
  48. "error",
  49. "multi-line",
  50. "consistent"
  51. ],
  52. "eol-last": "error",
  53. "linebreak-style": [
  54. "error",
  55. "unix"
  56. ],
  57. "new-parens": "error",
  58. "no-console": "off",
  59. "no-constant-condition": [
  60. "warn",
  61. {
  62. "checkLoops": false
  63. }
  64. ],
  65. "no-caller": "error",
  66. "no-debugger": "warn",
  67. "no-dupe-class-members": "off",
  68. "no-duplicate-imports": "error",
  69. "no-else-return": "warn",
  70. "no-empty": [
  71. "warn",
  72. {
  73. "allowEmptyCatch": true
  74. }
  75. ],
  76. "no-eval": "error",
  77. "no-ex-assign": "warn",
  78. "no-extend-native": "error",
  79. "no-extra-bind": "error",
  80. "no-floating-decimal": "error",
  81. "no-implicit-coercion": "error",
  82. "no-implied-eval": "error",
  83. // Turn off until fix for: https://github.com/typescript-eslint/typescript-eslint/issues/239
  84. "no-inner-declarations": "off",
  85. "no-lone-blocks": "error",
  86. "no-lonely-if": "error",
  87. "no-loop-func": "error",
  88. "no-multi-spaces": "error",
  89. "no-return-assign": "error",
  90. "no-return-await": "warn",
  91. "no-self-compare": "error",
  92. "no-sequences": "error",
  93. "no-template-curly-in-string": "warn",
  94. "no-throw-literal": "error",
  95. "no-unmodified-loop-condition": "warn",
  96. "no-unneeded-ternary": "error",
  97. "no-unused-expressions": [
  98. "warn",
  99. {
  100. "allowShortCircuit": true
  101. }
  102. ],
  103. "no-use-before-define": "off",
  104. "no-useless-call": "error",
  105. "no-useless-catch": "error",
  106. "no-useless-computed-key": "error",
  107. "no-useless-concat": "error",
  108. "no-useless-rename": "error",
  109. "no-useless-return": "error",
  110. "no-var": "error",
  111. "no-with": "error",
  112. "object-shorthand": "off",
  113. "one-var": [
  114. "error",
  115. "never"
  116. ],
  117. "prefer-arrow-callback": "error",
  118. "prefer-const": "error",
  119. "prefer-numeric-literals": "error",
  120. "prefer-object-spread": "error",
  121. "prefer-rest-params": "error",
  122. "prefer-spread": "error",
  123. "prefer-template": "error",
  124. "quotes": "off",
  125. // Turn off until fix for: https://github.com/eslint/eslint/issues/11899
  126. "require-atomic-updates": "off",
  127. "semi": [
  128. "error",
  129. "always"
  130. ],
  131. "semi-style": [
  132. "error",
  133. "last"
  134. ],
  135. "sort-imports": [
  136. "error",
  137. {
  138. "ignoreCase": true,
  139. "ignoreDeclarationSort": true,
  140. "ignoreMemberSort": false,
  141. "memberSyntaxSortOrder": [
  142. "none",
  143. "all",
  144. "multiple",
  145. "single"
  146. ]
  147. }
  148. ],
  149. "yoda": "error",
  150. "import/export": "off",
  151. "import/extensions": [
  152. "error",
  153. "never"
  154. ],
  155. "import/named": "off",
  156. "import/namespace": "off",
  157. "import/newline-after-import": "warn",
  158. "import/no-cycle": "off",
  159. "import/no-dynamic-require": "error",
  160. "import/no-default-export": "off",
  161. "import/no-duplicates": "error",
  162. "import/no-self-import": "error",
  163. "import/no-unresolved": [
  164. "warn",
  165. {
  166. "ignore": [
  167. "vscode"
  168. ]
  169. }
  170. ],
  171. "import/order": [
  172. "warn",
  173. {
  174. "groups": [
  175. "builtin",
  176. "external",
  177. "internal",
  178. [
  179. "index",
  180. "sibling",
  181. "parent"
  182. ]
  183. ]
  184. }
  185. ],
  186. "@typescript-eslint/require-await": "off",
  187. "@typescript-eslint/consistent-type-assertions": "off",
  188. "@typescript-eslint/explicit-function-return-type": "off",
  189. "@typescript-eslint/explicit-member-accessibility": "error",
  190. "@typescript-eslint/interface-name-prefix": "off",
  191. "@typescript-eslint/no-empty-function": [
  192. "warn",
  193. {
  194. "allow": [
  195. "constructors"
  196. ]
  197. }
  198. ],
  199. "@typescript-eslint/no-empty-interface": "off",
  200. "@typescript-eslint/no-explicit-any": "error",
  201. "@typescript-eslint/no-inferrable-types": [
  202. "warn",
  203. {
  204. "ignoreParameters": true,
  205. "ignoreProperties": true
  206. }
  207. ],
  208. "@typescript-eslint/no-misused-promises": [
  209. "error",
  210. {
  211. "checksVoidReturn": false
  212. }
  213. ],
  214. "@typescript-eslint/no-namespace": "off",
  215. "@typescript-eslint/no-non-null-assertion": "off",
  216. "@typescript-eslint/no-parameter-properties": "off",
  217. "@typescript-eslint/no-unused-vars": [
  218. "warn",
  219. {
  220. "args": "none"
  221. }
  222. ],
  223. "@typescript-eslint/no-use-before-define": "off",
  224. "@typescript-eslint/unbound-method": "off" // Too many bugs right now: https://github.com/typescript-eslint/typescript-eslint/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+unbound-method
  225. }
  226. }