xo 0.51.0 → 0.52.2

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 (361) hide show
  1. package/lib/options-manager.js +104 -8
  2. package/node_modules/@typescript-eslint/eslint-plugin/README.md +1 -1
  3. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js +21 -8
  4. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js.map +1 -1
  5. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js +37 -31
  6. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js.map +1 -1
  7. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js +10 -10
  8. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js.map +1 -1
  9. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.js +17 -4
  10. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-generic-constructors.js.map +1 -1
  11. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js +14 -8
  12. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-function-return-type.js.map +1 -1
  13. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js +133 -43
  14. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-member-accessibility.js.map +1 -1
  15. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js +12 -1
  16. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/explicit-module-boundary-types.js.map +1 -1
  17. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js +9 -2
  18. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map +1 -1
  19. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-enum-values.js +1 -1
  20. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-duplicate-enum-values.js.map +1 -1
  21. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js +0 -1
  22. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-empty-interface.js.map +1 -1
  23. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js +2 -1
  24. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-explicit-any.js.map +1 -1
  25. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js +8 -2
  26. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js.map +1 -1
  27. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js +4 -0
  28. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extraneous-class.js.map +1 -1
  29. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js +8 -3
  30. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map +1 -1
  31. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js +1 -1
  32. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-implicit-any-catch.js.map +1 -1
  33. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.js +0 -1
  34. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.js.map +1 -1
  35. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js +2 -0
  36. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js.map +1 -1
  37. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js +0 -1
  38. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js.map +1 -1
  39. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js +0 -1
  40. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js.map +1 -1
  41. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js +2 -0
  42. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js.map +1 -1
  43. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js +8 -0
  44. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js.map +1 -1
  45. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js +2 -0
  46. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js.map +1 -1
  47. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js +2 -0
  48. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js.map +1 -1
  49. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js +1 -0
  50. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js.map +1 -1
  51. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js +3 -1
  52. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js.map +1 -1
  53. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js +1 -1
  54. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js.map +1 -1
  55. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js +42 -12
  56. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js.map +1 -1
  57. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js +6 -3
  58. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js.map +1 -1
  59. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.js +1 -2
  60. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.js.map +1 -1
  61. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js +0 -1
  62. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js.map +1 -1
  63. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/object-curly-spacing.js +1 -0
  64. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/object-curly-spacing.js.map +1 -1
  65. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/padding-line-between-statements.js +5 -5
  66. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/padding-line-between-statements.js.map +1 -1
  67. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js +31 -23
  68. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js.map +1 -1
  69. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js +5 -1
  70. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js.map +1 -1
  71. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js +0 -1
  72. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js.map +1 -1
  73. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js +133 -4
  74. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js.map +1 -1
  75. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js +166 -86
  76. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js.map +1 -1
  77. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js +2 -0
  78. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js.map +1 -1
  79. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js +1 -0
  80. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js.map +1 -1
  81. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js +1 -1
  82. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js.map +1 -1
  83. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js +2 -0
  84. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js.map +1 -1
  85. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js +20 -5
  86. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js.map +1 -1
  87. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js +1 -1
  88. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js.map +1 -1
  89. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members.js +3 -0
  90. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members.js.map +1 -1
  91. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js +0 -1
  92. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js.map +1 -1
  93. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js +3 -1
  94. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js.map +1 -1
  95. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js +1 -0
  96. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js.map +1 -1
  97. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js +1 -0
  98. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js.map +1 -1
  99. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js +3 -0
  100. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js.map +1 -1
  101. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.js +27 -0
  102. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.js.map +1 -0
  103. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.js +9 -0
  104. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.js.map +1 -0
  105. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.js +9 -0
  106. package/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.js.map +1 -0
  107. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/TEMPLATE.md +3 -30
  108. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md +6 -15
  109. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md +6 -21
  110. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md +6 -15
  111. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.md +8 -26
  112. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.md +6 -15
  113. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md +74 -95
  114. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md +6 -22
  115. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md +3 -1
  116. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.md +9 -5
  117. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md +9 -27
  118. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md +6 -22
  119. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-generic-constructors.md +11 -20
  120. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-indexed-object-style.md +19 -21
  121. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.md +9 -21
  122. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md +15 -18
  123. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-exports.md +9 -16
  124. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.md +9 -19
  125. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md +8 -24
  126. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md +10 -22
  127. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md +7 -33
  128. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md +7 -26
  129. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md +7 -43
  130. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md +6 -22
  131. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md +11 -23
  132. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md +6 -22
  133. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md +6 -22
  134. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md +8 -24
  135. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md +6 -2
  136. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md +34 -9
  137. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.md +6 -2
  138. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.md +6 -2
  139. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md +6 -22
  140. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.md +7 -11
  141. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md +6 -15
  142. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-void-expression.md +6 -38
  143. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md +6 -22
  144. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-enum-values.md +10 -19
  145. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-imports.md +8 -28
  146. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.md +6 -15
  147. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md +6 -29
  148. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md +6 -2
  149. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md +6 -18
  150. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md +6 -15
  151. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md +6 -22
  152. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md +6 -22
  153. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md +6 -24
  154. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md +6 -18
  155. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md +6 -15
  156. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implicit-any-catch.md +11 -20
  157. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.md +6 -18
  158. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md +11 -27
  159. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.md +6 -26
  160. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.md +6 -14
  161. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.md +6 -22
  162. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.md +6 -19
  163. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md +6 -24
  164. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-meaningless-void-operator.md +6 -2
  165. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md +6 -15
  166. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md +6 -2
  167. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md +10 -13
  168. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md +6 -15
  169. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md +6 -15
  170. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md +6 -15
  171. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md +11 -2
  172. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.md +6 -19
  173. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redundant-type-constituents.md +6 -15
  174. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md +6 -15
  175. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-imports.md +6 -13
  176. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.md +6 -19
  177. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md +6 -18
  178. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-throw-literal.md +25 -29
  179. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md +6 -14
  180. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md +6 -22
  181. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.md +6 -16
  182. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +6 -15
  183. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md +6 -15
  184. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +8 -4
  185. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +6 -15
  186. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-argument.md +6 -15
  187. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.md +6 -15
  188. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.md +6 -15
  189. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.md +6 -15
  190. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.md +6 -15
  191. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.md +6 -22
  192. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md +6 -22
  193. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md +6 -23
  194. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md +7 -23
  195. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-empty-export.md +6 -15
  196. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md +6 -15
  197. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md +6 -15
  198. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md +6 -22
  199. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/padding-line-between-statements.md +10 -31
  200. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/parameter-properties.md +6 -2
  201. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.md +6 -15
  202. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.md +6 -15
  203. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md +6 -15
  204. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md +6 -15
  205. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md +6 -15
  206. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md +6 -2
  207. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md +6 -15
  208. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md +48 -2
  209. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md +16 -15
  210. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md +6 -15
  211. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md +6 -4
  212. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md +6 -15
  213. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md +6 -15
  214. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-return-this-type.md +6 -15
  215. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +6 -16
  216. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.md +6 -15
  217. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md +6 -31
  218. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md +6 -22
  219. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md +6 -18
  220. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md +6 -20
  221. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md +6 -24
  222. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md +6 -27
  223. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.md +6 -12
  224. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md +6 -22
  225. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-union-intersection-members.md +6 -45
  226. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md +10 -22
  227. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md +6 -22
  228. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-infix-ops.md +7 -23
  229. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md +6 -25
  230. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +6 -15
  231. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md +9 -19
  232. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md +8 -14
  233. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.md +11 -27
  234. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md +7 -23
  235. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md +12 -18
  236. package/node_modules/@typescript-eslint/eslint-plugin/package.json +5 -5
  237. package/node_modules/@typescript-eslint/parser/README.md +1 -1
  238. package/node_modules/@typescript-eslint/parser/package.json +5 -5
  239. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts +2 -0
  240. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts.map +1 -1
  241. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js +6 -0
  242. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js.map +1 -1
  243. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts +1 -0
  244. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts.map +1 -1
  245. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js +4 -0
  246. package/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js.map +1 -1
  247. package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts +1 -1
  248. package/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts.map +1 -1
  249. package/node_modules/@typescript-eslint/scope-manager/package.json +5 -5
  250. package/node_modules/@typescript-eslint/type-utils/package.json +4 -4
  251. package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts +1 -1
  252. package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map +1 -1
  253. package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts +1 -0
  254. package/node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map +1 -1
  255. package/node_modules/@typescript-eslint/types/package.json +2 -2
  256. package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js +2 -2
  257. package/node_modules/@typescript-eslint/typescript-estree/dist/convert.js.map +1 -1
  258. package/node_modules/@typescript-eslint/typescript-estree/package.json +5 -5
  259. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.d.ts.map +1 -1
  260. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js +2 -1
  261. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js.map +1 -1
  262. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.d.ts.map +1 -1
  263. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js +3 -4
  264. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js.map +1 -1
  265. package/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts +4 -0
  266. package/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts.map +1 -1
  267. package/node_modules/@typescript-eslint/utils/package.json +5 -5
  268. package/node_modules/@typescript-eslint/visitor-keys/package.json +3 -3
  269. package/node_modules/eslint-config-xo-typescript/index.js +27 -11
  270. package/node_modules/eslint-config-xo-typescript/package.json +5 -4
  271. package/package.json +10 -10
  272. package/node_modules/@typescript-eslint/parser/_ts3.4/dist/index.d.ts +0 -4
  273. package/node_modules/@typescript-eslint/parser/_ts3.4/dist/parser.d.ts +0 -20
  274. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/containsAllTypesByName.d.ts +0 -8
  275. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getConstrainedTypeAtLocation.d.ts +0 -6
  276. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getContextualType.d.ts +0 -8
  277. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getDeclaration.d.ts +0 -6
  278. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getSourceFileOfNode.d.ts +0 -6
  279. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTokenAtPosition.d.ts +0 -3
  280. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTypeArguments.d.ts +0 -3
  281. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/getTypeName.d.ts +0 -8
  282. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/index.d.ts +0 -15
  283. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/isTypeReadonly.d.ts +0 -20
  284. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/isUnsafeAssignment.d.ts +0 -17
  285. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/predicates.d.ts +0 -52
  286. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/propertyTypes.d.ts +0 -4
  287. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/requiresQuoting.d.ts +0 -4
  288. package/node_modules/@typescript-eslint/type-utils/_ts3.4/dist/typeFlagUtils.d.ts +0 -11
  289. package/node_modules/@typescript-eslint/types/_ts3.4/dist/generated/ast-spec.d.ts +0 -1732
  290. package/node_modules/@typescript-eslint/types/_ts3.4/dist/index.d.ts +0 -5
  291. package/node_modules/@typescript-eslint/types/_ts3.4/dist/lib.d.ts +0 -3
  292. package/node_modules/@typescript-eslint/types/_ts3.4/dist/parser-options.d.ts +0 -35
  293. package/node_modules/@typescript-eslint/types/_ts3.4/dist/ts-estree.d.ts +0 -9
  294. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ast-converter.d.ts +0 -9
  295. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/convert-comments.d.ts +0 -11
  296. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/convert.d.ts +0 -157
  297. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/WatchCompilerHostOfConfigFile.d.ts +0 -13
  298. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createDefaultProgram.d.ts +0 -12
  299. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createIsolatedProgram.d.ts +0 -9
  300. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createProjectProgram.d.ts +0 -11
  301. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createSourceFile.d.ts +0 -5
  302. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createWatchProgram.d.ts +0 -19
  303. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/getScriptKind.d.ts +0 -5
  304. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/shared.d.ts +0 -22
  305. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/useProvidedPrograms.d.ts +0 -13
  306. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/index.d.ts +0 -10
  307. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/jsx/xhtml-entities.d.ts +0 -2
  308. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/node-utils.d.ts +0 -230
  309. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parser-options.d.ts +0 -188
  310. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parser.d.ts +0 -25
  311. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/semantic-or-syntactic-errors.d.ts +0 -13
  312. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/simple-traverse.d.ts +0 -9
  313. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/estree-to-ts-node-types.d.ts +0 -175
  314. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/index.d.ts +0 -4
  315. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ts-estree/ts-nodes.d.ts +0 -18
  316. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/version-check.d.ts +0 -3
  317. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/PatternMatcher.d.ts +0 -48
  318. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts +0 -76
  319. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/astUtilities.d.ts +0 -76
  320. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/index.d.ts +0 -6
  321. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/predicates.d.ts +0 -32
  322. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts +0 -18
  323. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/helpers.d.ts +0 -47
  324. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/index.d.ts +0 -5
  325. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/misc.d.ts +0 -8
  326. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ast-utils/predicates.d.ts +0 -180
  327. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/InferTypesFromRule.d.ts +0 -11
  328. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/RuleCreator.d.ts +0 -35
  329. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/RuleTester.d.ts +0 -18
  330. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/applyDefault.d.ts +0 -10
  331. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/batchedSingleLineTests.d.ts +0 -24
  332. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/deepMerge.d.ts +0 -17
  333. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/getParserServices.d.ts +0 -8
  334. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/index.d.ts +0 -9
  335. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/nullThrows.d.ts +0 -14
  336. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/index.d.ts +0 -8
  337. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/json-schema.d.ts +0 -2
  338. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/AST.d.ts +0 -9
  339. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/CLIEngine.d.ts +0 -137
  340. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/ESLint.d.ts +0 -376
  341. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Linter.d.ts +0 -326
  342. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/ParserOptions.d.ts +0 -2
  343. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Rule.d.ts +0 -389
  344. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/RuleTester.d.ts +0 -154
  345. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/Scope.d.ts +0 -44
  346. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/SourceCode.d.ts +0 -342
  347. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/index.d.ts +0 -10
  348. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Definition.d.ts +0 -19
  349. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Options.d.ts +0 -15
  350. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/PatternVisitor.d.ts +0 -25
  351. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Reference.d.ts +0 -28
  352. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Referencer.d.ts +0 -55
  353. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Scope.d.ts +0 -103
  354. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/ScopeManager.d.ts +0 -50
  355. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/Variable.d.ts +0 -17
  356. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/analyze.d.ts +0 -16
  357. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint-scope/index.d.ts +0 -11
  358. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-estree.d.ts +0 -3
  359. package/node_modules/@typescript-eslint/visitor-keys/_ts3.4/dist/get-keys.d.ts +0 -4
  360. package/node_modules/@typescript-eslint/visitor-keys/_ts3.4/dist/index.d.ts +0 -3
  361. package/node_modules/@typescript-eslint/visitor-keys/_ts3.4/dist/visitor-keys.d.ts +0 -6
