xo 0.52.4 → 0.53.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 (355) hide show
  1. package/cli.js +1 -0
  2. package/index.js +6 -11
  3. package/node_modules/@types/semver/LICENSE +21 -0
  4. package/node_modules/@types/semver/README.md +16 -0
  5. package/node_modules/@types/semver/classes/comparator.d.ts +17 -0
  6. package/node_modules/@types/semver/classes/range.d.ts +21 -0
  7. package/node_modules/@types/semver/classes/semver.d.ts +62 -0
  8. package/node_modules/@types/semver/functions/clean.d.ts +8 -0
  9. package/node_modules/@types/semver/functions/cmp.d.ts +16 -0
  10. package/node_modules/@types/semver/functions/coerce.d.ts +12 -0
  11. package/node_modules/@types/semver/functions/compare-build.d.ts +21 -0
  12. package/node_modules/@types/semver/functions/compare-loose.d.ts +5 -0
  13. package/node_modules/@types/semver/functions/compare.d.ts +20 -0
  14. package/node_modules/@types/semver/functions/diff.d.ts +9 -0
  15. package/node_modules/@types/semver/functions/eq.d.ts +9 -0
  16. package/node_modules/@types/semver/functions/gt.d.ts +9 -0
  17. package/node_modules/@types/semver/functions/gte.d.ts +9 -0
  18. package/node_modules/@types/semver/functions/inc.d.ts +15 -0
  19. package/node_modules/@types/semver/functions/lt.d.ts +9 -0
  20. package/node_modules/@types/semver/functions/lte.d.ts +8 -0
  21. package/node_modules/@types/semver/functions/major.d.ts +9 -0
  22. package/node_modules/@types/semver/functions/minor.d.ts +9 -0
  23. package/node_modules/@types/semver/functions/neq.d.ts +9 -0
  24. package/node_modules/@types/semver/functions/parse.d.ts +12 -0
  25. package/node_modules/@types/semver/functions/patch.d.ts +9 -0
  26. package/node_modules/@types/semver/functions/prerelease.d.ts +12 -0
  27. package/node_modules/@types/semver/functions/rcompare.d.ts +15 -0
  28. package/node_modules/@types/semver/functions/rsort.d.ts +9 -0
  29. package/node_modules/@types/semver/functions/satisfies.d.ts +14 -0
  30. package/node_modules/@types/semver/functions/sort.d.ts +9 -0
  31. package/node_modules/@types/semver/functions/valid.d.ts +11 -0
  32. package/node_modules/@types/semver/index.d.ts +136 -0
  33. package/node_modules/@types/semver/internals/identifiers.d.ts +13 -0
  34. package/node_modules/@types/semver/package.json +50 -0
  35. package/node_modules/@types/semver/preload.d.ts +2 -0
  36. package/node_modules/@types/semver/ranges/gtr.d.ts +14 -0
  37. package/node_modules/@types/semver/ranges/intersects.d.ts +13 -0
  38. package/node_modules/@types/semver/ranges/ltr.d.ts +14 -0
  39. package/node_modules/@types/semver/ranges/max-satisfying.d.ts +14 -0
  40. package/node_modules/@types/semver/ranges/min-satisfying.d.ts +14 -0
  41. package/node_modules/@types/semver/ranges/min-version.d.ts +10 -0
  42. package/node_modules/@types/semver/ranges/outside.d.ts +15 -0
  43. package/node_modules/@types/semver/ranges/simplify.d.ts +14 -0
  44. package/node_modules/@types/semver/ranges/subset.d.ts +9 -0
  45. package/node_modules/@types/semver/ranges/to-comparators.d.ts +9 -0
  46. package/node_modules/@types/semver/ranges/valid.d.ts +12 -0
  47. package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js +2 -1
  48. package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/all.js.map +1 -1
  49. package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict.js +1 -0
  50. package/node_modules/@typescript-eslint/eslint-plugin/dist/configs/strict.js.map +1 -1
  51. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js +1 -1
  52. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js.map +1 -1
  53. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js +1 -1
  54. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/array-type.js.map +1 -1
  55. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js +1 -1
  56. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/ban-ts-comment.js.map +1 -1
  57. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js +1 -1
  58. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-spacing.js.map +1 -1
  59. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style.js +1 -1
  60. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-indexed-object-style.js.map +1 -1
  61. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js +99 -24
  62. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js.map +1 -1
  63. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js +4 -0
  64. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js.map +1 -1
  65. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.js +2 -2
  66. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-delimiter-style.js.map +1 -1
  67. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js +29 -10
  68. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/member-ordering.js.map +1 -1
  69. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/enums.js +4 -0
  70. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/enums.js.map +1 -1
  71. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/schema.js +19 -2
  72. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention-utils/schema.js.map +1 -1
  73. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js +29 -0
  74. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/naming-convention.js.map +1 -1
  75. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js +1 -1
  76. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-base-to-string.js.map +1 -1
  77. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.js +1 -1
  78. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-non-null-assertion.js.map +1 -1
  79. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js +14 -2
  80. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-extra-parens.js.map +1 -1
  81. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js +11 -5
  82. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js.map +1 -1
  83. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js +51 -11
  84. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js.map +1 -1
  85. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js +2 -2
  86. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js.map +1 -1
  87. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js +1 -2
  88. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js.map +1 -1
  89. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js +4 -3
  90. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js.map +1 -1
  91. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-declaration-merging.js +78 -0
  92. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-declaration-merging.js.map +1 -0
  93. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js +0 -3
  94. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js.map +1 -1
  95. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js +167 -68
  96. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js.map +1 -1
  97. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js +2 -1
  98. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js.map +1 -1
  99. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js +1 -1
  100. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js.map +1 -1
  101. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.js +245 -0
  102. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.js.map +1 -0
  103. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members.js +3 -0
  104. package/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-union-intersection-members.js.map +1 -1
  105. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/TEMPLATE.md +1 -1
  106. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/adjacent-overload-signatures.md +5 -5
  107. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/array-type.md +4 -6
  108. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/await-thenable.md +5 -4
  109. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-ts-comment.md +3 -4
  110. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-tslint-comment.md +2 -2
  111. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/ban-types.md +2 -2
  112. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/brace-style.md +1 -1
  113. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/class-literal-property-style.md +4 -4
  114. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-dangle.md +1 -1
  115. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/comma-spacing.md +1 -1
  116. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-generic-constructors.md +3 -3
  117. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-indexed-object-style.md +1 -3
  118. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-assertions.md +12 -5
  119. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-definitions.md +4 -1
  120. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-exports.md +7 -13
  121. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/consistent-type-imports.md +47 -6
  122. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/default-param-last.md +1 -1
  123. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/dot-notation.md +1 -1
  124. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-function-return-type.md +7 -6
  125. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-member-accessibility.md +10 -6
  126. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/explicit-module-boundary-types.md +3 -3
  127. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/func-call-spacing.md +1 -1
  128. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/indent.md +1 -1
  129. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/init-declarations.md +1 -1
  130. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/keyword-spacing.md +1 -1
  131. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/lines-between-class-members.md +1 -1
  132. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-delimiter-style.md +7 -60
  133. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/member-ordering.md +19 -6
  134. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/method-signature-style.md +6 -6
  135. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/naming-convention.md +29 -30
  136. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-array-constructor.md +1 -1
  137. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-base-to-string.md +12 -11
  138. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md +4 -2
  139. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-confusing-void-expression.md +4 -5
  140. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dupe-class-members.md +1 -1
  141. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-duplicate-enum-values.md +5 -2
  142. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-dynamic-delete.md +4 -4
  143. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-function.md +1 -1
  144. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-empty-interface.md +5 -5
  145. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-explicit-any.md +13 -8
  146. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-non-null-assertion.md +4 -3
  147. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-parens.md +1 -1
  148. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extra-semi.md +1 -1
  149. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-extraneous-class.md +4 -6
  150. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md +2 -4
  151. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-for-in-array.md +26 -18
  152. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implicit-any-catch.md +1 -3
  153. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-implied-eval.md +1 -3
  154. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-inferrable-types.md +12 -43
  155. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-this.md +1 -1
  156. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-invalid-void-type.md +6 -13
  157. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loop-func.md +1 -1
  158. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-loss-of-precision.md +1 -1
  159. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-magic-numbers.md +1 -1
  160. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-meaningless-void-operator.md +8 -21
  161. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-new.md +13 -6
  162. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-misused-promises.md +53 -91
  163. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-namespace.md +6 -7
  164. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md +3 -13
  165. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md +4 -27
  166. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-non-null-assertion.md +14 -13
  167. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-parameter-properties.md +1 -1
  168. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redeclare.md +1 -1
  169. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-redundant-type-constituents.md +1 -6
  170. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-require-imports.md +12 -15
  171. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-restricted-imports.md +1 -1
  172. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-shadow.md +1 -1
  173. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-this-alias.md +9 -15
  174. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-throw-literal.md +1 -3
  175. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-type-alias.md +1 -1
  176. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md +15 -14
  177. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-condition.md +3 -4
  178. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +12 -46
  179. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md +22 -8
  180. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +4 -6
  181. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +6 -20
  182. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-argument.md +10 -7
  183. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-assignment.md +9 -6
  184. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-call.md +6 -5
  185. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-declaration-merging.md +54 -0
  186. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-member-access.md +5 -4
  187. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unsafe-return.md +9 -6
  188. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-expressions.md +1 -1
  189. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-unused-vars.md +1 -1
  190. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-use-before-define.md +1 -1
  191. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-constructor.md +1 -1
  192. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-useless-empty-export.md +4 -4
  193. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-var-requires.md +6 -4
  194. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md +7 -3
  195. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/object-curly-spacing.md +1 -1
  196. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/padding-line-between-statements.md +1 -1
  197. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/parameter-properties.md +3 -6
  198. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-as-const.md +7 -3
  199. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-enum-initializers.md +5 -23
  200. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-for-of.md +15 -16
  201. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-function-type.md +22 -22
  202. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-includes.md +28 -30
  203. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-literal-enum-member.md +12 -13
  204. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-namespace-keyword.md +27 -4
  205. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-nullish-coalescing.md +6 -54
  206. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-optional-chain.md +21 -49
  207. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md +1 -3
  208. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-readonly.md +3 -5
  209. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md +6 -8
  210. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-regexp-exec.md +6 -11
  211. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-return-this-type.md +10 -25
  212. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +10 -6
  213. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/prefer-ts-expect-error.md +5 -11
  214. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/promise-function-async.md +1 -1
  215. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/quotes.md +1 -1
  216. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-array-sort-compare.md +5 -14
  217. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/require-await.md +1 -1
  218. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-plus-operands.md +18 -4
  219. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/restrict-template-expressions.md +9 -2
  220. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/return-await.md +1 -1
  221. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/semi.md +1 -1
  222. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-constituents.md +101 -0
  223. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/sort-type-union-intersection-members.md +8 -16
  224. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-blocks.md +1 -1
  225. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/space-before-function-paren.md +1 -1
  226. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/strict-boolean-expressions.md +0 -2
  227. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +15 -24
  228. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/triple-slash-reference.md +4 -2
  229. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/type-annotation-spacing.md +1 -1
  230. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/typedef.md +5 -7
  231. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unbound-method.md +7 -4
  232. package/node_modules/@typescript-eslint/eslint-plugin/docs/rules/unified-signatures.md +5 -3
  233. package/node_modules/@typescript-eslint/eslint-plugin/package.json +7 -5
  234. package/node_modules/@typescript-eslint/parser/README.md +2 -0
  235. package/node_modules/@typescript-eslint/parser/package.json +5 -5
  236. package/node_modules/@typescript-eslint/scope-manager/package.json +5 -5
  237. package/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.d.ts.map +1 -1
  238. package/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.js +3 -0
  239. package/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.js.map +1 -1
  240. package/node_modules/@typescript-eslint/type-utils/package.json +5 -5
  241. package/node_modules/@typescript-eslint/types/_ts3.4/dist/generated/ast-spec.d.ts +3 -3
  242. package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts +3 -3
  243. package/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts.map +1 -1
  244. package/node_modules/@typescript-eslint/types/package.json +2 -2
  245. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/ast-converter.d.ts +2 -2
  246. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createDefaultProgram.d.ts +3 -6
  247. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createIsolatedProgram.d.ts +2 -2
  248. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createProjectProgram.d.ts +4 -6
  249. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createSourceFile.d.ts +2 -2
  250. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/createWatchProgram.d.ts +4 -7
  251. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/shared.d.ts +5 -4
  252. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/create-program/useProvidedPrograms.d.ts +2 -2
  253. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parseSettings/createParseSettings.d.ts +4 -0
  254. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parseSettings/index.d.ts +102 -0
  255. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parseSettings/inferSingleRun.d.ts +15 -0
  256. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parseSettings/warnAboutTSVersion.d.ts +3 -0
  257. package/node_modules/@typescript-eslint/typescript-estree/_ts3.4/dist/parser-options.d.ts +0 -26
  258. package/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts +2 -2
  259. package/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts.map +1 -1
  260. package/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js +8 -8
  261. package/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js.map +1 -1
  262. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.d.ts +3 -6
  263. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.d.ts.map +1 -1
  264. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.js +13 -15
  265. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createDefaultProgram.js.map +1 -1
  266. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts +2 -2
  267. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts.map +1 -1
  268. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js +7 -7
  269. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js.map +1 -1
  270. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts +4 -6
  271. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts.map +1 -1
  272. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js +51 -38
  273. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js.map +1 -1
  274. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts +2 -2
  275. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts.map +1 -1
  276. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js +4 -4
  277. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js.map +1 -1
  278. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.d.ts +4 -7
  279. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.d.ts.map +1 -1
  280. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js +21 -22
  281. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createWatchProgram.js.map +1 -1
  282. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts +5 -4
  283. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts.map +1 -1
  284. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js +7 -7
  285. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js.map +1 -1
  286. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.d.ts +2 -2
  287. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.d.ts.map +1 -1
  288. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js +4 -4
  289. package/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js.map +1 -1
  290. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.d.ts +4 -0
  291. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.d.ts.map +1 -0
  292. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js +145 -0
  293. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js.map +1 -0
  294. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.d.ts +102 -0
  295. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.d.ts.map +1 -0
  296. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.js +3 -0
  297. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.js.map +1 -0
  298. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.d.ts +15 -0
  299. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.d.ts.map +1 -0
  300. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.js +53 -0
  301. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.js.map +1 -0
  302. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.d.ts +3 -0
  303. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.d.ts.map +1 -0
  304. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js +68 -0
  305. package/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js.map +1 -0
  306. package/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts +0 -26
  307. package/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts.map +1 -1
  308. package/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts.map +1 -1
  309. package/node_modules/@typescript-eslint/typescript-estree/dist/parser.js +32 -388
  310. package/node_modules/@typescript-eslint/typescript-estree/dist/parser.js.map +1 -1
  311. package/node_modules/@typescript-eslint/typescript-estree/package.json +5 -5
  312. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/batchedSingleLineTests.d.ts +1 -1
  313. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/index.d.ts +1 -1
  314. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/rule-tester/RuleTester.d.ts +48 -0
  315. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/rule-tester/dependencyConstraints.d.ts +17 -0
  316. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/ts-eslint/RuleTester.d.ts +21 -17
  317. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/batchedSingleLineTests.d.ts +1 -1
  318. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/batchedSingleLineTests.d.ts.map +1 -1
  319. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/batchedSingleLineTests.js.map +1 -1
  320. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.d.ts +1 -1
  321. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.d.ts.map +1 -1
  322. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js +1 -1
  323. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js.map +1 -1
  324. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/rule-tester/RuleTester.d.ts +49 -0
  325. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/rule-tester/RuleTester.d.ts.map +1 -0
  326. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/rule-tester/RuleTester.js +238 -0
  327. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/rule-tester/RuleTester.js.map +1 -0
  328. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/rule-tester/dependencyConstraints.d.ts +17 -0
  329. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/rule-tester/dependencyConstraints.d.ts.map +1 -0
  330. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/rule-tester/dependencyConstraints.js +52 -0
  331. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/rule-tester/dependencyConstraints.js.map +1 -0
  332. package/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.d.ts +16 -9
  333. package/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.d.ts.map +1 -1
  334. package/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.js.map +1 -1
  335. package/node_modules/@typescript-eslint/utils/package.json +9 -6
  336. package/node_modules/@typescript-eslint/visitor-keys/package.json +3 -3
  337. package/node_modules/eslint-config-xo-typescript/index.js +7 -1
  338. package/node_modules/eslint-config-xo-typescript/package.json +5 -5
  339. package/node_modules/natural-compare-lite/README.md +126 -0
  340. package/node_modules/natural-compare-lite/index.js +57 -0
  341. package/node_modules/natural-compare-lite/package.json +42 -0
  342. package/node_modules/semver/classes/range.js +3 -0
  343. package/node_modules/semver/index.js +81 -41
  344. package/node_modules/{lru-cache → semver/node_modules/lru-cache}/LICENSE +0 -0
  345. package/node_modules/{lru-cache → semver/node_modules/lru-cache}/README.md +0 -0
  346. package/node_modules/{lru-cache → semver/node_modules/lru-cache}/index.js +0 -0
  347. package/node_modules/{lru-cache → semver/node_modules/lru-cache}/package.json +0 -0
  348. package/node_modules/semver/package.json +21 -10
  349. package/package.json +24 -24
  350. package/readme.md +1 -1
  351. package/node_modules/@typescript-eslint/utils/_ts3.4/dist/eslint-utils/RuleTester.d.ts +0 -18
  352. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleTester.d.ts +0 -18
  353. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleTester.d.ts.map +0 -1
  354. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleTester.js +0 -133
  355. package/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleTester.js.map +0 -1
@@ -6,36 +6,37 @@ description: 'Disallow non-null assertions using the `!` postfix operator.'
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-non-null-assertion** for documentation.
8
8
 
9
- ## Rule Details
9
+ TypeScript's `!` non-null assertion operator asserts to the type system that an expression is non-nullable, as in not `null` or `undefined`.
10
+ Using assertions to tell the type system new information is often a sign that code is not fully type-safe.
11
+ It's generally better to structure program logic so that TypeScript understands when values may be nullable.
10
12
 
11
- Using non-null assertions cancels the benefits of the strict null-checking mode.
12
-
13
- Examples of code for this rule:
13
+ ## Examples
14
14
 
15
15
  <!--tabs-->
16
16
 
17
17
  ### ❌ Incorrect
18
18
 
19
19
  ```ts
20
- interface Foo {
21
- bar?: string;
20
+ interface Example {
21
+ property?: string;
22
22
  }
23
23
 
24
- const foo: Foo = getFoo();
25
- const includesBaz: boolean = foo.bar!.includes('baz');
24
+ declare const example: Example;
25
+ const includesBaz = foo.property!.includes('baz');
26
26
  ```
27
27
 
28
28
  ### ✅ Correct
29
29
 
30
30
  ```ts
31
- interface Foo {
32
- bar?: string;
31
+ interface Example {
32
+ property?: string;
33
33
  }
34
34
 
35
- const foo: Foo = getFoo();
36
- const includesBaz: boolean = foo.bar?.includes('baz') ?? false;
35
+ declare const example: Example;
36
+ const includesBaz = foo.property?.includes('baz') ?? false;
37
37
  ```
