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
- # `no-misused-promises`
1
+ ---
2
+ description: 'Disallow Promises in places not designed to handle them.'
3
+ ---
2
4
 
3
- Disallows Promises in places not designed to handle them.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-misused-promises** for documentation.
4
8
 
5
9
  This rule forbids providing Promises to logical locations such as if statements in places where the TypeScript compiler allows them but they are not handled properly.
6
10
  These situations can often arise due to a missing `await` keyword or just a misunderstanding of the way async
@@ -1,6 +1,10 @@
1
- # `no-namespace`
1
+ ---
2
+ description: 'Disallow custom TypeScript modules and namespaces.'
3
+ ---
2
4
 
3
- Disallows custom TypeScript modules and namespaces.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-namespace** for documentation.
4
8
 
5
9
  Custom TypeScript modules (`module foo {}`) and namespaces (`namespace foo {}`) are considered outdated
6
10
  ways to organize TypeScript code. ES2015 module syntax is now preferred (`import`/`export`).
@@ -11,16 +15,7 @@ This rule still allows the use of TypeScript module declarations to describe ext
11
15
 
12
16
  This rule aims to standardize the way modules are declared.
13
17
 
14
- ## Options
15
-
16
- This rule, in its default state, does not require any argument. If you would like to enable one
17
- or more of the following you may pass an object with the options set as follows:
18
-
19
- - `allowDeclarations` set to `true` will allow you to `declare` custom TypeScript modules and namespaces (Default: `false`).
20
- - `allowDefinitionFiles` set to `true` will allow you to `declare` and use custom TypeScript modules and namespaces
21
- inside definition files (Default: `true`).
22
-
23
- Examples of code for the default `{ "allowDeclarations": false, "allowDefinitionFiles": true }` options:
18
+ Examples of code with the default options:
24
19
 
25
20
  <!--tabs-->
26
21
 
@@ -44,9 +39,11 @@ declare module 'foo' {}
44
39
 
45
40
  <!--/tabs-->
46
41
 
42
+ ## Options
43
+
47
44
  ### `allowDeclarations`
48
45
 
49
- Examples of code for the `{ "allowDeclarations": true }` option:
46
+ Examples of code with the `{ "allowDeclarations": true }` option:
50
47
 
51
48
  <!--tabs-->
52
49
 
