xo 0.50.0 → 0.52.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (365) hide show
  1. package/cli.js +1 -1
  2. package/index.js +7 -2
  3. package/lib/options-manager.js +89 -6
  4. package/lib/report.js +3 -1
  5. package/node_modules/@typescript-eslint/eslint-plugin/README.md +2 -146
  6. package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js +1 -0
  7. package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js.map +1 -1
  8. package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict.js +1 -0
  9. package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict.js.map +1 -1
  10. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js +21 -8
  11. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js.map +1 -1
  12. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js +37 -31
  13. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js.map +1 -1
  14. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js +10 -10
  15. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js.map +1 -1
  16. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.js +100 -0
  17. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.js.map +1 -0
  18. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style.js +1 -1
  19. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style.js.map +1 -1
  20. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js +14 -8
  21. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js.map +1 -1
  22. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js +133 -43
  23. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js.map +1 -1
  24. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js +12 -1
  25. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js.map +1 -1
  26. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js +2 -0
  27. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js.map +1 -1
  28. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js +9 -2
  29. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map +1 -1
  30. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js +1 -1
  31. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js.map +1 -1
  32. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-enum-values.js +1 -1
  33. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-enum-values.js.map +1 -1
  34. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js +0 -1
  35. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js.map +1 -1
  36. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js +2 -1
  37. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js.map +1 -1
  38. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js +8 -2
  39. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js.map +1 -1
  40. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js +4 -0
  41. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js.map +1 -1
  42. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js +8 -3
  43. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map +1 -1
  44. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js +1 -1
  45. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js.map +1 -1
  46. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js +9 -1
  47. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js.map +1 -1
  48. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.js +0 -1
  49. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.js.map +1 -1
  50. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js +2 -0
  51. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js.map +1 -1
  52. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js +0 -1
  53. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js.map +1 -1
  54. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js +0 -1
  55. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js.map +1 -1
  56. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js +38 -8
  57. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js.map +1 -1
  58. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js +2 -0
  59. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js.map +1 -1
  60. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js +8 -0
  61. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js.map +1 -1
  62. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js +2 -0
  63. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js.map +1 -1
  64. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js +2 -0
  65. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js.map +1 -1
  66. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js +1 -0
  67. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js.map +1 -1
  68. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js +3 -1
  69. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js.map +1 -1
  70. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js +1 -1
  71. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js.map +1 -1
  72. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js +4 -3
  73. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js.map +1 -1
  74. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js +42 -12
  75. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js.map +1 -1
  76. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js +6 -3
  77. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js.map +1 -1
  78. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.js +1 -2
  79. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.js.map +1 -1
  80. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js +0 -1
  81. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js.map +1 -1
  82. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/object-curly-spacing.js +1 -0
  83. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/object-curly-spacing.js.map +1 -1
  84. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/padding-line-between-statements.js +5 -5
  85. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/padding-line-between-statements.js.map +1 -1
  86. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js +31 -23
  87. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js.map +1 -1
  88. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js +5 -1
  89. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js.map +1 -1
  90. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js +0 -1
  91. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js.map +1 -1
  92. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js +133 -4
  93. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js.map +1 -1
  94. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js +166 -86
  95. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js.map +1 -1
  96. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js +2 -0
  97. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js.map +1 -1
  98. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js +1 -0
  99. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js.map +1 -1
  100. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js +1 -1
  101. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js.map +1 -1
  102. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js +2 -0
  103. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js.map +1 -1
  104. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js +20 -5
  105. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js.map +1 -1
  106. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js +1 -1
  107. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js.map +1 -1
  108. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members.js +3 -0
  109. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members.js.map +1 -1
  110. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-infix-ops.js +16 -30
  111. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/space-infix-ops.js.map +1 -1
  112. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js +0 -1
  113. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js.map +1 -1
  114. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js +3 -1
  115. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js.map +1 -1
  116. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js +1 -0
  117. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js.map +1 -1
  118. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js +1 -0
  119. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js.map +1 -1
  120. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js +3 -0
  121. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js.map +1 -1
  122. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.js +27 -0
  123. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.js.map +1 -0
  124. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.js +9 -0
  125. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.js.map +1 -0
  126. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.js +9 -0
  127. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.js.map +1 -0
  128. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/README.md +3 -138
  129. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/TEMPLATE.md +3 -30
  130. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md +6 -19
  131. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md +6 -25
  132. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md +6 -19
  133. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.md +30 -25
  134. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.md +6 -15
  135. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md +74 -99
  136. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md +6 -22
  137. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md +3 -1
  138. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.md +9 -5
  139. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md +10 -28
  140. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md +6 -22
  141. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-generic-constructors.md +73 -0
  142. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-indexed-object-style.md +19 -21
  143. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.md +9 -26
  144. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md +15 -22
  145. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-exports.md +9 -16
  146. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.md +9 -19
  147. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md +8 -24
  148. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md +10 -22
  149. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md +7 -33
  150. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md +7 -30
  151. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md +10 -47
  152. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md +6 -22
  153. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md +11 -23
  154. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md +6 -22
  155. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md +6 -22
  156. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md +8 -24
  157. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md +6 -2
  158. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md +34 -13
  159. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.md +6 -2
  160. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.md +6 -2
  161. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md +6 -22
  162. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.md +7 -11
  163. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md +6 -15
  164. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-void-expression.md +6 -42
  165. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md +6 -22
  166. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-enum-values.md +10 -19
  167. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-imports.md +8 -28
  168. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.md +6 -19
  169. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md +6 -29
  170. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md +6 -6
  171. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md +6 -22
  172. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md +6 -15
  173. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md +6 -22
  174. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md +6 -22
  175. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md +6 -28
  176. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md +6 -19
  177. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md +6 -21
  178. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implicit-any-catch.md +11 -20
  179. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.md +6 -18
  180. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md +11 -31
  181. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.md +6 -26
  182. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.md +6 -18
  183. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.md +6 -22
  184. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.md +6 -19
  185. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md +6 -24
  186. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-meaningless-void-operator.md +6 -2
  187. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md +6 -19
  188. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md +6 -2
  189. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md +10 -17
  190. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md +6 -15
  191. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md +6 -15
  192. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md +6 -19
  193. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md +11 -6
  194. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.md +6 -19
  195. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redundant-type-constituents.md +6 -15
  196. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md +6 -19
  197. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-imports.md +6 -13
  198. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.md +6 -19
  199. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md +24 -42
  200. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-throw-literal.md +25 -29
  201. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md +6 -18
  202. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md +6 -26
  203. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.md +6 -16
  204. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +6 -19
  205. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md +6 -19
  206. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +8 -8
  207. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +6 -15
  208. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-argument.md +6 -16
  209. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.md +6 -16
  210. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.md +6 -16
  211. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.md +6 -16
  212. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.md +6 -16
  213. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.md +6 -22
  214. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md +6 -22
  215. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md +6 -23
  216. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md +7 -23
  217. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-empty-export.md +6 -15
  218. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md +6 -19
  219. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md +6 -15
  220. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md +6 -22
  221. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/padding-line-between-statements.md +10 -31
  222. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/parameter-properties.md +6 -6
  223. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.md +6 -15
  224. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.md +6 -15
  225. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md +6 -19
  226. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md +6 -19
  227. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md +6 -15
  228. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md +6 -2
  229. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md +6 -19
  230. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md +48 -2
  231. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md +18 -17
  232. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md +6 -15
  233. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md +6 -8
  234. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md +6 -15
  235. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md +6 -15
  236. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-return-this-type.md +6 -15
  237. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +6 -16
  238. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.md +6 -15
  239. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md +6 -35
  240. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md +6 -22
  241. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md +6 -18
  242. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md +6 -20
  243. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md +6 -28
  244. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md +6 -27
  245. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.md +6 -12
  246. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md +6 -22
  247. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-union-intersection-members.md +6 -45
  248. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md +10 -22
  249. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md +6 -22
  250. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-infix-ops.md +7 -23
  251. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md +6 -26
  252. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +6 -15
  253. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md +9 -24
  254. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md +8 -18
  255. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.md +12 -32
  256. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md +7 -27
  257. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md +11 -21
  258. package/node_modules/@typescript-eslint/eslint-plugin/package.json +5 -5
  259. package/node_modules/@typescript-eslint/parser/README.md +1 -1
  260. package/node_modules/@typescript-eslint/parser/package.json +6 -5
  261. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts +2 -0
  262. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts.map +1 -1
  263. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js +12 -4
  264. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js.map +1 -1
  265. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts +1 -0
  266. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts.map +1 -1
  267. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js +4 -0
  268. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js.map +1 -1
  269. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts.map +1 -1
  270. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js +13 -7
  271. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js.map +1 -1
  272. package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts +1 -1
  273. package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts.map +1 -1
  274. package/node_modules/@typescript-eslint/scope-manager/package.json +5 -5
  275. package/node_modules/@typescript-eslint/type-utils/package.json +4 -4
  276. package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts +22 -20
  277. package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map +1 -1
  278. package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js.map +1 -1
  279. package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts +1 -0
  280. package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map +1 -1
  281. package/node_modules/@typescript-eslint/types/package.json +3 -2
  282. package/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts.map +1 -1
  283. package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js +9 -2
  284. package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map +1 -1
  285. package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts +3 -0
  286. package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts.map +1 -1
  287. package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js +21 -1
  288. package/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js.map +1 -1
  289. package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts +1 -1
  290. package/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts.map +1 -1
  291. package/node_modules/@typescript-eslint/typescript-estree/package.json +6 -5
  292. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.d.ts.map +1 -1
  293. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js +2 -1
  294. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js.map +1 -1
  295. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.d.ts.map +1 -1
  296. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js +3 -4
  297. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js.map +1 -1
  298. package/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts +4 -0
  299. package/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts.map +1 -1
  300. package/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.d.ts +1 -1
  301. package/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.d.ts.map +1 -1
  302. package/node_modules/@typescript-eslint/utils/package.json +5 -5
  303. package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js +1 -1
  304. package/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js.map +1 -1
  305. package/node_modules/@typescript-eslint/visitor-keys/package.json +4 -3
  306. package/node_modules/eslint-config-xo-typescript/index.js +27 -11
  307. package/node_modules/eslint-config-xo-typescript/package.json +5 -4
  308. package/package.json +10 -10
  309. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/containsAllTypesByName.d.ts +0 -8
  310. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getConstrainedTypeAtLocation.d.ts +0 -6
  311. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getContextualType.d.ts +0 -8
  312. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getDeclaration.d.ts +0 -6
  313. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getSourceFileOfNode.d.ts +0 -6
  314. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTokenAtPosition.d.ts +0 -3
  315. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTypeArguments.d.ts +0 -3
  316. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTypeName.d.ts +0 -8
  317. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/index.d.ts +0 -15
  318. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/isTypeReadonly.d.ts +0 -20
  319. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/isUnsafeAssignment.d.ts +0 -17
  320. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/predicates.d.ts +0 -52
  321. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/propertyTypes.d.ts +0 -4
  322. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/requiresQuoting.d.ts +0 -4
  323. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/typeFlagUtils.d.ts +0 -11
  324. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/PatternMatcher.d.ts +0 -48
  325. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts +0 -76
  326. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/astUtilities.d.ts +0 -76
  327. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/index.d.ts +0 -6
  328. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/predicates.d.ts +0 -32
  329. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts +0 -18
  330. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/helpers.d.ts +0 -47
  331. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/index.d.ts +0 -5
  332. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/misc.d.ts +0 -8
  333. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/predicates.d.ts +0 -180
  334. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/InferTypesFromRule.d.ts +0 -11
  335. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/RuleCreator.d.ts +0 -35
  336. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/RuleTester.d.ts +0 -18
  337. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/applyDefault.d.ts +0 -10
  338. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/batchedSingleLineTests.d.ts +0 -24
  339. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/deepMerge.d.ts +0 -17
  340. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/getParserServices.d.ts +0 -8
  341. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/index.d.ts +0 -9
  342. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/nullThrows.d.ts +0 -14
  343. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/index.d.ts +0 -8
  344. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/json-schema.d.ts +0 -2
  345. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/AST.d.ts +0 -9
  346. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/CLIEngine.d.ts +0 -137
  347. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/ESLint.d.ts +0 -376
  348. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Linter.d.ts +0 -326
  349. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/ParserOptions.d.ts +0 -2
  350. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Rule.d.ts +0 -389
  351. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/RuleTester.d.ts +0 -154
  352. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Scope.d.ts +0 -44
  353. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/SourceCode.d.ts +0 -342
  354. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/index.d.ts +0 -10
  355. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Definition.d.ts +0 -19
  356. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Options.d.ts +0 -15
  357. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/PatternVisitor.d.ts +0 -25
  358. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Reference.d.ts +0 -28
  359. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Referencer.d.ts +0 -55
  360. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Scope.d.ts +0 -103
  361. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/ScopeManager.d.ts +0 -50
  362. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Variable.d.ts +0 -17
  363. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/analyze.d.ts +0 -16
  364. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/index.d.ts +0 -11
  365. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-estree.d.ts +0 -3