@@ -1,6 +1,10 @@
1
- # `ban-ts-comment`
1
+ ---
2
+ description: 'Disallow `@ts-<directive>` comments or require descriptions after directive.'
3
+ ---
2
4
 
3
- Disallows `@ts-<directive>` comments or requires descriptions after directive.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/ban-ts-comment** for documentation.
4
8
 
5
9
  TypeScript provides several directive comments that can be used to alter how it processes files.
6
10
  Using these to suppress TypeScript Compiler Errors reduces the effectiveness of TypeScript overall.
@@ -17,32 +21,10 @@ The directive comments supported by TypeScript are:
17
21
  ## Rule Details
18
22
 
19
23
  This rule lets you set which directive comments you want to allow in your codebase.
20
- By default, only `@ts-check` is allowed, as it enables rather than suppresses errors.
21
-
22
- The configuration looks like this:
23
24
 
24
- ```ts
25
- type DirectiveConfig =
26
- | boolean
27
- | 'allow-with-description'
28
- | { descriptionFormat: string };
29
-
30
- interface Options {
31
- 'ts-expect-error'?: DirectiveConfig;
32
- 'ts-ignore'?: DirectiveConfig;
33
- 'ts-nocheck'?: DirectiveConfig;
34
- 'ts-check'?: DirectiveConfig;
35
- minimumDescriptionLength?: number;
36
- }
25
+ ## Options
37
26
 
38
- const defaultOptions: Options = {
39
- 'ts-expect-error': 'allow-with-description',
40
- 'ts-ignore': true,
41
- 'ts-nocheck': true,
42
- 'ts-check': false,
43
- minimumDescriptionLength: 3,
44
- };
45
- ```
27
+ By default, only `@ts-check` is allowed, as it enables rather than suppresses errors.
46
28
 
47
29
  ### `ts-expect-error`, `ts-ignore`, `ts-nocheck`, `ts-check` directives
48
30
 
@@ -1,6 +1,10 @@
1
- # `ban-tslint-comment`
1
+ ---
2
+ description: 'Disallow `// tslint:<rule-flag>` comments.'
3
+ ---
2
4
 
3
- Disallows `// tslint:<rule-flag>` comments.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/ban-tslint-comment** for documentation.
4
8
 
5
9
  Useful when migrating from TSLint to ESLint. Once TSLint has been removed, this rule helps locate TSLint annotations (e.g. `// tslint:disable`).
6
10
 
@@ -30,19 +34,6 @@ someCode(); // tslint:disable-line
30
34
  someCode(); // This is a comment that just happens to mention tslint
31
35
  ```
32
36
 
33
- ## Options
34
-
35
- ```jsonc
36
- // .eslintrc.json
37
- {
38
- "rules": {
39
- "@typescript-eslint/ban-tslint-comment": "warn"
40
- }
41
- }
42
- ```
43
-
44
- This rule is not configurable.
45
-
46
37
  ## When Not To Use It
47
38
 
48
39
  If you are still using TSLint.
@@ -1,8 +1,12 @@
1
- # `ban-types`
1
+ ---
2
+ description: 'Disallow certain types.'
3
+ ---
2
4
 
3
- Disallows certain types.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/ban-types** for documentation.
4
8
 
5
- Some builtin types have aliases, some types are considered dangerous or harmful.
9
+ Some built-in types have aliases, while some types are considered dangerous or harmful.
6
10
  It's often a good idea to ban certain types to help with consistency and safety.
7
11
 
8
12
  ## Rule Details
@@ -10,72 +14,53 @@ It's often a good idea to ban certain types to help with consistency and safety.
10
14
  This rule bans specific types and can suggest alternatives.
11
15
  Note that it does not ban the corresponding runtime objects from being used.
12
16
 
13
- ## Options
14
-
15
- ```ts
16
- type Options = {
17
- types?: {
18
- [typeName: string]:
19
- | false
20
- | string
21
- | {
22
- message: string;
23
- fixWith?: string;
24
- };
25
- };
26
- extendDefaults?: boolean;
27
- };
28
- ```
29
-
30
- The rule accepts a single object as options.
31
-
32
- ### `types`
17
+ Examples of code with the default options:
33
18
 
34
- An object whose keys are the types you want to ban, and the values are error messages.
19
+ <!--tabs-->
35
20
 
36
- The type can either be a type name literal (`Foo`), a type name with generic parameter instantiation(s) (`Foo<Bar>`), the empty object literal (`{}`), or the empty tuple type (`[]`).
21
+ ### Incorrect
37
22
 
38
- The values can be:
23
+ ```ts
24
+ // use lower-case primitives for consistency
25
+ const str: String = 'foo';
26
+ const bool: Boolean = true;
27
+ const num: Number = 1;
28
+ const symb: Symbol = Symbol('foo');
29
+ const bigInt: BigInt = 1n;
39
30
 
40
- - A string, which is the error message to be reported; or
41
- - `false` to specifically un-ban this type (useful when you are using `extendDefaults`); or
42
- - An object with the following properties:
43
- - `message: string` - the message to display when the type is matched.
44
- - `fixWith?: string` - a string to replace the banned type with when the fixer is run. If this is omitted, no fix will be done.
31
+ // use a proper function type
32
+ const func: Function = () => 1;
45
33
 
46
- ### `extendDefaults`
34
+ // use safer object types
35
+ const lowerObj: Object = {};
36
+ const capitalObj: Object = { a: 'string' };
47
37
 
48
- If you're specifying custom `types`, you can set this to `true` to extend the default `types` configuration. This is a convenience option to save you copying across the defaults when adding another type.
38
+ const curly1: {} = 1;
39
+ const curly2: {} = { a: 'string' };
40
+ ```
49
41
 
50
- If this is `false`, the rule will _only_ use the types defined in your configuration.
42
+ ### Correct
51
43
 
52
- Example configuration:
44
+ ```ts
45
+ // use lower-case primitives for consistency
46
+ const str: string = 'foo';
47
+ const bool: boolean = true;
48
+ const num: number = 1;
49
+ const symb: symbol = Symbol('foo');
50
+ const bigInt: bigint = 1n;
53
51
 