@@ -131,7 +128,3 @@ If you are using the ES2015 module syntax, then you will not need this rule.
131
128
  - [Modules](https://www.typescriptlang.org/docs/handbook/modules.html)
132
129
  - [Namespaces](https://www.typescriptlang.org/docs/handbook/namespaces.html)
133
130
  - [Namespaces and Modules](https://www.typescriptlang.org/docs/handbook/namespaces-and-modules.html)
134
-
135
- ## Related To
136
-
137
- - TSLint: [no-namespace](https://palantir.github.io/tslint/rules/no-namespace/)
@@ -1,6 +1,10 @@
1
- # `no-non-null-asserted-nullish-coalescing`
1
+ ---
2
+ description: 'Disallow non-null assertions in the left operand of a nullish coalescing operator.'
3
+ ---
2
4
 
3
- Disallows non-null assertions in the left operand of a nullish coalescing operator.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-non-null-asserted-nullish-coalescing** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
@@ -45,19 +49,6 @@ let x: string;
45
49
  x! ?? '';
46
50
  ```
47
51
 
48
- ## Options
49
-
50
- ```jsonc
51
- // .eslintrc.json
52
- {
53
- "rules": {
54
- "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "warn"
55
- }
56
- }
57
- ```
58
-
59
- This rule is not configurable.
60
-
61
52
  ## When Not To Use It
62
53
 
63
54
  If you are not using TypeScript 3.7 (or greater), then you will not need to use this rule, as the nullish coalescing operator is not supported.
@@ -1,6 +1,10 @@
1
- # `no-non-null-asserted-optional-chain`
1
+ ---
2
+ description: 'Disallow non-null assertions after an optional chain expression.'
3
+ ---
2
4
 
3
- Disallows non-null assertions after an optional chain expression.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-non-null-asserted-optional-chain** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
@@ -44,19 +48,6 @@ foo?.bar!();
44
48
  foo?.bar!().baz;
45
49
  ```
46
50
 
47
- ## Options
48
-
49
- ```jsonc
50
- // .eslintrc.json
51
- {
52
- "rules": {
53
- "@typescript-eslint/no-non-null-asserted-optional-chain": "error"
54
- }
55
- }
56
- ```
57
-
58
- This rule is not configurable.
59
-
60
51
  ## When Not To Use It
61
52
 
62
53
  If you are not using TypeScript 3.7 (or greater), then you will not need to use this rule, as the operator is not supported.
@@ -1,6 +1,10 @@
1
- # `no-non-null-assertion`
1
+ ---
2
+ description: 'Disallow non-null assertions using the `!` postfix operator.'
3
+ ---
2
4
 
3
- Disallows non-null assertions using the `!` postfix operator.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-non-null-assertion** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
@@ -32,23 +36,6 @@ const foo: Foo = getFoo();
32
36
  const includesBaz: boolean = foo.bar?.includes('baz') ?? false;
33
37
  ```
34
38
 
35
- ## Options
36
-
37
- ```jsonc
38
- // .eslintrc.json
39
- {
40
- "rules": {
41
- "@typescript-eslint/no-non-null-assertion": "warn"
42
- }
43
- }
44
- ```
45
-
46
- This rule is not configurable.
47
-
48
39
  ## When Not To Use It
49
40
 
50
41
  If you don't care about strict null-checking, then you will not need this rule.
51
-
52
- ## Further Reading
53
-
54
- - [`no-non-null-assertion`](https://palantir.github.io/tslint/rules/no-non-null-assertion/) in [TSLint](https://palantir.github.io/tslint/)
@@ -1,6 +1,15 @@
1
- # `no-parameter-properties`
1
+ ---
2
+ description: 'Disallow the use of parameter properties in class constructors.'
3
+ ---
2
4
 
3
- Disallows the use of parameter properties in class constructors.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-parameter-properties** for documentation.
8
+
9
+ :::danger Deprecated
10
+
11
+ This rule has been deprecated in favour of the equivalent, better named [`parameter-properties`](./parameter-properties) rule.
12
+ :::
4
13
 
5
14
  Parameter properties can be confusing to those new to TypeScript as they are less explicit than other ways
6
15
  of declaring and initializing class members.
@@ -395,7 +404,3 @@ class Foo {
395
404
  ## When Not To Use It
396
405
 
397
406
  If you don't care about the using parameter properties in constructors, then you will not need this rule.
398
-
399
- ## Related To
400
-
401
- - TSLint: [no-parameter-properties](https://palantir.github.io/tslint/rules/no-parameter-properties/)
@@ -1,25 +1,18 @@
1
- # `no-redeclare`
1
+ ---
2
+ description: 'Disallow variable redeclaration.'
3
+ ---
2
4
 
3
- Disallows variable redeclaration.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-redeclare** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
7
11
  This rule extends the base [`eslint/no-redeclare`](https://eslint.org/docs/rules/no-redeclare) rule.
8
12
  It adds support for TypeScript function overloads, and declaration merging.
9
13
 
10
- ## How to Use
11
-
12
- ```jsonc
13
- {
14
- // note you must disable the base rule as it can report incorrect errors
15
- "no-redeclare": "off",
16
- "@typescript-eslint/no-redeclare": ["error"]
17
- }
18
- ```
19
-
20
14
  ## Options
21
15
 
22
- See [`eslint/no-redeclare` options](https://eslint.org/docs/rules/no-redeclare#options).
23
16
  This rule adds the following options:
24
17
 
25
18
  ```ts
@@ -78,9 +71,3 @@ type something = string;
78
71
  // eslint-disable-next-line @typescript-eslint/no-redeclare -- intentionally naming the variable the same as the type
79
72
  const something = 2;
80
73
  ```
81
-
82
- <sup>
83
-
84
- Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-redeclare.md)
85
-
86
- </sup>
@@ -1,6 +1,10 @@
1
- # `no-redundant-type-constituents`
1
+ ---
2
+ description: 'Disallow members of unions and intersections that do nothing or override type information.'
3
+ ---
2
4
 
3
- Disallows members of unions and intersections that do nothing or override type information.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-redundant-type-constituents** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
@@ -66,19 +70,6 @@ type IntersectionStringLiteral = 'foo';
66
70
  type ReturnUnionNever = () => string | never;
67
71
  ```
68
72
 
69
- ## Options
70
-
71
- ```jsonc
72
- // .eslintrc.json
73
- {
74
- "rules": {
75
- "@typescript-eslint/no-redundant-type-constituents": "warn"
76
- }
77
- }
78
- ```
79
-
80
- This rule is not configurable.
81
-
82
73
  ## Limitations
83
74
 
84
75
  This rule plays it safe and only works with bottom types, top types, and comparing literal types to primitive types.
@@ -1,6 +1,10 @@
1
- # `no-require-imports`
1
+ ---
2
+ description: 'Disallow invocation of `require()`.'
3
+ ---
2
4
 
3
- Disallows invocation of `require()`.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-require-imports** for documentation.
4
8
 
5
9
  Prefer the newer ES6-style imports over `require()`.
6
10
 
@@ -31,23 +35,6 @@ import lib9 = lib2.anotherSubImport;
31
35
  import lib10 from 'lib10';
32
36
  ```
33
37
 
34
- ## Options
35
-
36
- ```jsonc
37
- // .eslintrc.json
38
- {
39
- "rules": {
40
- "@typescript-eslint/no-require-imports": "warn"
41
- }
42
- }
43
- ```
44
-
45
- This rule is not configurable.
46
-
47
38
  ## When Not To Use It
48
39
 
49
40
  If you don't care about TypeScript module syntax, then you will not need this rule.
50
-
51
- ## Related To
52
-
53
- - TSLint: [no-require-imports](https://palantir.github.io/tslint/rules/no-require-imports/)
@@ -1,24 +1,17 @@
1
- # `no-restricted-imports`
1
+ ---
2
+ description: 'Disallow specified modules when loaded by `import`.'
3
+ ---
2
4
 
3
- Disallows specified modules when loaded by `import`.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-restricted-imports** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
7
11
  This rule extends the base [`eslint/no-restricted-imports`](https://eslint.org/docs/rules/no-restricted-imports) rule.
8
12
 
9
- ## How to Use
10
-
11
- ```jsonc
12
- {
13
- // note you must disable the base rule as it can report incorrect errors
14
- "no-restricted-imports": "off",
15
- "@typescript-eslint/no-restricted-imports": ["error"]
16
- }
17
- ```
18
-
19
13
  ## Options
20
14
 
21
- See [`eslint/no-restricted-imports` options](https://eslint.org/docs/rules/no-restricted-imports#options).
22
15
  This rule adds the following options:
23
16
 
24
17
  ### `allowTypeImports`
@@ -1,25 +1,18 @@
1
- # `no-shadow`
1
+ ---
2
+ description: 'Disallow variable declarations from shadowing variables declared in the outer scope.'
3
+ ---
2
4
 
3
- Disallows variable declarations from shadowing variables declared in the outer scope.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-shadow** for documentation.
4
8
 
5
9
  ## Rule Details
6
10
 
7
11
  This rule extends the base [`eslint/no-shadow`](https://eslint.org/docs/rules/no-shadow) rule.
8
12
  It adds support for TypeScript's `this` parameters and global augmentation, and adds options for TypeScript features.
9
13
 
10
- ## How to Use
11
-
12
- ```jsonc
13
- {
14
- // note you must disable the base rule as it can report incorrect errors
15
- "no-shadow": "off",
16
- "@typescript-eslint/no-shadow": ["error"]
17
- }
18
- ```
19
-
20
14
  ## Options
21
15
 
22
- See [`eslint/no-shadow` options](https://eslint.org/docs/rules/no-shadow#options).
23
16
  This rule adds the following options:
24
17
 
25
18
  ```ts
@@ -85,9 +78,3 @@ Examples of **correct** code with `{ ignoreFunctionTypeParameterNameValueShadow:
85
78
  const test = 1;
86
79
  type Func = (test: string) => typeof test;
87
80
  ```
88
-
89
- <sup>
90
-
91
- Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-shadow.md)
92
-
93
- </sup>
@@ -1,33 +1,35 @@
1
- # `no-this-alias`
1
+ ---
2
+ description: 'Disallow aliasing `this`.'
3
+ ---
2
4
 
3
- Disallows aliasing `this`.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-this-alias** for documentation.
4
8
 
5
9
  This rule prohibits assigning variables to `this`.
6
10
 
7
11
  ## Rule Details
8
12
 
9
- Rationale from TSLint:
13
+ Assigning a variable to `this` instead of properly using arrow lambdas may be a symptom of pre-ES6 practices
14
+ or not managing scope well.
10
15
 
11
- > Assigning a variable to `this` instead of properly using arrow lambdas may be a symptom of pre-ES6 practices
12
- > or not managing scope well.
13
- >
14
- > Instead of storing a reference to `this` and using it inside a `function () {`:
15
- >
16
- > ```js
17
- > const self = this;
18
- >
19
- > setTimeout(function () {
20
- > self.doWork();
21
- > });
22
- > ```
23
- >
24
- > Use `() =>` arrow lambdas, as they preserve `this` scope for you:
16
+ Instead of storing a reference to `this` and using it inside a `function () {`:
17
+
18
+ ```js
19
+ const self = this;
25
20
  >
26
- > ```js
27
- > setTimeout(() => {
28
- > this.doWork();
29
- > });
30
- > ```
21
+ setTimeout(function () {
22
+ self.doWork();
23
+ });
24
+ ```
25
+
26
+ Use `() =>` arrow lambdas, as they preserve `this` scope for you:
27
+
28
+ ```js
29
+ setTimeout(() => {
30
+ this.doWork();
31
+ });
32
+ ```
31
33
 
32
34
  Examples of **incorrect** code for this rule:
33
35
 
@@ -37,26 +39,6 @@ Examples of **correct** code for this rule:
37
39
 
38
40
  (see the rationale above)
39
41
 
40
- ## Options
41
-
42
- You can pass an object option:
43
-
44
- ```jsonc
45
- {
46
- "@typescript-eslint/no-this-alias": [
47
- "error",
48
- {
49
- "allowDestructuring": false, // Disallow `const { props, state } = this`; true by default
50
- "allowedNames": ["self"] // Allow `const self = this`; `[]` by default
51
- }
52
- ]
53
- }
54
- ```
55
-
56
42
  ## When Not To Use It
57
43
 
58
44
  If you need to assign `this` to variables, you shouldn’t use this rule.
59
-
60
- ## Related To
61
-
62
- - TSLint: [`no-this-assignment`](https://palantir.github.io/tslint/rules/no-this-assignment/)
@@ -1,6 +1,10 @@
1
- # `no-throw-literal`
1
+ ---
2
+ description: 'Disallow throwing literals as exceptions.'
3
+ ---
2
4
 
3
- Disallows throwing literals as exceptions.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-throw-literal** for documentation.
4
8
 
5
9
  It is considered good practice to only `throw` the `Error` object itself or an object using the `Error` object as base objects for user-defined exceptions.
6
10
  The fundamental benefit of `Error` objects is that they automatically keep track of where they were built and originated.
@@ -85,34 +89,26 @@ class CustomError extends Error {
85
89
  throw new CustomError();
86
90
  ```
87
91
 
88
- ## How to Use
92
+ ## Options
89
93
 
90
- ```jsonc
91
- {
92
- // note you must disable the base rule as it can report incorrect errors
93
- "no-throw-literal": "off",
94
- "@typescript-eslint/no-throw-literal": ["error"]
95
- }
96
- ```
94
+ This rule adds the following options:
97
95
 
98
- ### Options
99
-
100
- ```jsonc
101
- {
102
- "@typescript-eslint/no-throw-literal": [
103
- "error",
104
- {
105
- "allowThrowingAny": true, // Default is to allow throwing values of type any
106
- "allowThrowingUnknown": true // Default is to allow throwing values of type unknown
107
- }
108
- ]
96
+ ```ts
97
+ interface Options extends BaseNoShadowOptions {
98
+ /**
99
+ * Whether to always allow throwing values typed as `any`.
100
+ */
101
+ allowThrowingAny?: boolean;
102
+
103
+ /**
104
+ * Whether to always allow throwing values typed as `unknown`.
105
+ */
106
+ allowThrowingUnknown?: boolean;
109
107
  }
110
- ```
111
108
 
112
- ---
113
-
114
- <sup>
115
-
116
- Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-throw-literal.md)
117
-
118
- </sup>
109
+ const defaultOptions: Options = {
110
+ ...baseNoShadowDefaultOptions,
111
+ allowThrowingAny: false,
112
+ allowThrowingUnknown: false,
113
+ };
114
+ ```
@@ -1,6 +1,10 @@
1
- # `no-type-alias`
1
+ ---
2
+ description: 'Disallow type aliases.'
3
+ ---
2
4
 
3
- Disallows type aliases.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-type-alias** for documentation.
4
8
 
5
9
  In TypeScript, type aliases serve three purposes:
6
10
 
@@ -81,18 +85,6 @@ and simplified types (primitives, tuples, unions, intersections, etc).
81
85
 
82
86
  ## Options
83
87
 
84
- This rule, in its default state, does not require any argument. If you would like to enable one
85
- or more of the following you may pass an object with the options set as follows:
86
-
87
- - `allowAliases` set to `"always"` will allow you to do aliasing (Defaults to `"never"`).
88
- - `allowCallbacks` set to `"always"` will allow you to use type aliases with callbacks (Defaults to `"never"`)
89
- - `allowConditionalTypes` set to `"always"` will allow you to use type aliases with conditional types (Defaults to `"never"`)
90
- - `allowConstructors` set to `"always"` will allow you to use type aliases with constructors (Defaults to `"never"`)
91
- - `allowLiterals` set to `"always"` will allow you to use type aliases with literal objects (Defaults to `"never"`)
92
- - `allowMappedTypes` set to `"always"` will allow you to use type aliases as mapping tools (Defaults to `"never"`)
93
- - `allowTupleTypes` set to `"always"` will allow you to use type aliases with tuples (Defaults to `"never"`)
94
- - `allowGenerics` set to `"always"` will allow you to use type aliases with generics (Defaults to `"never"`)
95
-
96
88
  ### `allowAliases`
97
89
 
98
90
  This applies to primitive types and reference types.
@@ -608,7 +600,3 @@ callback, etc. that would cause the code to be unreadable or impractical.
608
600
  ## Further Reading
609
601
 
610
602
  - [Advanced Types](https://www.typescriptlang.org/docs/handbook/advanced-types.html)
611
-
612
- ## Related To
613
-
614
- - TSLint: [interface-over-type-literal](https://palantir.github.io/tslint/rules/interface-over-type-literal/)
@@ -1,6 +1,10 @@
1
- # `no-unnecessary-boolean-literal-compare`
1
+ ---
2
+ description: 'Disallow unnecessary equality comparisons against boolean literals.'
3
+ ---
2
4
 
3
- Disallows unnecessary equality comparisons against boolean literals.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare** for documentation.
4
8
 
5
9
  Comparing boolean values to boolean literals is unnecessary, those comparisons result in the same booleans. Using the boolean values directly, or via a unary negation (`!value`), is more concise and clearer.
6
10
 
@@ -50,30 +54,10 @@ if (someStringBoolean === true) {
50
54
 
51
55
  ## Options
52
56
 
53
- The rule accepts an options object with the following properties.
54
-
55
- ```ts
56
- type Options = {
57
- // if false, comparisons between a nullable boolean variable to `true` will be checked and fixed
58
- allowComparingNullableBooleansToTrue?: boolean;
59
- // if false, comparisons between a nullable boolean variable to `false` will be checked and fixed
60
- allowComparingNullableBooleansToFalse?: boolean;
61
- };
62
- ```
63
-
64
- ### Defaults
65
-
66
57
  This rule always checks comparisons between a boolean variable and a boolean
67
58
  literal. Comparisons between nullable boolean variables and boolean literals
68
59
  are **not** checked by default.
69
60
 
70
- ```ts
71
- const defaults = {
72
- allowComparingNullableBooleansToTrue: true,
73
- allowComparingNullableBooleansToFalse: true,
74
- };
75
- ```
76
-
77
61
  ### `allowComparingNullableBooleansToTrue`
78
62
 
79
63
  Examples of code for this rule with `{ allowComparingNullableBooleansToTrue: false }`:
@@ -146,7 +130,3 @@ if (!(someNullCondition ?? true)) {
146
130
  | `nullableBooleanVar !== true` | `!nullableBooleanVar` | Only checked/fixed if the `allowComparingNullableBooleansToTrue` option is `false` |
147
131
  | `nullableBooleanVar === false` | `nullableBooleanVar ?? true` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` |
148
132
  | `nullableBooleanVar !== false` | `!(nullableBooleanVar ?? true)` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` |
149
-
150
- ## Related To
151
-
152
- - TSLint: [no-boolean-literal-compare](https://palantir.github.io/tslint/rules/no-boolean-literal-compare)
@@ -1,6 +1,10 @@
1
- # `no-unnecessary-condition`
1
+ ---
2
+ description: 'Disallow conditionals where the type is always truthy or always falsy.'
3
+ ---
2
4
 
3
- Disallows conditionals where the type is always truthy or always falsy.
5
+ > 🛑 This file is source code, not the primary documentation location! 🛑
6
+ >
7
+ > See **https://typescript-eslint.io/rules/no-unnecessary-condition** for documentation.
4
8
 
5
9
  Any expression being used as a condition must be able to evaluate as truthy or falsy in order to be considered "necessary". Conversely, any expression that always evaluates to truthy or always evaluates to falsy, as determined by the type of the expression, is considered unnecessary and will be flagged by this rule.
6
10
 
@@ -70,20 +74,6 @@ function bar(arg?: string | null) {
70
74
 
71
75
  ## Options
72
76
 
73
- ```ts
74
- type Options = {
75
- // if true, the rule will ignore constant loop conditions
76
- allowConstantLoopConditions?: boolean;
77
- // if true, the rule will not error when running with a tsconfig that has strictNullChecks turned **off**
78
- allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean;
79
- };
80
-
81
- const defaultOptions: Options = {
82
- allowConstantLoopConditions: false,
83
- allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
84
- };
85
- ```
86
-
87
77
  ### `allowConstantLoopConditions`
88
78
 
89
79
  Example of correct code for `{ allowConstantLoopConditions: true }`: