.eslintrc.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. module.exports = {
  2. env: {
  3. browser: true,
  4. node: true,
  5. },
  6. extends: [
  7. 'prettier',
  8. 'eslint:recommended',
  9. 'plugin:@typescript-eslint/recommended',
  10. ],
  11. parser: '@typescript-eslint/parser',
  12. parserOptions: {
  13. project: 'tsconfig.json',
  14. sourceType: 'module',
  15. },
  16. plugins: [
  17. 'eslint-plugin-import',
  18. 'eslint-plugin-jsdoc',
  19. '@typescript-eslint',
  20. ],
  21. root: true,
  22. rules: {
  23. '@typescript-eslint/await-thenable': 'error',
  24. '@typescript-eslint/consistent-type-assertions': 'error',
  25. '@typescript-eslint/member-delimiter-style': [
  26. 'error',
  27. {
  28. multiline: {
  29. delimiter: 'none',
  30. requireLast: true,
  31. },
  32. singleline: {
  33. delimiter: 'semi',
  34. requireLast: false,
  35. },
  36. },
  37. ],
  38. '@typescript-eslint/naming-convention': 'off',
  39. '@typescript-eslint/no-empty-function': 'error',
  40. '@typescript-eslint/no-extra-semi': 'off',
  41. '@typescript-eslint/no-explicit-any': 'error',
  42. '@typescript-eslint/no-floating-promises': 'error',
  43. '@typescript-eslint/no-misused-new': 'error',
  44. '@typescript-eslint/no-unnecessary-qualifier': 'error',
  45. '@typescript-eslint/no-unnecessary-type-assertion': 'error',
  46. '@typescript-eslint/no-unused-expressions': [
  47. 'error',
  48. {
  49. allowTaggedTemplates: true,
  50. allowShortCircuit: true,
  51. },
  52. ],
  53. '@typescript-eslint/prefer-namespace-keyword': 'error',
  54. '@typescript-eslint/quotes': [
  55. 'error',
  56. 'single',
  57. {
  58. avoidEscape: true,
  59. },
  60. ],
  61. '@typescript-eslint/semi': 'off',
  62. '@typescript-eslint/triple-slash-reference': [
  63. 'error',
  64. {
  65. path: 'always',
  66. types: 'prefer-import',
  67. lib: 'always',
  68. },
  69. ],
  70. '@typescript-eslint/type-annotation-spacing': 'error',
  71. '@typescript-eslint/unified-signatures': 'error',
  72. 'brace-style': ['error', '1tbs'],
  73. 'comma-dangle': 'off',
  74. curly: ['error', 'multi-line'],
  75. 'eol-last': 'error',
  76. eqeqeq: ['error', 'smart'],
  77. 'id-denylist': [
  78. 'error',
  79. 'any',
  80. 'Number',
  81. 'String',
  82. 'string',
  83. 'Boolean',
  84. 'boolean',
  85. 'Undefined',
  86. 'undefined',
  87. ],
  88. 'id-match': 'error',
  89. 'import/no-deprecated': 'error',
  90. 'jsdoc/check-alignment': 'error',
  91. 'jsdoc/check-indentation': 'error',
  92. 'jsdoc/newline-after-description': 'error',
  93. 'new-parens': 'error',
  94. 'no-caller': 'error',
  95. 'no-case-declarations': 'off',
  96. 'no-cond-assign': 'error',
  97. 'no-constant-condition': 'error',
  98. 'no-control-regex': 'error',
  99. 'no-duplicate-imports': 'error',
  100. 'no-empty': 'error',
  101. 'no-empty-function': 'error',
  102. 'no-eval': 'error',
  103. 'no-fallthrough': 'error',
  104. 'no-invalid-regexp': 'error',
  105. 'no-multiple-empty-lines': 'error',
  106. 'no-redeclare': 'error',
  107. 'no-regex-spaces': 'error',
  108. 'no-return-await': 'error',
  109. 'no-throw-literal': 'error',
  110. 'no-trailing-spaces': 'error',
  111. 'no-underscore-dangle': 'off',
  112. 'no-unexpected-multiline': 'off',
  113. 'no-unused-expressions': 'off',
  114. 'no-unused-labels': 'error',
  115. 'no-var': 'error',
  116. 'one-var': ['error', 'never'],
  117. quotes: 'off',
  118. radix: 'error',
  119. semi: 'off',
  120. 'space-in-parens': ['error', 'never'],
  121. 'spaced-comment': [
  122. 'error',
  123. 'always',
  124. {
  125. markers: ['/'],
  126. },
  127. ],
  128. 'use-isnan': 'error',
  129. },
  130. overrides: [
  131. {
  132. files: ['*.test.*'],
  133. rules: {
  134. '@typescript-eslint/no-unused-expressions': 'off',
  135. },
  136. },
  137. ],
  138. }