.eslintrc.yml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. settings:
  2. import/parsers:
  3. '@typescript-eslint/parser': ['.ts']
  4. import/resolver:
  5. typescript:
  6. project:
  7. - tsconfig.json
  8. - tabby-*/tsconfig.json
  9. node: true
  10. env:
  11. browser: true
  12. es6: true
  13. node: true
  14. commonjs: true
  15. overrides:
  16. - files: '*.mjs'
  17. plugins:
  18. - 'import'
  19. parserOptions:
  20. sourceType: module
  21. ecmaVersion: latest
  22. - files: '*.ts'
  23. parser: '@typescript-eslint/parser'
  24. parserOptions:
  25. project:
  26. - tsconfig.json
  27. - '*/tsconfig.typings.json'
  28. extends:
  29. - 'plugin:@typescript-eslint/all'
  30. - plugin:import/recommended
  31. - plugin:import/typescript
  32. plugins:
  33. - '@typescript-eslint'
  34. - import
  35. rules:
  36. '@typescript-eslint/semi':
  37. - error
  38. - never
  39. '@typescript-eslint/indent':
  40. - error
  41. - 4
  42. '@typescript-eslint/explicit-member-accessibility':
  43. - error
  44. - accessibility: no-public
  45. overrides:
  46. parameterProperties: explicit
  47. '@typescript-eslint/no-require-imports': off
  48. '@typescript-eslint/no-parameter-properties': off
  49. '@typescript-eslint/explicit-function-return-type': off
  50. '@typescript-eslint/no-explicit-any': off
  51. '@typescript-eslint/no-magic-numbers': off
  52. '@typescript-eslint/member-delimiter-style': off
  53. '@typescript-eslint/promise-function-async': off
  54. '@typescript-eslint/require-array-sort-compare': off
  55. '@typescript-eslint/no-floating-promises': off
  56. '@typescript-eslint/prefer-readonly': off
  57. '@typescript-eslint/require-await': off
  58. '@typescript-eslint/strict-boolean-expressions': off
  59. '@typescript-eslint/no-misused-promises':
  60. - error
  61. - checksVoidReturn: false
  62. '@typescript-eslint/typedef': off
  63. '@typescript-eslint/consistent-type-imports': off
  64. '@typescript-eslint/sort-type-union-intersection-members': off
  65. '@typescript-eslint/no-use-before-define':
  66. - error
  67. - classes: false
  68. no-duplicate-imports: error
  69. array-bracket-spacing:
  70. - error
  71. - never
  72. block-scoped-var: error
  73. brace-style: off
  74. '@typescript-eslint/brace-style':
  75. - error
  76. - 1tbs
  77. - allowSingleLine: true
  78. computed-property-spacing:
  79. - error
  80. - never
  81. comma-dangle: off
  82. '@typescript-eslint/comma-dangle':
  83. - error
  84. - always-multiline
  85. curly: error
  86. eol-last: error
  87. eqeqeq:
  88. - error
  89. - smart
  90. max-depth:
  91. - 1
  92. - 5
  93. max-statements:
  94. - 1
  95. - 80
  96. no-multiple-empty-lines: error
  97. no-mixed-spaces-and-tabs: error
  98. no-trailing-spaces: error
  99. '@typescript-eslint/no-unused-vars':
  100. - error
  101. - vars: all
  102. args: after-used
  103. argsIgnorePattern: ^_
  104. no-undef: error
  105. no-var: error
  106. object-curly-spacing: off
  107. '@typescript-eslint/object-curly-spacing':
  108. - error
  109. - always
  110. quote-props:
  111. - warn
  112. - as-needed
  113. - keywords: true
  114. numbers: true
  115. quotes: off
  116. '@typescript-eslint/quotes':
  117. - error
  118. - single
  119. - allowTemplateLiterals: true
  120. '@typescript-eslint/no-confusing-void-expression':
  121. - error
  122. - ignoreArrowShorthand: true
  123. '@typescript-eslint/no-non-null-assertion': off
  124. '@typescript-eslint/no-unnecessary-condition':
  125. - error
  126. - allowConstantLoopConditions: true
  127. '@typescript-eslint/restrict-template-expressions': off
  128. '@typescript-eslint/prefer-readonly-parameter-types': off
  129. '@typescript-eslint/no-unsafe-member-access': off
  130. '@typescript-eslint/no-unsafe-call': off
  131. '@typescript-eslint/no-unsafe-return': off
  132. '@typescript-eslint/no-unsafe-assignment': off
  133. '@typescript-eslint/naming-convention': off
  134. '@typescript-eslint/lines-between-class-members':
  135. - error
  136. - always
  137. - exceptAfterSingleLine: true
  138. '@typescript-eslint/dot-notation': off
  139. '@typescript-eslint/no-implicit-any-catch': off
  140. '@typescript-eslint/member-ordering': off
  141. '@typescript-eslint/no-var-requires': off
  142. '@typescript-eslint/no-unsafe-argument': off
  143. '@typescript-eslint/restrict-plus-operands': off
  144. '@typescript-eslint/space-infix-ops': off
  145. '@typescript-eslint/no-type-alias':
  146. - error
  147. - allowAliases: in-unions-and-intersections
  148. allowLiterals: always
  149. allowCallbacks: always
  150. '@typescript-eslint/sort-type-constituents': off
  151. '@typescript-eslint/parameter-properties':
  152. - error
  153. - prefer: parameter-property
  154. 'import/no-named-as-default-member': off
  155. '@typescript-eslint/consistent-type-exports': off
  156. '@typescript-eslint/consistent-generic-constructors': off
  157. 'keyword-spacing': off
  158. '@typescript-eslint/keyword-spacing': off
  159. '@typescript-eslint/class-methods-use-this': off
  160. '@typescript-eslint/lines-around-comment': off
  161. '@typescript-eslint/no-redundant-type-constituents': off # broken