.eslintrc.js 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. module.exports = {
  2. env: {
  3. browser: true,
  4. es6: true,
  5. commonjs: true
  6. },
  7. root: true,
  8. extends: [
  9. 'eslint:recommended',
  10. 'plugin:@typescript-eslint/eslint-recommended',
  11. 'plugin:@typescript-eslint/recommended',
  12. 'prettier/@typescript-eslint',
  13. 'plugin:react/recommended'
  14. ],
  15. parser: '@typescript-eslint/parser',
  16. parserOptions: {
  17. project: 'tsconfig.eslint.json'
  18. },
  19. plugins: ['@typescript-eslint'],
  20. rules: {
  21. indent: ['error', 2],
  22. 'linebreak-style': ['error', 'unix'],
  23. 'no-console': [
  24. 'error',
  25. {
  26. allow: ['error', 'warn', 'debug']
  27. }
  28. ],
  29. 'arrow-body-style': [0],
  30. curly: 'error',
  31. 'lines-around-comment': [0],
  32. 'max-len': 'off',
  33. 'no-confusing-arrow': [0],
  34. 'no-mixed-operators': [0],
  35. 'no-tabs': [0],
  36. 'no-unexpected-multiline': [0],
  37. 'prefer-arrow-callback': [0],
  38. quotes: [0],
  39. 'array-bracket-newline': ['off'],
  40. 'array-bracket-spacing': ['off'],
  41. 'array-element-newline': ['off'],
  42. 'arrow-parens': ['off'],
  43. 'arrow-spacing': ['off'],
  44. 'block-spacing': ['off'],
  45. 'brace-style': ['off'],
  46. 'comma-dangle': 'off',
  47. 'comma-spacing': ['off'],
  48. 'comma-style': ['off'],
  49. 'computed-property-spacing': ['off'],
  50. 'dot-location': ['off'],
  51. 'eol-last': 'error',
  52. 'func-call-spacing': ['off'],
  53. 'function-call-argument-newline': ['off'],
  54. 'function-paren-newline': ['off'],
  55. 'generator-star': ['off'],
  56. 'generator-star-spacing': ['off'],
  57. 'implicit-arrow-linebreak': ['off'],
  58. 'jsx-quotes': ['off'],
  59. 'key-spacing': ['off'],
  60. 'keyword-spacing': ['off'],
  61. 'multiline-ternary': ['off'],
  62. 'newline-per-chained-call': ['off'],
  63. 'new-parens': 'error',
  64. 'no-arrow-condition': ['off'],
  65. 'no-comma-dangle': ['off'],
  66. 'no-extra-parens': ['off'],
  67. 'no-extra-semi': ['off'],
  68. 'no-floating-decimal': ['off'],
  69. 'no-mixed-spaces-and-tabs': ['off'],
  70. 'no-multi-spaces': ['off'],
  71. 'no-multiple-empty-lines': 'off',
  72. 'no-reserved-keys': ['off'],
  73. 'no-space-before-semi': ['off'],
  74. 'no-trailing-spaces': 'error',
  75. 'no-whitespace-before-property': ['off'],
  76. 'no-wrap-func': ['off'],
  77. 'nonblock-statement-body-position': ['off'],
  78. 'object-curly-newline': ['off'],
  79. 'object-curly-spacing': ['off'],
  80. 'object-property-newline': ['off'],
  81. 'one-var-declaration-per-line': ['off'],
  82. 'operator-linebreak': ['off'],
  83. 'padded-blocks': ['off'],
  84. 'quote-props': ['off'],
  85. 'rest-spread-spacing': ['off'],
  86. semi: ['off'],
  87. 'semi-spacing': ['off'],
  88. 'semi-style': ['off'],
  89. 'space-after-function-name': ['off'],
  90. 'space-after-keywords': ['off'],
  91. 'space-before-blocks': ['off'],
  92. 'space-before-function-paren': ['off'],
  93. 'space-before-function-parentheses': ['off'],
  94. 'space-before-keywords': ['off'],
  95. 'space-in-brackets': ['off'],
  96. 'space-in-parens': ['off'],
  97. 'space-infix-ops': ['off'],
  98. 'space-return-throw-case': ['off'],
  99. 'space-unary-ops': ['off'],
  100. 'space-unary-word-ops': ['off'],
  101. 'switch-colon-spacing': ['off'],
  102. 'template-curly-spacing': ['off'],
  103. 'template-tag-spacing': ['off'],
  104. 'unicode-bom': ['off'],
  105. 'wrap-iife': ['off'],
  106. 'wrap-regex': ['off'],
  107. 'yield-star-spacing': ['off'],
  108. 'indent-legacy': ['off'],
  109. 'no-spaced-func': ['off'],
  110. 'constructor-super': ['error'],
  111. 'for-direction': ['error'],
  112. 'getter-return': ['error'],
  113. 'no-async-promise-executor': ['error'],
  114. 'no-case-declarations': ['off'],
  115. 'no-class-assign': ['error'],
  116. 'no-compare-neg-zero': ['error'],
  117. 'no-cond-assign': 'error',
  118. 'no-const-assign': ['error'],
  119. 'no-constant-condition': ['error'],
  120. 'no-control-regex': ['off'],
  121. 'no-debugger': 'error',
  122. 'no-delete-var': ['error'],
  123. 'no-dupe-args': ['error'],
  124. 'no-dupe-class-members': ['error'],
  125. 'no-dupe-keys': ['error'],
  126. 'no-duplicate-case': ['error'],
  127. 'no-empty': 'error',
  128. 'no-empty-character-class': ['error'],
  129. 'no-empty-pattern': ['error'],
  130. 'no-ex-assign': ['error'],
  131. 'no-extra-boolean-cast': ['error'],
  132. 'no-fallthrough': 'error',
  133. 'no-func-assign': ['error'],
  134. 'no-global-assign': ['error'],
  135. 'no-inner-declarations': ['off'],
  136. 'no-invalid-regexp': ['error'],
  137. 'no-irregular-whitespace': ['error'],
  138. 'no-misleading-character-class': ['error'],
  139. 'no-new-symbol': ['error'],
  140. 'no-obj-calls': ['error'],
  141. 'no-octal': ['error'],
  142. 'no-prototype-builtins': ['off'],
  143. 'no-redeclare': 'warn',
  144. 'no-regex-spaces': ['error'],
  145. 'no-self-assign': ['error'],
  146. 'no-shadow-restricted-names': ['error'],
  147. 'no-sparse-arrays': ['error'],
  148. 'no-this-before-super': ['error'],
  149. 'no-unreachable': ['error'],
  150. 'no-unsafe-finally': ['error'],
  151. 'no-unsafe-negation': ['error'],
  152. 'no-unused-labels': 'error',
  153. '@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
  154. '@typescript-eslint/no-namespace': 'off',
  155. 'no-useless-catch': ['error'],
  156. 'no-useless-escape': ['off'],
  157. 'no-with': ['error'],
  158. 'require-yield': ['error'],
  159. 'use-isnan': 'error',
  160. 'valid-typeof': ['error'],
  161. '@typescript-eslint/class-name-casing': 'error',
  162. '@typescript-eslint/consistent-type-assertions': 'error',
  163. '@typescript-eslint/explicit-member-accessibility': [
  164. 'off',
  165. {
  166. accessibility: 'explicit'
  167. }
  168. ],
  169. '@typescript-eslint/indent': [
  170. 'error',
  171. 2,
  172. {
  173. FunctionDeclaration: {
  174. parameters: 'first'
  175. },
  176. FunctionExpression: {
  177. parameters: 'first'
  178. }
  179. }
  180. ],
  181. '@typescript-eslint/interface-name-prefix': [
  182. 'error',
  183. { prefixWithI: 'always' }
  184. ],
  185. '@typescript-eslint/member-delimiter-style': [
  186. 'error',
  187. {
  188. multiline: {
  189. delimiter: 'semi',
  190. requireLast: true
  191. },
  192. singleline: {
  193. delimiter: 'semi',
  194. requireLast: false
  195. }
  196. }
  197. ],
  198. '@typescript-eslint/ban-ts-ignore': 'off',
  199. '@typescript-eslint/member-ordering': 'off',
  200. '@typescript-eslint/no-empty-function': 'error',
  201. '@typescript-eslint/no-explicit-any': 'off',
  202. '@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
  203. '@typescript-eslint/no-inferrable-types': 'off',
  204. '@typescript-eslint/no-require-imports': 'off',
  205. '@typescript-eslint/no-use-before-define': 'off',
  206. '@typescript-eslint/no-var-requires': 'off',
  207. '@typescript-eslint/prefer-namespace-keyword': 'error',
  208. '@typescript-eslint/explicit-function-return-type': 'off',
  209. '@typescript-eslint/quotes': [
  210. 'off',
  211. 'single',
  212. {
  213. avoidEscape: true
  214. }
  215. ],
  216. '@typescript-eslint/semi': ['error', 'always'],
  217. '@typescript-eslint/triple-slash-reference': 'off',
  218. '@typescript-eslint/type-annotation-spacing': 'off',
  219. '@typescript-eslint/no-empty-interface': 'off',
  220. '@typescript-eslint/camelcase': 'off',
  221. 'default-case': 'error',
  222. 'dot-notation': 'off',
  223. 'no-undef': 'off',
  224. 'prefer-const': 'off',
  225. eqeqeq: ['error', 'smart'],
  226. 'guard-for-in': 'off',
  227. 'id-blacklist': ['error', 'any', 'boolean', 'Undefined'],
  228. 'id-match': 'error',
  229. 'import/no-default-export': 'off',
  230. 'no-bitwise': 'off',
  231. 'no-caller': 'error',
  232. 'no-eval': 'error',
  233. 'no-invalid-this': 'off',
  234. 'no-new-wrappers': 'error',
  235. 'no-null/no-null': 'off',
  236. 'no-shadow': [
  237. 'off',
  238. {
  239. hoist: 'all'
  240. }
  241. ],
  242. 'no-underscore-dangle': 'off',
  243. 'no-var': 'error',
  244. 'one-var': ['error', 'never'],
  245. radix: 'error',
  246. '@typescript-eslint/no-non-null-assertion': 'off'
  247. },
  248. settings: {}
  249. };