38
38
 
39
39
  ## When Not To Use It
40
40
 
41
- If you don't care about strict null-checking, then you will not need this rule.
41
+ If your project does not use the `strictNullChecks` compiler option, this rule is likely useless to you.
42
+ If your code is often wildly incorrect with respect to strict null-checking, your code may not yet be ready for this rule.
@@ -14,7 +14,7 @@ This rule has been deprecated in favour of the equivalent, better named [`parame
14
14
  Parameter properties can be confusing to those new to TypeScript as they are less explicit than other ways
15
15
  of declaring and initializing class members.
16
16
 
17
- ## Rule Details
17
+ ## Examples
18
18
 
19
19
  This rule disallows the use of parameter properties in constructors, forcing the user to explicitly
20
20
  declare all properties in the class.
@@ -6,7 +6,7 @@ description: 'Disallow variable redeclaration.'
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-redeclare** for documentation.
8
8
 
9
- ## Rule Details
9
+ ## Examples
10
10
 
11
11
  This rule extends the base [`eslint/no-redeclare`](https://eslint.org/docs/rules/no-redeclare) rule.
12
12
  It adds support for TypeScript function overloads, and declaration merging.
@@ -6,8 +6,6 @@ description: 'Disallow members of unions and intersections that do nothing or ov
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-redundant-type-constituents** for documentation.
8
8
 
9
- ## Rule Details
10
-
11
9
  Some types can override some other types ("constituents") in a union or intersection and/or be overridden by some other types.
12
10
  TypeScript's set theory of types includes cases where a constituent type might be useless in the parent union or intersection.
13
11
 
@@ -24,7 +22,7 @@ Within `&` intersections:
24
22
  - literal types "override" any primitive types in an intersection
25
23
  - literal types such as `""` "override" any of their primitive types such as `string`
26
24
 
27
- Examples of code for this rule:
25
+ ## Examples
28
26
 
29
27
  <!--tabs-->
30
28
 
@@ -66,14 +64,11 @@ type IntersectionNever = string;
66
64
  type IntersectionBooleanLiteral = false;
67
65
  type IntersectionNumberLiteral = 1;
68
66
  type IntersectionStringLiteral = 'foo';
69
-
70
- type ReturnUnionNever = () => string | never;
71
67
  ```
72
68
 
73
69
  ## Limitations
74
70
 
75
71
  This rule plays it safe and only works with bottom types, top types, and comparing literal types to primitive types.
76
- It also does not provide an auto-fixer just yet.
77
72
 
78
73
  ## Further Reading
79
74
 
@@ -8,33 +8,30 @@ description: 'Disallow invocation of `require()`.'
8
8
 
9
9
  Prefer the newer ES6-style imports over `require()`.
10
10
 
11
- ## Rule Details
12
-
13
- Examples of code for this rule:
11
+ ## Examples
14
12
 
15
13
  <!--tabs-->
16
14
 
17
15
  ### ❌ Incorrect
18
16
 
19
17
  ```ts
20
- var lib = require('lib');
21
- let lib2 = require('lib2');
22
- var lib5 = require('lib5'),
23
- lib6 = require('lib6');
24
- import lib8 = require('lib8');
18
+ const lib1 = require('lib1');
19
+ const { lib2 } = require('lib2');
20
+ import lib3 = require('lib3');
25
21
  ```
26
22
 
27
23
  ### ✅ Correct
28
24
 
29
25
  ```ts
30
- import { l } from 'lib';
31
- var lib3 = load('not_an_import');
32
- var lib4 = lib2.subImport;
33
- var lib7 = 700;
34
- import lib9 = lib2.anotherSubImport;
35
- import lib10 from 'lib10';
26
+ import * as lib1 from 'lib1';
27
+ import { lib2 } from 'lib2';
28
+ import * as lib3 from 'lib3';
36
29
  ```
37
30
 
38
31
  ## When Not To Use It
39
32
 
40
- If you don't care about TypeScript module syntax, then you will not need this rule.
33
+ If you don't care about using newer module syntax, then you will not need this rule.
34
+
35
+ ## Related To
36
+
37
+ - [`no-var-requires`](./no-var-requires.md)
@@ -6,7 +6,7 @@ description: 'Disallow specified modules when loaded by `import`.'
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-restricted-imports** for documentation.
8
8
 
9
- ## Rule Details
9
+ ## Examples
10
10
 
11
11
  This rule extends the base [`eslint/no-restricted-imports`](https://eslint.org/docs/rules/no-restricted-imports) rule.
12
12
 
@@ -6,7 +6,7 @@ description: 'Disallow variable declarations from shadowing variables declared i
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-shadow** for documentation.
8
8
 
9
- ## Rule Details
9
+ ## Examples
10
10
 
11
11
  This rule extends the base [`eslint/no-shadow`](https://eslint.org/docs/rules/no-shadow) rule.
12
12
  It adds support for TypeScript's `this` parameters and global augmentation, and adds options for TypeScript features.
@@ -6,24 +6,24 @@ description: 'Disallow aliasing `this`.'
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-this-alias** for documentation.
8
8
 
9
- This rule prohibits assigning variables to `this`.
10
-
11
- ## Rule Details
12
-
13
9
  Assigning a variable to `this` instead of properly using arrow lambdas may be a symptom of pre-ES6 practices
14
10
  or not managing scope well.
15
11
 
16
- Instead of storing a reference to `this` and using it inside a `function () {`:
12
+ ## Examples
13
+
14
+ <!--tabs-->
15
+
16
+ ### ❌ Incorrect
17
17
 
18
18
  ```js
19
19
  const self = this;
20
- >
20
+
21
21
  setTimeout(function () {
22
- self.doWork();
22
+ self.doWork();
23
23
  });
24
24
  ```
25
25
 
26
- Use `() =>` arrow lambdas, as they preserve `this` scope for you:
26
+ ### Correct
27
27
 
28
28
  ```js
29
29
  setTimeout(() => {
@@ -31,13 +31,7 @@ setTimeout(() => {
31
31
  });
32
32
  ```
33
33
 
34
- Examples of **incorrect** code for this rule:
35
-
36
- (see the rationale above)
37
-
38
- Examples of **correct** code for this rule:
39
-
40
- (see the rationale above)
34
+ ## Options
41
35
 
42
36
  ## When Not To Use It
43
37
 
@@ -11,12 +11,10 @@ The fundamental benefit of `Error` objects is that they automatically keep track
11
11
 
12
12
  This rule restricts what can be thrown as an exception. When it was first created, it only prevented literals from being thrown (hence the name), but it has now been expanded to only allow expressions which have a possibility of being an `Error` object. With the `allowThrowingAny` and `allowThrowingUnknown`, it can be configured to only allow throwing values which are guaranteed to be an instance of `Error`.
13
13
 
14
- ## Rule Details
14
+ ## Examples
15
15
 
16
16
  This rule is aimed at maintaining consistency when throwing exception by disallowing to throw literals and other expressions which cannot possibly be an `Error` object.
17
17
 
18
- Examples of code for this rule:
19
-
20
18
  <!--tabs-->
21
19
 
22
20
  ### ❌ Incorrect
@@ -78,7 +78,7 @@ On the other hand, using a type alias as an interface can limit your ability to:
78
78
  Finally, mapping types is an advanced technique and leaving it open can quickly become a pain point
79
79
  in your application.
80
80
 
81
- ## Rule Details
81
+ ## Examples
82
82
 
83
83
  This rule disallows the use of type aliases in favor of interfaces
84
84
  and simplified types (primitives, tuples, unions, intersections, etc).
@@ -6,25 +6,20 @@ description: 'Disallow unnecessary equality comparisons against boolean literals
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare** for documentation.
8
8
 
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.
10
-
11
- ## Rule Details
9
+ Comparing boolean values to boolean literals is unnecessary: those comparisons result in the same booleans.
10
+ Using the boolean values directly, or via a unary negation (`!value`), is more concise and clearer.
12
11
 
13
12
  This rule ensures that you do not include unnecessary comparisons with boolean literals.
14
13
  A comparison is considered unnecessary if it checks a boolean literal against any variable with just the `boolean` type.
15
- A comparison is **_not_** considered unnecessary if the type is a union of booleans (`string | boolean`, `someObject | boolean`).
16
-
17
- **Warning**: Do not use this rule when `strictNullChecks` is disabled.
18
- ESLint is not able to distinguish between `false` and `undefined` or `null` values.
19
- This can cause unintended code changes when using autofix.
14
+ A comparison is **_not_** considered unnecessary if the type is a union of booleans (`string | boolean`, `SomeObject | boolean`, etc.).
20
15
 
21
- **Note**: Throughout this page, only strict equality (`===` and `!==`) are
22
- used in the examples. However, the implementation of the rule does not
23
- distinguish between strict and loose equality. Any example below that uses
24
- `===` would be treated the same way if `==` was used, and any example below
25
- that uses `!==` would be treated the same way if `!=` was used.
16
+ ## Examples
26
17
 
27
- Examples of code for this rule:
18
+ :::note
19
+ Throughout this page, only strict equality (`===` and `!==`) are used in the examples.
20
+ However, the implementation of the rule does not distinguish between strict and loose equality.
21
+ Any example below that uses `===` would be treated the same way if `==` was used, and `!==` would be treated the same way if `!=` was used.
22
+ :::
28
23
 
29
24
  <!--tabs-->
30
25
 
@@ -130,3 +125,9 @@ if (!(someNullCondition ?? true)) {
130
125
  | `nullableBooleanVar !== true` | `!nullableBooleanVar` | Only checked/fixed if the `allowComparingNullableBooleansToTrue` option is `false` |
131
126
  | `nullableBooleanVar === false` | `nullableBooleanVar ?? true` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` |
132
127
  | `nullableBooleanVar !== false` | `!(nullableBooleanVar ?? true)` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` |
128
+
129
+ ## Not To Use It
130
+
131
+ Do not use this rule when `strictNullChecks` is disabled.
132
+ ESLint is not able to distinguish between `false` and `undefined` or `null` values.
133
+ This can cause unintended code changes when using autofix.
@@ -6,7 +6,8 @@ description: 'Disallow conditionals where the type is always truthy or always fa
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-unnecessary-condition** for documentation.
8
8
 
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.
9
+ Any expression being used as a condition must be able to evaluate as truthy or falsy in order to be considered "necessary".
10
+ 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.
10
11
 
11
12
  The following expressions are checked:
12
13
 
@@ -14,9 +15,7 @@ The following expressions are checked:
14
15
  - Conditions for `if`, `for`, `while`, and `do-while` statements
15
16
  - Base values of optional chain expressions
16
17
 
17
- ## Rule Details
18
-
19
- Examples of code for this rule:
18
+ ## Examples
20
19
 
21
20
  <!--tabs-->
22
21
 
@@ -6,31 +6,16 @@ description: 'Disallow unnecessary namespace qualifiers.'
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-unnecessary-qualifier** for documentation.
8
8
 
9
- ## Rule Details
9
+ Members of TypeScript enums and namespaces are generally retrieved as qualified property lookups: e.g. `Enum.member`.
10
+ However, when accessed within their parent enum or namespace, the qualifier is unnecessary: e.g. just `member` instead of `Enum.member`.
11
+ This rule reports when an enum or namespace qualifier is unnecessary.
10
12
 
11
- This rule aims to let users know when a namespace or enum qualifier is unnecessary,
12
- whether used for a type or for a value.
13
-
14
- Examples of code for this rule:
13
+ ## Examples
15
14
 
16
15
  <!--tabs-->
17
16
 
18
17
  ### ❌ Incorrect
19
18
 
20
- ```ts
21
- namespace A {
22
- export type B = number;
23
- const x: A.B = 3;
24
- }
25
- ```
26
-
27
- ```ts
28
- namespace A {
29
- export const x = 3;
30
- export const y = A.x;
31
- }
32
- ```
33
-
34
19
  ```ts
35
20
  enum A {
36
21
  B,
@@ -40,46 +25,27 @@ enum A {
40
25
 
41
26
  ```ts
42
27
  namespace A {
43
- export namespace B {
44
- export type T = number;
45
- const x: A.B.T = 3;
46
- }
28
+ export type B = number;
29
+ const x: A.B = 3;
47
30
  }
48
31
  ```
49
32
 
50
33
  ### ✅ Correct
51
34
 
52
- ```ts
53
- namespace X {
54
- export type T = number;
55
- }
56
-
57
- namespace Y {
58
- export const x: X.T = 3;
59
- }
60
- ```
61
-
62
35
  ```ts
63
36
  enum A {
64
- X,
65
- Y,
66
- }
67
-
68
- enum B {
69
- Z = A.X,
37
+ B,
38
+ C = B,
70
39
  }
71
40
  ```
72
41
 
73
42
  ```ts
74
- namespace X {
75
- export type T = number;
76
- namespace Y {
77
- type T = string;
78
- const x: X.T = 0;
79
- }
43
+ namespace A {
44
+ export type B = number;
45
+ const x: B = 3;
80
46
  }
81
47
  ```
82
48
 
83
49
  ## When Not To Use It
84
50
 
85
- If you don't care about having unneeded namespace or enum qualifiers, then you don't need to use this rule.
51
+ If you don't care about having unneeded enum or namespace qualifiers, then you don't need to use this rule.
@@ -6,20 +6,17 @@ description: 'Disallow type arguments that are equal to the default.'
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-unnecessary-type-arguments** for documentation.
8
8
 
9
- Warns if an explicitly specified type argument is the default for that type parameter.
10
-
11
- ## Rule Details
12
-
13
9
  Type parameters in TypeScript may specify a default value.
14
10
  For example:
15
11
 
16
12
  ```ts
17
- function f<T = number>() {}
13
+ function f<T = number>(...) {...}
18
14
  ```
19
15
 
20
- It is redundant to provide an explicit type parameter equal to that default.
16
+ It is redundant to provide an explicit type parameter equal to that default: e.g. calling `f<number>(...)`.
17
+ This rule reports when an explicitly specified type argument is the default for that type parameter.
21
18
 
22
- Examples of code for this rule:
19
+ ## Examples
23
20
 
24
21
  <!--tabs-->
25
22
 
@@ -28,15 +25,21 @@ Examples of code for this rule:
28
25
  ```ts
29
26
  function f<T = number>() {}
30
27
  f<number>();
28
+ ```
31
29
 
30
+ ```ts
32
31
  function g<T = number, U = string>() {}
33
32
  g<string, string>();
33
+ ```
34
34
 
35
+ ```ts
35
36
  class C<T = number> {}
36
- function h(c: C<number>) {}
37
37
  new C<number>();
38
+
38
39
  class D extends C<number> {}
40
+ ```
39
41
 
42
+ ```ts
40
43
  interface I<T = number> {}
41
44
  class Impl implements I<number> {}
42
45
  ```
@@ -45,15 +48,26 @@ class Impl implements I<number> {}
45
48
 
46
49
  ```ts
47
50
  function f<T = number>() {}
51
+ f();
48
52
  f<string>();
53
+ ```
49
54
 
55
+ ```ts
50
56
  function g<T = number, U = string>() {}
57
+ g<string>();
51
58
  g<number, number>();
59
+ ```
52
60
 
61
+ ```ts
53
62
  class C<T = number> {}
63
+ new C();
54
64
  new C<string>();
65
+
66
+ class D extends C {}
55
67
  class D extends C<string> {}
68
+ ```
56
69
 
70
+ ```ts
57
71
  interface I<T = number> {}
58
72
  class Impl implements I<string> {}
59
73
  ```
@@ -6,13 +6,11 @@ description: 'Disallow type assertions that do not change the type of an express
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-unnecessary-type-assertion** for documentation.
8
8
 
9
- This rule prohibits using a type assertion that does not change the type of an expression.
9
+ TypeScript can be told an expression is a different type than expected using `as` type assertions.
10
+ Leaving `as` assertions in the codebase increases visual clutter and harms code readability, so it's generally best practice to remove them if they don't change the type of an expression.
11
+ This rule reports when a type assertion does not change the type of an expression.
10
12
 
11
- ## Rule Details
12
-
13
- This rule aims to prevent unnecessary type assertions.
14
-
15
- Examples of code for this rule:
13
+ ## Examples
16
14
 
17
15
  <!--tabs-->
18
16
 
@@ -6,17 +6,11 @@ description: 'Disallow unnecessary constraints on generic types.'
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-unnecessary-type-constraint** for documentation.
8
8
 
9
- ## Rule Details
9
+ Generic type parameters (`<T>`) in TypeScript may be "constrained" with an [`extends` keyword](https://www.typescriptlang.org/docs/handbook/generics.html#generic-constraints).
10
+ When no `extends` is provided, type parameters default a constraint to `any`.
11
+ It is therefore redundant to `extend` from `any`.
10
12
 
11
- Type parameters (`<T>`) may be "constrained" with an `extends` keyword ([docs](https://www.typescriptlang.org/docs/handbook/generics.html#generic-constraints)).
12
- When not provided, type parameters happen to default to:
13
-
14
- - As of TypeScript 3.9: `unknown` ([docs](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#type-parameters-that-extend-any-no-longer-act-as-any))
15
- - Before that, as of 3.5: `any` ([docs](https://devblogs.microsoft.com/typescript/announcing-typescript-3-5/#breaking-changes))
16
-
17
- It is therefore redundant to `extend` from these types in later versions of TypeScript.
18
-
19
- Examples of code for this rule:
13
+ ## Examples
20
14
 
21
15
  <!--tabs-->
22
16
 
@@ -24,24 +18,16 @@ Examples of code for this rule:
24
18
 
25
19
  ```ts
26
20
  interface FooAny<T extends any> {}
27
- interface FooUnknown<T extends unknown> {}
28
21
 
29
22
  type BarAny<T extends any> = {};
30
- type BarUnknown<T extends unknown> = {};
31
23
 
32
24
  class BazAny<T extends any> {
33
- quxUnknown<U extends unknown>() {}
34
- }
35
-
36
- class BazUnknown<T extends unknown> {
37
- quxUnknown<U extends unknown>() {}
25
+ quxAny<U extends any>() {}
38
26
  }
39
27
 
40
28
  const QuuxAny = <T extends any>() => {};
41
- const QuuxUnknown = <T extends unknown>() => {};
42
29
 
43
30
  function QuuzAny<T extends any>() {}
44
- function QuuzUnknown<T extends unknown>() {}
45
31
  ```
46
32
 
47
33
  ### ✅ Correct
@@ -52,7 +38,7 @@ interface Foo<T> {}
52
38
  type Bar<T> = {};
53
39
 
54
40
  class Baz<T> {
55
- qux<U> { }
41
+ qux<U> { }
56
42
  }
57
43
 
58
44
  const Quux = <T>() => {};
@@ -6,16 +6,19 @@ description: 'Disallow calling a function with a value with type `any`.'
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-unsafe-argument** for documentation.
8
8
 
9
+ The `any` type in TypeScript is a dangerous "escape hatch" from the type system.
10
+ Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code.
11
+
9
12
  Despite your best intentions, the `any` type can sometimes leak into your codebase.
10
- Call a function with `any` typed argument are not checked at all by TypeScript, so it creates a potential safety hole, and source of bugs in your codebase.
13
+ Calling a function with an `any` typed argument creates a potential safety hole and source of bugs.
11
14
 
12
- ## Rule Details
15
+ This rule disallows calling a function with `any` in its arguments.
16
+ That includes spreading arrays or tuples with `any` typed elements as function arguments.
13
17
 
14
- This rule disallows calling a function with `any` in its arguments, and it will disallow spreading `any[]`.
15
- This rule also disallows spreading a tuple type with one of its elements typed as `any`.
16
- This rule also compares the argument's type to the variable's type to ensure you don't pass an unsafe `any` in a generic position to a receiver that's expecting a specific type. For example, it will error if you assign `Set<any>` to an argument declared as `Set<string>`.
18
+ This rule also compares generic type argument types to ensure you don't pass an unsafe `any` in a generic position to a receiver that's expecting a specific type.
19
+ For example, it will error if you pass `Set<any>` as an argument to a parameter declared as `Set<string>`.
17
20
 
18
- Examples of code for this rule:
21
+ ## Examples
19
22
 
20
23
  <!--tabs-->
21
24
 
@@ -68,7 +71,7 @@ foo(new Set<string>(), new Map<string, string>());
68
71
 
69
72
  There are cases where the rule allows passing an argument of `any` to `unknown`.
70
73
 
71
- Example of `any` to `unknown` assignment that are allowed.
74
+ Example of `any` to `unknown` assignment that are allowed:
72
75
 
73
76
  ```ts
74
77
  declare function foo(arg1: unknown, arg2: Set<unkown>, arg3: unknown[]): void;
@@ -6,15 +6,18 @@ description: 'Disallow assigning a value with type `any` to variables and proper
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-unsafe-assignment** for documentation.
8
8
 
9
- Despite your best intentions, the `any` type can sometimes leak into your codebase.
10
- Assigning an `any` typed value to a variable can be hard to pick up on, particularly if it leaks in from an external library. Operations on the variable will not be checked at all by TypeScript, so it creates a potential safety hole, and source of bugs in your codebase.
9
+ The `any` type in TypeScript is a dangerous "escape hatch" from the type system.
10
+ Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code.
11
11
 
12
- ## Rule Details
12
+ Despite your best intentions, the `any` type can sometimes leak into your codebase.
13
+ Assigning an `any` typed value to a variable can be hard to pick up on, particularly if it leaks in from an external library.
13
14
 
14
15
  This rule disallows assigning `any` to a variable, and assigning `any[]` to an array destructuring.
15
- This rule also compares the assigned type to the variable's type to ensure you don't assign an unsafe `any` in a generic position to a receiver that's expecting a specific type. For example, it will error if you assign `Set<any>` to a variable declared as `Set<string>`.
16
16
 
17
- Examples of code for this rule:
17
+ This rule also compares generic type argument types to ensure you don't pass an unsafe `any` in a generic position to a receiver that's expecting a specific type.
18
+ For example, it will error if you assign `Set<any>` to a variable declared as `Set<string>`.
19
+
20
+ ## Examples
18
21
 
19
22
  <!--tabs-->
20
23
 
@@ -70,7 +73,7 @@ const x: Set<Set<Set<string>>> = new Set<Set<Set<string>>>();
70
73
 
71
74
  There are cases where the rule allows assignment of `any` to `unknown`.
72
75
 
73
- Example of `any` to `unknown` assignment that are allowed.
76
+ Example of `any` to `unknown` assignment that are allowed:
74
77
 
75
78
  ```ts
76
79
  const x: unknown = y as any;
@@ -6,14 +6,15 @@ description: 'Disallow calling a value with type `any`.'
6
6
  >
7
7
  > See **https://typescript-eslint.io/rules/no-unsafe-call** for documentation.
8
8
 
9
- Despite your best intentions, the `any` type can sometimes leak into your codebase.
10
- The arguments to, and return value of calling an `any` typed variable are not checked at all by TypeScript, so it creates a potential safety hole, and source of bugs in your codebase.
9
+ The `any` type in TypeScript is a dangerous "escape hatch" from the type system.
10
+ Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code.
11
11
 
12
- ## Rule Details
12
+ Despite your best intentions, the `any` type can sometimes leak into your codebase.
13
+ Calling an `any`-typed value as a function creates a potential type safety hole and source of bugs in your codebase.
13
14
 
14
- This rule disallows calling any variable that is typed as `any`.
15
+ This rule disallows calling any value that is typed as `any`.
15
16
 
16
- Examples of code for this rule:
17
+ ## Examples
17
18
 
18
19
  <!--tabs-->
19
20