54
- ```jsonc
55
- {
56
- "@typescript-eslint/ban-types": [
57
- "error",
58
- {
59
- "types": {
60
- // add a custom message to help explain why not to use it
61
- "Foo": "Don't use Foo because it is unsafe",
52
+ // use a proper function type
53
+ const func: () => number = () => 1;
62
54
 
63
- // add a custom message, AND tell the plugin how to fix it
64
- "OldAPI": {
65
- "message": "Use NewAPI instead",
66
- "fixWith": "NewAPI"
67
- },
55
+ // use safer object types
56
+ const lowerObj: object = {};
57
+ const capitalObj: { a: string } = { a: 'string' };
68
58
 
69
- // un-ban a type that's banned by default
70
- "{}": false
71
- },
72
- "extendDefaults": true
73
- }
74
- ]
75
- }
59
+ const curly1: number = 1;
60
+ const curly2: Record<'a', string> = { a: 'string' };
76
61
  ```
77
62
 
78
- ### Default Options
63
+ ## Options
79
64
 
80
65
  The default options provide a set of "best practices", intended to provide safety and standardization in your codebase:
81
66
 
@@ -118,7 +103,6 @@ const defaultTypes = {
118
103
  message: 'Use bigint instead',
119
104
  fixWith: 'bigint',
120
105
  },