@@ -1,6 +1,10 @@
1
- # `consistent-type-definitions`
1
+ ---
2
+ description: 'Enforce type definitions to consistently use either `interface` or `type`.'
3
+ ---
2
4
 
3
- Enforces type definitions to consistently use either `interface` or `type`.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/consistent-type-definitions** for documentation.
4
8
 
5
9
  There are two ways to define a type.
6
10
 
@@ -20,35 +24,26 @@ interface T2 {
20
24
 
21
25
  ## Options
22
26
 
23
- This rule accepts one string option:
24
-
25
- - `"interface"`: enforce using `interface`s for object type definitions.
27
+ - `"interface"` _(default)_: enforce using `interface`s for object type definitions.
26
28
  - `"type"`: enforce using `type`s for object type definitions.
27
29
 
28
- For example:
29
-
30
- ```jsonc
31
- {
32
- // Use type for object definitions
33
- "@typescript-eslint/consistent-type-definitions": ["error", "type"]
34
- }
35
- ```
36
-
37
30
  ### `interface`
38
31
 
39
- Examples of code with `interface` option.
40
-
41
32
  <!--tabs-->
42
33
 
43
34
  #### ❌ Incorrect
44
35
 
45
36
  ```ts
37
+ /* eslint @typescript-eslint/consistent-type-definitions: ["error", "interface"] */
38
+
46
39
  type T = { x: number };
47
40
  ```
48
41
 
49
42
  #### ✅ Correct
50
43
 
51
44
  ```ts
45
+ /* eslint @typescript-eslint/consistent-type-definitions: ["error", "interface"] */
46
+
52
47
  type T = string;
53
48
  type Foo = string | {};
54
49
 
@@ -59,13 +54,13 @@ interface T {
59
54
 
60
55
  ### `type`
61
56
 
62
- Examples of code with `type` option.
63
-
64
57
  <!--tabs-->
65
58
 
66
59
  #### ❌ Incorrect
67
60
 
68
61
  ```ts
62
+ /* eslint @typescript-eslint/consistent-type-definitions: ["error", "type"] */
63
+
69
64
  interface T {
70
65
  x: number;
71
66
  }
@@ -74,13 +69,11 @@ interface T {
74
69
  #### ✅ Correct
75
70
 
76
71
  ```ts
72
+ /* eslint @typescript-eslint/consistent-type-definitions: ["error", "type"] */
73
+
77
74
  type T = { x: number };
78
75
  ```
79
76
 
80
77
  ## When Not To Use It
81
78
 
82
79
  If you specifically want to use an interface or type literal for stylistic reasons, you can disable this rule.
83
-
84
- ## Related To
85
-
86
- - TSLint: [interface-over-type-literal](https://palantir.github.io/tslint/rules/interface-over-type-literal/)
@@ -1,15 +1,17 @@
1
- # `consistent-type-exports`
1
+ ---
2
+ description: 'Enforce consistent usage of type exports.'
3
+ ---
2
4
 
3
- Enforces consistent usage of type exports.
4
-
5
- TypeScript 3.8 added support for type-only exports.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/consistent-type-exports** for documentation.
6
8
 
7
9
  Type-only exports allow you to specify that 1 or more named exports are exported as type-only. This allows
8
10
  transpilers to drop exports without knowing the types of the dependencies.
9
11
 
10
12
  ## Rule Details
11
13
 
12
- This rule aims to standardize the use of type exports style across a codebase.
14
+ This rule aims to standardize the use of type exports style.
13
15
 
14
16
  Given a class `Button`, and an interface `ButtonProps`, examples of code:
15
17
 
@@ -21,11 +23,13 @@ Given a class `Button`, and an interface `ButtonProps`, examples of code:
21
23
  interface ButtonProps {
22
24
  onClick: () => void;
23
25
  }
26
+
24
27
  class Button implements ButtonProps {
25
28
  onClick() {
26
29
  console.log('button!');
27
30
  }
28
31
  }
32
+
29
33
  export { Button, ButtonProps };
30
34
  ```
31
35
 
@@ -46,16 +50,6 @@ export type { ButtonProps };
46
50
 
47
51
  ## Options
48
52
 
49
- ```ts
50
- interface Options {
51
- fixMixedExportsWithInlineTypeSpecifier?: boolean;
52
- }
53
-
54
- const defaultOptions: Options = {
55
- fixMixedExportsWithInlineTypeSpecifier: false,
56
- };
57
- ```
58
-
59
53
  ### `fixMixedExportsWithInlineTypeSpecifier`
60
54
 
61
55
  When this is set to true, the rule will autofix "mixed" export cases using TS 4.5's "inline type specifier".
@@ -106,6 +100,5 @@ export { Button, type ButtonProps } from 'some-library';
106
100
 
107
101
  ## When Not To Use It
108
102
 
109
- - If you are using a TypeScript version less than 3.8, then you will not be able to use this rule as type exports are not supported.
110
103
  - If you specifically want to use both export kinds for stylistic reasons, you can disable this rule.
111
104
  - If you use `--isolatedModules` the compiler would error if a type is not re-exported using `export type`. If you also don't wish to enforce one style over the other, you can disable this rule.
@@ -1,28 +1,19 @@
1
- # `consistent-type-imports`
1
+ ---
2
+ description: 'Enforce consistent usage of type imports.'
3
+ ---
2
4
 
3
- Enforces consistent usage of type imports.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/consistent-type-imports** for documentation.
4
8
 
5
- TypeScript 3.8 added support for type-only imports.
6
9
  Type-only imports allow you to specify that an import can only be used in a type location, allowing certain optimizations within compilers.
7
10
 
8
11
  ## Rule Details
9
12
 
10
- This rule aims to standardize the use of type imports style across the codebase.
13
+ This rule aims to standardize the use of type imports style.
11
14
 
12
15
  ## Options
13
16
 
14
- ```ts
15
- type Options = {
16
- prefer: 'type-imports' | 'no-type-imports';
17
- disallowTypeAnnotations: boolean;
18
- };
19
-
20
- const defaultOptions: Options = {
21
- prefer: 'type-imports',
22
- disallowTypeAnnotations: true,
23
- };
24
- ```
25
-
26
17
  ### `prefer`
27
18
 
28
19
  This option defines the expected import kind for type-only imports. Valid values for `prefer` are:
@@ -50,10 +41,10 @@ const x: Bar = 1;
50
41
 
51
42
  ### `disallowTypeAnnotations`
52
43
 
53
- If `true`, type imports in type annotations (`import()`) is not allowed.
44
+ If `true`, type imports in type annotations (`import()`) are not allowed.
54
45
  Default is `true`.
55
46
 
56
- Examples of **incorrect** code with `{disallowTypeAnnotations: true}`.
47
+ Examples of **incorrect** code with `{disallowTypeAnnotations: true}`:
57
48
 
58
49
  ```ts
59
50
  type T = import('Foo').Foo;
@@ -62,5 +53,4 @@ const x: import('Bar') = 1;
62
53
 
63
54
  ## When Not To Use It
64
55
 
65
- - If you are not using TypeScript 3.8 (or greater), then you will not be able to use this rule, as type-only imports are not allowed.
66
56
  - If you specifically want to use both import kinds for stylistic reasons, you can disable this rule.
@@ -1,6 +1,10 @@
1
- # `default-param-last`
1
+ ---
2
+ description: 'Enforce default parameters to be last.'
3
+ ---
2
4
 
3
- Enforces default parameters to be last.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/default-param-last** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
@@ -12,7 +16,7 @@ It adds support for optional parameters.
12
16
  ### ❌ Incorrect
13
17
 
14
18
  ```ts
15
- /* eslint @typescript-eslint/default-param-last: ["error"] */
19
+ /* eslint @typescript-eslint/default-param-last: "error" */
16
20
 
17
21
  function f(a = 0, b: number) {}
18
22
  function f(a: number, b = 0, c: number) {}
@@ -28,7 +32,7 @@ class Foo {
28
32
  ### ✅ Correct
29
33
 
30
34
  ```ts
31
- /* eslint @typescript-eslint/default-param-last: ["error"] */
35
+ /* eslint @typescript-eslint/default-param-last: "error" */
32
36
 
33
37
  function f(a = 0) {}
34
38
  function f(a: number, b = 0) {}
@@ -42,23 +46,3 @@ class Foo {
42
46
  constructor(public a, private b?: number) {}
43
47
  }
44
48
  ```
45
-
46
- ## How to Use
47
-
48
- ```jsonc
49
- {
50
- // note you must disable the base rule as it can report incorrect errors
51
- "default-param-last": "off",
52
- "@typescript-eslint/default-param-last": ["error"]
53
- }
54
- ```
55
-
56
- ## Options
57
-
58
- See [`eslint/default-param-last` options](https://eslint.org/docs/rules/default-param-last#options).
59
-
60
- <sup>
61
-
62
- Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/default-param-last.md)
63
-
64
- </sup>
@@ -1,6 +1,10 @@
1
- # `dot-notation`
1
+ ---
2
+ description: 'Enforce dot notation whenever possible.'
3
+ ---
2
4
 
3
- Enforces dot notation whenever possible.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/dot-notation** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
@@ -10,19 +14,8 @@ It adds:
10
14
  - Support for optionally ignoring computed `private` and/or `protected` member access.
11
15
  - Compatibility with TypeScript's `noPropertyAccessFromIndexSignature` option.
12
16
 
13
- ## How to Use
14
-
15
- ```jsonc
16
- {
17
- // note you must disable the base rule as it can report incorrect errors
18
- "dot-notation": "off",
19
- "@typescript-eslint/dot-notation": ["error"]
20
- }
21
- ```
22
-
23
17
  ## Options
24
18
 
25
- See [`eslint/dot-notation`](https://eslint.org/docs/rules/dot-notation#options) options.
26
19
  This rule adds the following options:
27
20
 
28
21
  ```ts
@@ -31,6 +24,7 @@ interface Options extends BaseDotNotationOptions {
31
24
  allowProtectedClassPropertyAccess?: boolean;
32
25
  allowIndexSignaturePropertyAccess?: boolean;
33
26
  }
27
+
34
28
  const defaultOptions: Options = {
35
29
  ...baseDotNotationDefaultOptions,
36
30
  allowPrivateClassPropertyAccess: false,
@@ -43,7 +37,7 @@ If the TypeScript compiler option `noPropertyAccessFromIndexSignature` is set to
43
37
 
44
38
  ### `allowPrivateClassPropertyAccess`
45
39
 
46
- Example of a correct code when `allowPrivateClassPropertyAccess` is set to `true`
40
+ Example of a correct code when `allowPrivateClassPropertyAccess` is set to `true`:
47
41
 
48
42
  ```ts
49
43
  class X {
@@ -56,7 +50,7 @@ x['priv_prop'] = 123;
56
50
 
57
51
  ### `allowProtectedClassPropertyAccess`
58
52
 
59
- Example of a correct code when `allowProtectedClassPropertyAccess` is set to `true`
53
+ Example of a correct code when `allowProtectedClassPropertyAccess` is set to `true`:
60
54
 
61
55
  ```ts
62
56
  class X {
@@ -69,7 +63,7 @@ x['protected_prop'] = 123;
69
63
 
70
64
  ### `allowIndexSignaturePropertyAccess`
71
65
 
72
- Example of correct code when `allowIndexSignaturePropertyAccess` is set to `true`
66
+ Example of correct code when `allowIndexSignaturePropertyAccess` is set to `true`:
73
67
 
74
68
  ```ts
75
69
  class X {
@@ -81,9 +75,3 @@ x['hello'] = 123;
81
75
  ```
82
76
 
83
77
  If the TypeScript compiler option `noPropertyAccessFromIndexSignature` is set to `true`, then the above code is always allowed, even if `allowIndexSignaturePropertyAccess` is `false`.
84
-
85
- <sup>
86
-
87
- Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/dot-notation.md)
88
-
89
- </sup>
@@ -1,6 +1,10 @@
1
- # `explicit-function-return-type`
1
+ ---
2
+ description: 'Require explicit return types on functions and class methods.'
3
+ ---
2
4
 
3
- Requires explicit return types on functions and class methods.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/explicit-function-return-type** for documentation.
4
8
 
5
9
  Explicit types for function return values makes it clear to any calling code what type is returned.
6
10
  This ensures that the return value is assigned to a variable of the correct type; or in the case
@@ -63,36 +67,6 @@ class Test {
63
67
 
64
68
  ## Options
65
69
 
66
- The rule accepts an options object with the following properties:
67
-
68
- ```ts
69
- type Options = {
70
- // if true, only functions which are part of a declaration will be checked
71
- allowExpressions?: boolean;
72
- // if true, type annotations are also allowed on the variable of a function expression rather than on the function directly
73
- allowTypedFunctionExpressions?: boolean;
74
- // if true, functions immediately returning another function expression will not be checked
75
- allowHigherOrderFunctions?: boolean;
76
- // if true, arrow functions immediately returning a `as const` value will not be checked
77
- allowDirectConstAssertionInArrowFunctions?: boolean;
78
- // if true, concise arrow functions that start with the void keyword will not be checked
79
- allowConciseArrowFunctionExpressionsStartingWithVoid?: boolean;
80
- /**
81
- * An array of function/method names that will not have their arguments or their return values checked.
82
- */
83
- allowedNames?: string[];
84
- };
85
-
86
- const defaults = {
87
- allowExpressions: false,
88
- allowTypedFunctionExpressions: true,
89
- allowHigherOrderFunctions: true,
90
- allowDirectConstAssertionInArrowFunctions: true,
91
- allowConciseArrowFunctionExpressionsStartingWithVoid: false,
92
- allowedNames: [],
93
- };
94
- ```
95
-
96
70
  ### Configuring in a mixed JS/TS codebase
97
71
 
98
72
  If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files.
@@ -108,7 +82,7 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e.
108
82
  // enable the rule specifically for TypeScript files
109
83
  "files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
110
84
  "rules": {
111
- "@typescript-eslint/explicit-function-return-type": ["error"]
85
+ "@typescript-eslint/explicit-function-return-type": "error"
112
86
  }
113
87
  }
114
88
  ]
@@ -1,6 +1,10 @@
1
- # `explicit-member-accessibility`
1
+ ---
2
+ description: 'Require explicit accessibility modifiers on class properties and methods.'
3
+ ---
2
4
 
3
- Requires explicit accessibility modifiers on class properties and methods.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/explicit-member-accessibility** for documentation.
4
8
 
5
9
  Leaving off accessibility modifier and making everything public can make
6
10
  your interface hard to use by others.
@@ -14,29 +18,6 @@ which properties.
14
18
 
15
19
  ## Options
16
20
 
17
- ```ts
18
- type AccessibilityLevel =
19
- | 'explicit' // require an accessor (including public)
20
- | 'no-public' // don't require public
21
- | 'off'; // don't check
22
-
23
- type Options = {
24
- accessibility?: AccessibilityLevel;
25
- ignoredMethodNames?: string[];
26
- overrides?: {
27
- accessors?: AccessibilityLevel;
28
- constructors?: AccessibilityLevel;
29
- methods?: AccessibilityLevel;
30
- properties?: AccessibilityLevel;
31
- parameterProperties?: AccessibilityLevel;
32
- };
33
- };
34
-
35
- const defaultOptions: Options = {
36
- accessibility: 'explicit',
37
- };
38
- ```
39
-
40
21
  ### Configuring in a mixed JS/TS codebase
41
22
 
42
23
  If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files.
@@ -52,7 +33,7 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e.
52
33
  // enable the rule specifically for TypeScript files
53
34
  "files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
54
35
  "rules": {
55
- "@typescript-eslint/explicit-member-accessibility": ["error"]
36
+ "@typescript-eslint/explicit-member-accessibility": "error"
56
37
  }
57
38
  }
58
39
  ]
@@ -344,7 +325,3 @@ If you think defaulting to public is a good default, then you should consider us
344
325
  ## Further Reading
345
326
 
346
327
  - TypeScript [Accessibility Modifiers](https://www.typescriptlang.org/docs/handbook/classes.html#public-private-and-protected-modifiers)
347
-
348
- ## Related To
349
-
350
- - TSLint: [member-access](http://palantir.github.io/tslint/rules/member-access/)
@@ -1,6 +1,10 @@
1
- # `explicit-module-boundary-types`
1
+ ---
2
+ description: "Require explicit return and argument types on exported functions' and classes' public class methods."
3
+ ---
2
4
 
3
- Requires explicit return and argument types on exported functions' and classes' public class methods.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/explicit-module-boundary-types** for documentation.
4
8
 
5
9
  Explicit types for function return values and arguments makes it clear to any calling code what is the module boundary's input and output.
6
10
 
@@ -68,46 +72,6 @@ class Test {
68
72
 
69
73
  ## Options
70
74
 
71
- The rule accepts an options object with the following properties:
72
-
73
- ```ts
74
- type Options = {
75
- /**
76
- * If true, the rule will not report for arguments that are explicitly typed as `any`
77
- */
78
- allowArgumentsExplicitlyTypedAsAny?: boolean;
79
- /**
80
- * If true, body-less arrow functions that return an `as const` type assertion will not
81
- * require an explicit return value annotation.
82
- * You must still type the parameters of the function.
83
- */
84
- allowDirectConstAssertionInArrowFunctions?: boolean;
85
- /**
86
- * An array of function/method names that will not have their arguments or their return values checked.
87
- */
88
- allowedNames?: string[];
89
- /**
90
- * If true, functions immediately returning another function expression will not
91
- * require an explicit return value annotation.
92
- * You must still type the parameters of the function.
93
- */
94
- allowHigherOrderFunctions?: boolean;
95
- /**
96
- * If true, type annotations are also allowed on the variable of a function expression
97
- * rather than on the function arguments/return value directly.
98
- */
99
- allowTypedFunctionExpressions?: boolean;
100
- };
101
-
102
- const defaults = {
103
- allowArgumentsExplicitlyTypedAsAny: false,
104
- allowDirectConstAssertionInArrowFunctions: true,
105
- allowedNames: [],
106
- allowHigherOrderFunctions: true,
107
- allowTypedFunctionExpressions: true,
108
- };
109
- ```
110
-
111
75
  ### Configuring in a mixed JS/TS codebase
112
76
 
113
77
  If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files.
@@ -123,7 +87,7 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e.
123
87
  // enable the rule specifically for TypeScript files
124
88
  "files": ["*.ts", "*.mts", "*.cts", "*.tsx"],
125
89
  "rules": {
126
- "@typescript-eslint/explicit-module-boundary-types": ["error"]
90
+ "@typescript-eslint/explicit-module-boundary-types": "error"
127
91
  }
128
92
  }
129
93
  ]
@@ -158,10 +122,9 @@ Examples of code for this rule with `{ allowDirectConstAssertionInArrowFunctions
158
122
 
159
123
  ```ts
160
124
  export const func = (value: number) => ({ type: 'X', value });
161
- export const foo = () =>
162
- ({
163
- bar: true,
164
- } as const);
125
+ export const foo = () => ({
126
+ bar: true,
127
+ });
165
128
  export const bar = () => 1;
166
129
  ```
167
130
 
@@ -1,28 +1,12 @@
1
- # `func-call-spacing`
1
+ ---
2
+ description: 'Require or disallow spacing between function identifiers and their invocations.'
3
+ ---
2
4
 
3
- Requires or disallows spacing between function identifiers and their invocations.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/func-call-spacing** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
7
11
  This rule extends the base [`eslint/func-call-spacing`](https://eslint.org/docs/rules/func-call-spacing) rule.
8
12
  It adds support for generic type parameters on function calls.
9
-
10
- ## How to Use
11
-
12
- ```jsonc
13
- {
14
- // note you must disable the base rule as it can report incorrect errors
15
- "func-call-spacing": "off",
16
- "@typescript-eslint/func-call-spacing": ["error"]
17
- }
18
- ```
19
-
20
- ## Options
21
-
22
- See [`eslint/func-call-spacing` options](https://eslint.org/docs/rules/func-call-spacing#options).
23
-
24
- <sup>
25
-
26
- Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/func-call-spacing.md)
27
-
28
- </sup>
@@ -1,32 +1,20 @@
1
- # `indent`
1
+ ---
2
+ description: 'Enforce consistent indentation.'
3
+ ---
2
4
 
3
- Enforces consistent indentation.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/indent** for documentation.
4
8
 
5
9
  ## Warning
6
10
 
7
- PLEASE READ THIS ISSUE BEFORE USING THIS RULE [#1824](https://github.com/typescript-eslint/typescript-eslint/issues/1824)
11
+ :::warning
12
+
13
+ Please read [Issue #1824: Problems with the indent rule](https://github.com/typescript-eslint/typescript-eslint/issues/1824) before using this rule!
14
+
15
+ :::
8
16
 
9
17
  ## Rule Details
10
18
 
11
19
  This rule extends the base [`eslint/indent`](https://eslint.org/docs/rules/indent) rule.
12
20
  It adds support for TypeScript nodes.
13
-
14
- ## How to Use
15
-
16
- ```jsonc
17
- {
18
- // note you must disable the base rule as it can report incorrect errors
19
- "indent": "off",
20
- "@typescript-eslint/indent": ["error"]
21
- }
22
- ```
23
-
24
- ## Options
25
-
26
- See [`eslint/indent` options](https://eslint.org/docs/rules/indent#options).
27
-
28
- <sup>
29
-
30
- Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/indent.md)
31
-
32
- </sup>
@@ -1,28 +1,12 @@
1
- # `init-declarations`
1
+ ---
2
+ description: 'Require or disallow initialization in variable declarations.'
3
+ ---
2
4
 
3
- Requires or disallows initialization in variable declarations.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/init-declarations** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
7
11
  This rule extends the base [`eslint/init-declarations`](https://eslint.org/docs/rules/init-declarations) rule.
8
12
  It adds support for TypeScript's `declare` variables.
9
-
10
- ## How to Use
11
-
12
- ```jsonc
13
- {
14
- // note you must disable the base rule as it can report incorrect errors
15
- "init-declarations": "off",
16
- "@typescript-eslint/init-declarations": ["error"]
17
- }
18
- ```
19
-
20
- ## Options
21
-
22
- See [`eslint/init-declarations` options](https://eslint.org/docs/rules/init-declarations#options).
23
-
24
- <sup>
25
-
26
- Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/init-declarations.md)
27
-
28
- </sup>
@@ -1,28 +1,12 @@
1
- # `keyword-spacing`
1
+ ---
2
+ description: 'Enforce consistent spacing before and after keywords.'
3
+ ---
2
4
 
3
- Enforces consistent spacing before and after keywords.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/keyword-spacing** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
7
11
  This rule extends the base [`eslint/keyword-spacing`](https://eslint.org/docs/rules/keyword-spacing) rule.
8
12
  This version adds support for generic type parameters on function calls.
9
-
10
- ## How to Use
11
-
12
- ```jsonc
13
- {
14
- // note you must disable the base rule as it can report incorrect errors
15
- "keyword-spacing": "off",
16
- "@typescript-eslint/keyword-spacing": ["error"]
17
- }
18
- ```
19
-
20
- ## Options
21
-
22
- See [`eslint/keyword-spacing` options](https://eslint.org/docs/rules/keyword-spacing#options).
23
-
24
- <sup>
25
-
26
- Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/keyword-spacing.md)
27
-
28
- </sup>