121
-
122
106
  Function: {
123
107
  message: [
124
108
  'The `Function` type accepts any function-like value.',
@@ -127,7 +111,6 @@ const defaultTypes = {
127
111
  'If you are expecting the function to accept certain arguments, you should explicitly define the function shape.',
128
112
  ].join('\n'),
129
113
  },
130
-
131
114
  // object typing
132
115
  Object: {
133
116
  message: [
@@ -148,52 +131,48 @@ const defaultTypes = {
148
131
 
149
132
  </details>
150
133
 
151
- ### Examples
152
-
153
- Examples of code with the default options:
154
-
155
- <!--tabs-->
134
+ ### `types`
156
135
 
157
- #### Incorrect
136
+ An object whose keys are the types you want to ban, and the values are error messages.
158
137
 
159
- ```ts
160
- // use lower-case primitives for consistency
161
- const str: String = 'foo';
162
- const bool: Boolean = true;
163
- const num: Number = 1;
164
- const symb: Symbol = Symbol('foo');
165
- const bigInt: BigInt = 1n;
138
+ The type can either be a type name literal (`Foo`), a type name with generic parameter instantiation(s) (`Foo<Bar>`), the empty object literal (`{}`), or the empty tuple type (`[]`).
166
139
 
167
- // use a proper function type
168
- const func: Function = () => 1;
140
+ The values can be:
169
141
 
170
- // use safer object types
171
- const capitalObj1: Object = 1;
172
- const capitalObj2: Object = { a: 'string' };
142
+ - A string, which is the error message to be reported; or
143
+ - `false` to specifically un-ban this type (useful when you are using `extendDefaults`); or
144
+ - An object with the following properties:
145
+ - `message: string` - the message to display when the type is matched.
146
+ - `fixWith?: string` - a string to replace the banned type with when the fixer is run. If this is omitted, no fix will be done.
173
147
 
174
- const curly1: {} = 1;
175
- const curly2: {} = { a: 'string' };
176
- ```
148
+ ### `extendDefaults`
177
149
 
178
- #### Correct
150
+ If you're specifying custom `types`, you can set this to `true` to extend the default `types` configuration. This is a convenience option to save you copying across the defaults when adding another type.
179
151
 
180
- ```ts
181
- // use lower-case primitives for consistency
182
- const str: string = 'foo';
183
- const bool: boolean = true;
184
- const num: number = 1;
185
- const symb: symbol = Symbol('foo');
186
- const bigInt: bigint = 1n;
152
+ If this is `false`, the rule will _only_ use the types defined in your configuration.
187
153
 
188
- // use a proper function type
189
- const func: () => number = () => 1;
154
+ Example configuration:
190
155
 
191
- // use safer object types
192
- const lowerObj: object = {};
156
+ ```jsonc
157
+ {
158
+ "@typescript-eslint/ban-types": [
159
+ "error",
160
+ {
161
+ "types": {
162
+ // add a custom message to help explain why not to use it
163
+ "Foo": "Don't use Foo because it is unsafe",
193
164
 
194
- const capitalObj1: number = 1;
195
- const capitalObj2: { a: string } = { a: 'string' };
165
+ // add a custom message, AND tell the plugin how to fix it
166
+ "OldAPI": {
167
+ "message": "Use NewAPI instead",
168
+ "fixWith": "NewAPI"
169
+ },
196
170
 
197
- const curly1: number = 1;
198
- const curly2: Record<'a', string> = { a: 'string' };
171
+ // un-ban a type that's banned by default
172
+ "{}": false
173
+ },
174
+ "extendDefaults": true
175
+ }
176
+ ]
177
+ }
199
178
  ```
@@ -1,28 +1,12 @@
1
- # `brace-style`
1
+ ---
2
+ description: 'Enforce consistent brace style for blocks.'
3
+ ---
2
4
 
3
- Enforces consistent brace style for blocks.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/brace-style** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
7
11
  This rule extends the base [`eslint/brace-style`](https://eslint.org/docs/rules/brace-style) rule.
8
12
  It adds support for `enum`, `interface`, `namespace` and `module` declarations.
9
-
10
- ## How to Use
11
-
12
- ```jsonc
13
- {
14
- // note you must disable the base rule as it can report incorrect errors
15
- "brace-style": "off",
16
- "@typescript-eslint/brace-style": ["error"]
17
- }
18
- ```
19
-
20
- ## Options
21
-
22
- See [`eslint/brace-style` options](https://eslint.org/docs/rules/brace-style#options).
23
-
24
- <sup>
25
-
26
- Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/brace-style.md)
27
-
28
- </sup>
@@ -1,7 +1,9 @@
1
- ## DEPRECATED
1
+ :::danger Deprecated
2
2
 
3
3
  This rule has been deprecated in favour of the [`naming-convention`](./naming-convention.md) rule.
4
4
 
5
+ :::
6
+
5
7
  <!--
6
8
  This doc file has been left on purpose because `camelcase` is a core eslint rule.
7
9
  This exists to help direct people to the replacement rule.
@@ -1,11 +1,15 @@
1
- # `class-literal-property-style`
1
+ ---
2
+ description: 'Enforce that literals on classes are exposed in a consistent style.'
3
+ ---
2
4
 
3
- Enforces that literals on classes are exposed in a consistent style.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/class-literal-property-style** for documentation.
4
8
 
5
9
  When writing TypeScript applications, it's typically safe to store literal values on classes using fields with the `readonly` modifier to prevent them from being reassigned.
6
10
  When writing TypeScript libraries that could be used by JavaScript users however, it's typically safer to expose these literals using `getter`s, since the `readonly` modifier is enforced at compile type.
7
11
 
8
- ## Rule Details
12
+ ## Options
9
13
 
10
14
  This rule aims to ensure that literals exposed by classes are done so consistently, in one of the two style described above.
11
15
  By default this rule prefers the `fields` style as it means JS doesn't have to setup & teardown a function closure.
@@ -17,7 +21,7 @@ This is because these types can be mutated and carry with them more complex impl
17
21
 
18
22
  :::
19
23
 
20
- ### The `fields` style
24
+ ### `"fields"`
21
25
 
22
26
  This style checks for any getter methods that return literal values, and requires them to be defined using fields with the `readonly` modifier instead.
23
27
 
@@ -60,7 +64,7 @@ class Mx {
60
64
  }
61
65
  ```
62
66
 
63
- ### The `getters` style
67
+ ### `"getters"`
64
68
 
65
69
  This style checks for any `readonly` fields that are assigned literal values, and requires them to be defined as getters instead.
66
70
  This style pairs well with the [`@typescript-eslint/prefer-readonly`](prefer-readonly.md) rule,
@@ -1,6 +1,10 @@
1
- # `comma-dangle`
1
+ ---
2
+ description: 'Require or disallow trailing commas.'
3
+ ---
2
4
 
3
- Requires or disallows trailing commas.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/comma-dangle** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
@@ -11,30 +15,8 @@ See the [ESLint documentation](https://eslint.org/docs/rules/comma-dangle) for m
11
15
 
12
16
  ## How to Use
13
17
 
14
- ```jsonc
15
- {
16
- // note you must disable the base rule as it can report incorrect errors
17
- "comma-dangle": "off",
18
- "@typescript-eslint/comma-dangle": ["error"]
19
- }
20
- ```
21
-
22
18
  In addition to the options supported by the `comma-dangle` rule in ESLint core, the rule adds the following options:
23
19
 
24
- ## Options
25
-
26
- This rule has a string option and an object option.
27
-
28
- - Object option:
29
-
30
- - `"enums"` is for trailing comma in enum. (e.g. `enum Foo = {Bar,}`)
31
- - `"generics"` is for trailing comma in generic. (e.g. `function foo<T,>() {}`)
32
- - `"tuples"` is for trailing comma in tuple. (e.g. `type Foo = [string,]`)
33
-
34
- - [See the other options allowed](https://eslint.org/docs/rules/comma-dangle#options)
35
-
36
- <sup>
37
-
38
- Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/comma-dangle.md)
39
-
40
- </sup>
20
+ - `"enums"` is for trailing comma in enum. (e.g. `enum Foo = {Bar,}`)
21
+ - `"generics"` is for trailing comma in generic. (e.g. `function foo<T,>() {}`)
22
+ - `"tuples"` is for trailing comma in tuple. (e.g. `type Foo = [string,]`)
@@ -1,28 +1,12 @@
1
- # `comma-spacing`
1
+ ---
2
+ description: 'Enforce consistent spacing before and after commas.'
3
+ ---
2
4
 
3
- Enforces consistent spacing before and after commas.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/comma-spacing** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
7
11
  This rule extends the base [`eslint/comma-spacing`](https://eslint.org/docs/rules/comma-spacing) rule.
8
12
  It adds support for trailing comma in a types parameters list.
9
-
10
- ## How to Use
11
-
12
- ```jsonc
13
- {
14
- // note you must disable the base rule as it can report incorrect errors
15
- "comma-spacing": "off",
16
- "@typescript-eslint/comma-spacing": ["error"]
17
- }
18
- ```
19
-
20
- ## Options
21
-
22
- See [`eslint/comma-spacing` options](https://eslint.org/docs/rules/comma-spacing#options).
23
-
24
- <sup>
25
-
26
- Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/comma-spacing.md)
27
-
28
- </sup>
@@ -1,6 +1,10 @@
1
- # `consistent-generic-constructors`
1
+ ---
2
+ description: 'Enforce specifying generic type arguments on type annotation or constructor name of a constructor call.'
3
+ ---
2
4
 
3
- Enforces specifying generic type arguments on type annotation or constructor name of a constructor call.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/consistent-generic-constructors** for documentation.
4
8
 
5
9
  When constructing a generic class, you can specify the type arguments on either the left-hand side (as a type annotation) or the right-hand side (as part of the constructor call):
6
10
 
@@ -14,28 +18,15 @@ const map = new Map<string, number>();
14
18
 
15
19
  This rule ensures that type arguments appear consistently on one side of the declaration.
16
20
 
17
- ## Options
18
-
19
- ```jsonc
20
- {
21
- "rules": {
22
- "@typescript-eslint/consistent-generic-constructors": [
23
- "error",
24
- "constructor"
25
- ]
26
- }
27
- }
28
- ```
29
-
30
- This rule takes a string option:
31
-
32
- - If it's set to `constructor` (default), type arguments that **only** appear on the type annotation are disallowed.
33
- - If it's set to `type-annotation`, type arguments that **only** appear on the constructor are disallowed.
34
-
35
21
  ## Rule Details
36
22
 
37
23
  The rule never reports when there are type parameters on both sides, or neither sides of the declaration. It also doesn't report if the names of the type annotation and the constructor don't match.
38
24
 
25
+ ## Options
26
+
27
+ - `constructor` _(default)_: type arguments that **only** appear on the type annotation are disallowed.
28
+ - `type-annotation`: type arguments that **only** appear on the constructor are disallowed.
29
+
39
30
  ### `constructor`
40
31
 
41
32
  <!--tabs-->
@@ -1,6 +1,10 @@
1
- # `consistent-indexed-object-style`
1
+ ---
2
+ description: 'Require or disallow the `Record` type.'
3
+ ---
2
4
 
3
- Requires or disallows the `Record` type.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/consistent-indexed-object-style** for documentation.
4
8
 
5
9
  TypeScript supports defining object show keys can be flexible using an index signature. TypeScript also has a builtin type named `Record` to create an empty object defining only an index signature. For example, the following types are equal:
6
10
 
@@ -16,34 +20,24 @@ type Foo = {
16
20
  type Foo = Record<string, unknown>;
17
21
  ```
18
22
 
19
- ## Options
20
-
21
- - `"record"`: Set to `"record"` to only allow the `Record` type. Set to `"index-signature"` to only allow index signatures. (Defaults to `"record"`)
22
-
23
- For example:
24
-
25
- ```json
26
- {
27
- "@typescript-eslint/consistent-indexed-object-style": [
28
- "error",
29
- "index-signature"
30
- ]
31
- }
32
- ```
33
-
34
23
  ## Rule Details
35
24
 
36
25
  This rule enforces a consistent way to define records.
37
26
 
38
- ### `record`
27
+ ## Options
28
+
29
+ - `"record"` _(default)_: only allow the `Record` type.
30
+ - `"index-signature"`: only allow index signatures.
39
31
 
40
- Examples of code with `record` option.
32
+ ### `record`
41
33
 
42
34
  <!--tabs-->
43
35
 
44
36
  #### ❌ Incorrect
45
37
 
46
38
  ```ts
39
+ /* eslint @typescript-eslint/consistent-indexed-object-style: ["error", "record"] */
40
+
47
41
  interface Foo {
48
42
  [key: string]: unknown;
49
43
  }
@@ -56,24 +50,28 @@ type Foo = {
56
50
  #### ✅ Correct
57
51
 
58
52
  ```ts
53
+ /* eslint @typescript-eslint/consistent-indexed-object-style: ["error", "record"] */
54
+
59
55
  type Foo = Record<string, unknown>;
60
56
  ```
61
57
 
62
58
  ### `index-signature`
63
59
 
64
- Examples of code with `index-signature` option.
65
-
66
60
  <!--tabs-->
67
61
 
68
62
  #### ❌ Incorrect
69
63
 
70
64
  ```ts
65
+ /* eslint @typescript-eslint/consistent-indexed-object-style: ["error", "index-signature"] */
66
+
71
67
  type Foo = Record<string, unknown>;
72
68
  ```
73
69
 
74
70
  #### ✅ Correct
75
71
 
76
72
  ```ts
73
+ /* eslint @typescript-eslint/consistent-indexed-object-style: ["error", "index-signature"] */
74
+
77
75
  interface Foo {
78
76
  [key: string]: unknown;
79
77
  }
@@ -1,6 +1,10 @@
1
- # `consistent-type-assertions`
1
+ ---
2
+ description: 'Enforce consistent usage of type assertions.'
3
+ ---
2
4
 
3
- Enforces consistent usage of type assertions.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/consistent-type-assertions** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
@@ -10,26 +14,10 @@ Type assertions are also commonly referred as "type casting" in TypeScript (even
10
14
 
11
15
  In addition to ensuring that type assertions are written in a consistent way, this rule also helps make your codebase more type-safe.
12
16
 
13
- `const` assertions, [introduced in TypeScript 3.4](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions), is always allowed by this rule. Examples of it include `let x = "hello" as const;` and `let x = <const>"hello";`.
17
+ [`const` assertions](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) are always allowed by this rule. Examples of them include `let x = "hello" as const;` and `let x = <const>"hello";`.
14
18
 
15
19
  ## Options
16
20
 
17
- ```ts
18
- type Options =
19
- | {
20
- assertionStyle: 'as' | 'angle-bracket';
21
- objectLiteralTypeAssertions: 'allow' | 'allow-as-parameter' | 'never';
22
- }
23
- | {
24
- assertionStyle: 'never';
25
- };
26
-
27
- const defaultOptions: Options = {
28
- assertionStyle: 'as',
29
- objectLiteralTypeAssertions: 'allow',
30
- };
31
- ```
32
-
33
21
  ### `assertionStyle`
34
22
 
35
23
  This option defines the expected assertion style. Valid values for `assertionStyle` are:
@@ -52,7 +40,7 @@ The const assertion `const x = { foo: 1 } as const`, introduced in TypeScript 3.
52
40
 
53
41
  Assertions to `any` are also ignored by this option.
54
42
 
55
- Examples of code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }`
43
+ Examples of code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }`:
56
44
 
57
45
  <!--tabs-->
58
46
 
@@ -80,7 +68,7 @@ function foo(): T {
80
68
 
81
69
  <!--/tabs-->
82
70
 
83
- Examples of code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' }`
71
+ Examples of code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' }`:
84
72
 
85
73
  <!--tabs-->
86
74