@ttsc/lint 0.14.0-dev.20260529.2 → 0.14.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 (380) hide show
  1. package/README.md +23 -25
  2. package/lib/defaultFormat.d.ts +10 -6
  3. package/lib/defaultFormat.js +10 -6
  4. package/lib/defaultFormat.js.map +1 -1
  5. package/lib/structures/ITtscLintConfig.d.ts +5 -5
  6. package/lib/structures/TtscLintRuleSetting.d.ts +19 -19
  7. package/lib/structures/{ITtscLintFormat.d.ts → format/ITtscLintFormat.d.ts} +45 -70
  8. package/lib/structures/format/ITtscLintFormat.js.map +1 -0
  9. package/lib/structures/format/ITtscLintFormatJsDoc.d.ts +15 -0
  10. package/lib/structures/format/ITtscLintFormatJsDoc.js +3 -0
  11. package/lib/structures/format/ITtscLintFormatJsDoc.js.map +1 -0
  12. package/lib/structures/format/ITtscLintFormatSortImports.d.ts +54 -0
  13. package/lib/structures/format/ITtscLintFormatSortImports.js +3 -0
  14. package/lib/structures/format/ITtscLintFormatSortImports.js.map +1 -0
  15. package/lib/structures/format/index.d.ts +3 -0
  16. package/lib/structures/format/index.js +20 -0
  17. package/lib/structures/format/index.js.map +1 -0
  18. package/lib/structures/index.d.ts +1 -1
  19. package/lib/structures/index.js +1 -1
  20. package/lib/structures/index.js.map +1 -1
  21. package/lib/structures/rules/ITtscLintBoundariesRuleOptions.d.ts +18 -27
  22. package/lib/structures/rules/ITtscLintBoundariesRuleOptions.js +4 -5
  23. package/lib/structures/rules/ITtscLintBoundariesRuleOptions.js.map +1 -1
  24. package/lib/structures/rules/ITtscLintBoundariesRules.d.ts +29 -33
  25. package/lib/structures/rules/ITtscLintContributorRules.d.ts +6 -7
  26. package/lib/structures/rules/ITtscLintCoreRules.d.ts +380 -408
  27. package/lib/structures/rules/ITtscLintCypressRuleOptions.d.ts +5 -5
  28. package/lib/structures/rules/ITtscLintCypressRuleOptions.js +2 -2
  29. package/lib/structures/rules/ITtscLintCypressRules.d.ts +34 -38
  30. package/lib/structures/rules/ITtscLintFunctionalRuleOptions.d.ts +21 -24
  31. package/lib/structures/rules/ITtscLintFunctionalRuleOptions.js +2 -2
  32. package/lib/structures/rules/ITtscLintFunctionalRules.d.ts +51 -56
  33. package/lib/structures/rules/ITtscLintJestRules.d.ts +63 -74
  34. package/lib/structures/rules/ITtscLintJsdocRules.d.ts +47 -54
  35. package/lib/structures/rules/ITtscLintJsxA11yRules.d.ts +94 -102
  36. package/lib/structures/rules/ITtscLintNextjsRules.d.ts +50 -55
  37. package/lib/structures/rules/ITtscLintPlaywrightRules.d.ts +104 -122
  38. package/lib/structures/rules/ITtscLintPromiseRules.d.ts +62 -71
  39. package/lib/structures/rules/ITtscLintReactPerfRuleOptions.d.ts +4 -4
  40. package/lib/structures/rules/ITtscLintReactPerfRules.d.ts +17 -19
  41. package/lib/structures/rules/ITtscLintReactRuleOptions.d.ts +8 -10
  42. package/lib/structures/rules/ITtscLintReactRuleOptions.js +1 -2
  43. package/lib/structures/rules/ITtscLintReactRuleOptions.js.map +1 -1
  44. package/lib/structures/rules/ITtscLintReactRules.d.ts +91 -104
  45. package/lib/structures/rules/ITtscLintRegexpRules.d.ts +46 -54
  46. package/lib/structures/rules/ITtscLintRuleOptionsMap.d.ts +7 -8
  47. package/lib/structures/rules/ITtscLintSecurityRules.d.ts +45 -52
  48. package/lib/structures/rules/ITtscLintSolidRules.d.ts +53 -56
  49. package/lib/structures/rules/ITtscLintStorybookRuleOptions.d.ts +3 -4
  50. package/lib/structures/rules/ITtscLintStorybookRules.d.ts +60 -69
  51. package/lib/structures/rules/ITtscLintTanstackQueryRules.d.ts +31 -37
  52. package/lib/structures/rules/ITtscLintTestingLibraryRuleOptions.d.ts +2 -3
  53. package/lib/structures/rules/ITtscLintTestingLibraryRules.d.ts +102 -119
  54. package/lib/structures/rules/ITtscLintTypeScriptRules.d.ts +460 -518
  55. package/lib/structures/rules/ITtscLintVitestRules.d.ts +43 -51
  56. package/linthost/config.go +89 -72
  57. package/linthost/config_format.go +265 -99
  58. package/linthost/directives.go +5 -1
  59. package/linthost/display_width.go +72 -0
  60. package/linthost/fix.go +26 -1
  61. package/linthost/format.go +222 -25
  62. package/linthost/format_editor_settings.go +262 -0
  63. package/linthost/lsp.go +8 -4
  64. package/linthost/print_dispatch.go +3 -0
  65. package/linthost/print_doc.go +13 -0
  66. package/linthost/print_engine.go +68 -11
  67. package/linthost/print_nodes_array.go +167 -5
  68. package/linthost/print_nodes_call.go +786 -77
  69. package/linthost/print_nodes_function.go +43 -0
  70. package/linthost/print_nodes_imports.go +64 -14
  71. package/linthost/print_nodes_list.go +214 -8
  72. package/linthost/print_nodes_object.go +14 -6
  73. package/linthost/print_nodes_ternary.go +147 -0
  74. package/linthost/rules_boundaries.go +400 -400
  75. package/linthost/rules_camelcase.go +81 -81
  76. package/linthost/rules_complexity.go +52 -51
  77. package/linthost/rules_consistent_return.go +81 -81
  78. package/linthost/rules_core_extra.go +472 -472
  79. package/linthost/rules_curly.go +43 -43
  80. package/linthost/rules_default_case.go +15 -15
  81. package/linthost/rules_default_case_last.go +22 -22
  82. package/linthost/rules_format_arrow_parens.go +213 -0
  83. package/linthost/rules_format_bracket_spacing.go +117 -0
  84. package/linthost/rules_format_clause_join.go +179 -0
  85. package/linthost/rules_format_declaration_header.go +664 -0
  86. package/linthost/rules_format_indent.go +616 -0
  87. package/linthost/rules_format_jsdoc.go +4 -4
  88. package/linthost/rules_format_orphan_semi.go +106 -0
  89. package/linthost/rules_format_parameter_properties.go +175 -0
  90. package/linthost/rules_format_print_width.go +180 -69
  91. package/linthost/rules_format_quote_props.go +169 -0
  92. package/linthost/rules_format_quotes.go +75 -29
  93. package/linthost/rules_format_semi.go +185 -10
  94. package/linthost/rules_format_sort_imports.go +517 -121
  95. package/linthost/rules_format_statement_split.go +368 -0
  96. package/linthost/rules_format_ternary_nullish_parens.go +77 -0
  97. package/linthost/rules_format_trailing_comma.go +21 -2
  98. package/linthost/rules_format_whitespace.go +336 -0
  99. package/linthost/rules_functional.go +688 -688
  100. package/linthost/rules_gap.go +146 -11
  101. package/linthost/rules_grouped_accessor_pairs.go +60 -60
  102. package/linthost/rules_guard_for_in.go +122 -122
  103. package/linthost/rules_id_length.go +44 -44
  104. package/linthost/rules_imports.go +11 -3
  105. package/linthost/rules_init_declarations.go +25 -25
  106. package/linthost/rules_jsx_a11y.go +844 -844
  107. package/linthost/rules_max_classes_per_file.go +24 -24
  108. package/linthost/rules_max_depth.go +43 -43
  109. package/linthost/rules_max_lines.go +53 -53
  110. package/linthost/rules_max_lines_per_function.go +28 -28
  111. package/linthost/rules_max_nested_callbacks.go +26 -26
  112. package/linthost/rules_max_params.go +20 -20
  113. package/linthost/rules_max_statements.go +29 -29
  114. package/linthost/rules_nextjs.go +5 -5
  115. package/linthost/rules_no_else_return.go +38 -38
  116. package/linthost/rules_no_empty_named_blocks.go +45 -45
  117. package/linthost/rules_no_import_assign.go +96 -96
  118. package/linthost/rules_no_invalid_this.go +19 -19
  119. package/linthost/rules_no_loop_func.go +43 -43
  120. package/linthost/rules_no_magic_numbers.go +60 -60
  121. package/linthost/rules_no_mixed_operators.go +44 -44
  122. package/linthost/rules_no_param_reassign.go +64 -64
  123. package/linthost/rules_no_restricted_imports.go +45 -45
  124. package/linthost/rules_no_restricted_syntax.go +17 -17
  125. package/linthost/rules_no_shadow.go +112 -112
  126. package/linthost/rules_no_unreachable.go +36 -36
  127. package/linthost/rules_no_useless_assignment.go +79 -79
  128. package/linthost/rules_no_useless_constructor.go +167 -167
  129. package/linthost/rules_no_useless_return.go +28 -28
  130. package/linthost/rules_prefer_arrow_callback.go +74 -74
  131. package/linthost/rules_prefer_destructuring.go +61 -61
  132. package/linthost/rules_prefer_named_capture_group.go +87 -87
  133. package/linthost/rules_prefer_rest_params.go +61 -61
  134. package/linthost/rules_promise.go +800 -800
  135. package/linthost/rules_react.go +600 -600
  136. package/linthost/rules_react_extras.go +162 -162
  137. package/linthost/rules_react_hooks.go +2 -2
  138. package/linthost/rules_react_perf.go +231 -231
  139. package/linthost/rules_regexp.go +293 -293
  140. package/linthost/rules_security.go +613 -613
  141. package/linthost/rules_sort_imports.go +37 -37
  142. package/linthost/rules_sort_keys.go +88 -88
  143. package/linthost/rules_suggestions.go +13 -0
  144. package/linthost/rules_ts.go +2 -2
  145. package/linthost/rules_ts_async.go +247 -247
  146. package/linthost/rules_ts_class_literal_property_style.go +64 -64
  147. package/linthost/rules_ts_consistent_type_exports.go +209 -209
  148. package/linthost/rules_ts_explicit_function_return_type.go +35 -35
  149. package/linthost/rules_ts_extra.go +6 -2
  150. package/linthost/rules_ts_no_base_to_string.go +140 -140
  151. package/linthost/rules_ts_no_confusing_void.go +28 -28
  152. package/linthost/rules_ts_no_deprecated.go +110 -110
  153. package/linthost/rules_ts_no_for_in_array.go +45 -45
  154. package/linthost/rules_ts_no_magic_numbers.go +67 -67
  155. package/linthost/rules_ts_no_meaningless_void_operator.go +44 -44
  156. package/linthost/rules_ts_no_misused_spread.go +64 -64
  157. package/linthost/rules_ts_no_redundant_type_constituents.go +72 -72
  158. package/linthost/rules_ts_no_restricted_types.go +28 -28
  159. package/linthost/rules_ts_no_unnecessary_boolean_literal_compare.go +87 -87
  160. package/linthost/rules_ts_no_unnecessary_condition.go +184 -184
  161. package/linthost/rules_ts_no_unnecessary_qualifier.go +72 -72
  162. package/linthost/rules_ts_no_unnecessary_template_expression.go +120 -120
  163. package/linthost/rules_ts_no_unnecessary_type_arguments.go +171 -171
  164. package/linthost/rules_ts_no_unnecessary_type_assertion.go +90 -90
  165. package/linthost/rules_ts_no_unsafe_argument.go +50 -50
  166. package/linthost/rules_ts_no_unsafe_assignment.go +60 -60
  167. package/linthost/rules_ts_no_unsafe_call.go +40 -40
  168. package/linthost/rules_ts_no_unsafe_enum_comparison.go +147 -147
  169. package/linthost/rules_ts_no_unsafe_member_access.go +29 -29
  170. package/linthost/rules_ts_no_unsafe_return.go +64 -64
  171. package/linthost/rules_ts_no_unsafe_unary_minus.go +42 -42
  172. package/linthost/rules_ts_no_useless_constructor.go +20 -20
  173. package/linthost/rules_ts_non_nullable_type_assertion_style.go +60 -60
  174. package/linthost/rules_ts_parameter_properties.go +10 -10
  175. package/linthost/rules_ts_prefer_find.go +116 -116
  176. package/linthost/rules_ts_prefer_includes.go +173 -173
  177. package/linthost/rules_ts_prefer_nullish_coalescing.go +54 -54
  178. package/linthost/rules_ts_prefer_optional_chain.go +156 -156
  179. package/linthost/rules_ts_prefer_promise_reject_errors.go +104 -104
  180. package/linthost/rules_ts_prefer_readonly.go +31 -31
  181. package/linthost/rules_ts_prefer_reduce_type_parameter.go +74 -74
  182. package/linthost/rules_ts_prefer_regexp_exec.go +69 -69
  183. package/linthost/rules_ts_prefer_return_this_type.go +79 -79
  184. package/linthost/rules_ts_prefer_string_starts_ends_with.go +237 -237
  185. package/linthost/rules_ts_promise_function_async.go +41 -41
  186. package/linthost/rules_ts_related_getter_setter_pairs.go +61 -61
  187. package/linthost/rules_ts_require_array_sort_compare.go +58 -58
  188. package/linthost/rules_ts_restrict_plus_operands.go +82 -82
  189. package/linthost/rules_ts_restrict_template_expressions.go +50 -50
  190. package/linthost/rules_ts_simple.go +249 -249
  191. package/linthost/rules_ts_sort_type_constituents.go +88 -88
  192. package/linthost/rules_ts_strict_boolean_expressions.go +103 -103
  193. package/linthost/rules_ts_switch_exhaustiveness_check.go +90 -90
  194. package/linthost/rules_ts_unbound_method.go +65 -65
  195. package/linthost/rules_tsdoc.go +88 -88
  196. package/linthost/rules_unicorn_better_regex.go +1 -1
  197. package/linthost/rules_unicorn_catch_error_name.go +19 -19
  198. package/linthost/rules_unicorn_consistent_assert.go +20 -20
  199. package/linthost/rules_unicorn_consistent_date_clone.go +27 -27
  200. package/linthost/rules_unicorn_consistent_destructuring.go +3 -3
  201. package/linthost/rules_unicorn_consistent_empty_array_spread.go +34 -34
  202. package/linthost/rules_unicorn_consistent_existence_index_check.go +42 -42
  203. package/linthost/rules_unicorn_consistent_function_scoping.go +3 -3
  204. package/linthost/rules_unicorn_consistent_template_literal_escape.go +3 -3
  205. package/linthost/rules_unicorn_custom_error_definition.go +92 -92
  206. package/linthost/rules_unicorn_empty_brace_spaces.go +47 -47
  207. package/linthost/rules_unicorn_error_message.go +34 -34
  208. package/linthost/rules_unicorn_escape_case.go +14 -14
  209. package/linthost/rules_unicorn_expiring_todo_comments.go +36 -36
  210. package/linthost/rules_unicorn_explicit_length_check.go +51 -51
  211. package/linthost/rules_unicorn_filename_case.go +1 -1
  212. package/linthost/rules_unicorn_import_style.go +1 -1
  213. package/linthost/rules_unicorn_isolated_functions.go +2 -2
  214. package/linthost/rules_unicorn_new_for_builtins.go +49 -49
  215. package/linthost/rules_unicorn_no_abusive_eslint_disable.go +31 -31
  216. package/linthost/rules_unicorn_no_accessor_recursion.go +69 -69
  217. package/linthost/rules_unicorn_no_anonymous_default_export.go +40 -40
  218. package/linthost/rules_unicorn_no_array_callback_reference.go +33 -33
  219. package/linthost/rules_unicorn_no_array_for_each.go +14 -14
  220. package/linthost/rules_unicorn_no_array_method_this_argument.go +29 -29
  221. package/linthost/rules_unicorn_no_array_reduce.go +15 -15
  222. package/linthost/rules_unicorn_no_array_reverse.go +17 -17
  223. package/linthost/rules_unicorn_no_array_sort.go +17 -17
  224. package/linthost/rules_unicorn_no_await_expression_member.go +12 -12
  225. package/linthost/rules_unicorn_no_await_in_promise_methods.go +38 -38
  226. package/linthost/rules_unicorn_no_console_spaces.go +30 -30
  227. package/linthost/rules_unicorn_no_document_cookie.go +13 -13
  228. package/linthost/rules_unicorn_no_empty_file.go +16 -16
  229. package/linthost/rules_unicorn_no_for_loop.go +58 -58
  230. package/linthost/rules_unicorn_no_hex_escape.go +11 -11
  231. package/linthost/rules_unicorn_no_immediate_mutation.go +55 -55
  232. package/linthost/rules_unicorn_no_instanceof_builtins.go +34 -34
  233. package/linthost/rules_unicorn_no_invalid_fetch_options.go +52 -52
  234. package/linthost/rules_unicorn_no_invalid_remove_event_listener.go +25 -25
  235. package/linthost/rules_unicorn_no_keyword_prefix.go +56 -56
  236. package/linthost/rules_unicorn_no_lonely_if.go +21 -21
  237. package/linthost/rules_unicorn_no_magic_array_flat_depth.go +22 -22
  238. package/linthost/rules_unicorn_no_named_default.go +25 -25
  239. package/linthost/rules_unicorn_no_negated_condition.go +54 -54
  240. package/linthost/rules_unicorn_no_negation_in_equality_check.go +23 -23
  241. package/linthost/rules_unicorn_no_nested_ternary.go +15 -15
  242. package/linthost/rules_unicorn_no_new_array.go +5 -5
  243. package/linthost/rules_unicorn_no_new_buffer.go +5 -5
  244. package/linthost/rules_unicorn_no_null.go +2 -2
  245. package/linthost/rules_unicorn_no_object_as_default_parameter.go +19 -19
  246. package/linthost/rules_unicorn_no_process_exit.go +17 -17
  247. package/linthost/rules_unicorn_no_single_promise_in_promise_methods.go +29 -29
  248. package/linthost/rules_unicorn_no_static_only_class.go +27 -27
  249. package/linthost/rules_unicorn_no_thenable.go +47 -47
  250. package/linthost/rules_unicorn_no_this_assignment.go +10 -10
  251. package/linthost/rules_unicorn_no_typeof_undefined.go +31 -31
  252. package/linthost/rules_unicorn_no_unnecessary_array_flat_depth.go +23 -23
  253. package/linthost/rules_unicorn_no_unnecessary_array_splice_count.go +37 -37
  254. package/linthost/rules_unicorn_no_unnecessary_await.go +24 -24
  255. package/linthost/rules_unicorn_no_unnecessary_slice_end.go +22 -22
  256. package/linthost/rules_unicorn_no_unreadable_array_destructuring.go +67 -67
  257. package/linthost/rules_unicorn_no_unreadable_iife.go +22 -22
  258. package/linthost/rules_unicorn_no_useless_collection_argument.go +34 -34
  259. package/linthost/rules_unicorn_no_useless_error_capture_stack_trace.go +18 -18
  260. package/linthost/rules_unicorn_no_useless_fallback_in_spread.go +49 -49
  261. package/linthost/rules_unicorn_no_useless_iterator_to_array.go +41 -41
  262. package/linthost/rules_unicorn_no_useless_length_check.go +82 -82
  263. package/linthost/rules_unicorn_no_useless_promise_resolve_reject.go +42 -42
  264. package/linthost/rules_unicorn_no_useless_spread.go +38 -38
  265. package/linthost/rules_unicorn_no_useless_switch_case.go +29 -29
  266. package/linthost/rules_unicorn_no_useless_undefined.go +25 -25
  267. package/linthost/rules_unicorn_no_zero_fractions.go +17 -17
  268. package/linthost/rules_unicorn_number_literal_case.go +33 -33
  269. package/linthost/rules_unicorn_numeric_separators_style.go +36 -36
  270. package/linthost/rules_unicorn_prefer_add_event_listener.go +30 -30
  271. package/linthost/rules_unicorn_prefer_array_find.go +27 -27
  272. package/linthost/rules_unicorn_prefer_array_flat.go +25 -25
  273. package/linthost/rules_unicorn_prefer_array_flat_map.go +37 -37
  274. package/linthost/rules_unicorn_prefer_array_index_of.go +108 -108
  275. package/linthost/rules_unicorn_prefer_array_some.go +43 -43
  276. package/linthost/rules_unicorn_prefer_at.go +42 -42
  277. package/linthost/rules_unicorn_prefer_bigint_literals.go +42 -42
  278. package/linthost/rules_unicorn_prefer_blob_reading_methods.go +15 -15
  279. package/linthost/rules_unicorn_prefer_class_fields.go +57 -57
  280. package/linthost/rules_unicorn_prefer_classlist_toggle.go +76 -76
  281. package/linthost/rules_unicorn_prefer_code_point.go +21 -21
  282. package/linthost/rules_unicorn_prefer_date_now.go +47 -47
  283. package/linthost/rules_unicorn_prefer_default_parameters.go +96 -96
  284. package/linthost/rules_unicorn_prefer_dom_node_append.go +14 -14
  285. package/linthost/rules_unicorn_prefer_dom_node_dataset.go +27 -27
  286. package/linthost/rules_unicorn_prefer_dom_node_remove.go +17 -17
  287. package/linthost/rules_unicorn_prefer_dom_node_text_content.go +11 -11
  288. package/linthost/rules_unicorn_prefer_event_target.go +10 -10
  289. package/linthost/rules_unicorn_prefer_export_from.go +99 -99
  290. package/linthost/rules_unicorn_prefer_global_this.go +91 -91
  291. package/linthost/rules_unicorn_prefer_import_meta_properties.go +38 -38
  292. package/linthost/rules_unicorn_prefer_includes.go +108 -108
  293. package/linthost/rules_unicorn_prefer_json_parse_buffer.go +37 -37
  294. package/linthost/rules_unicorn_prefer_keyboard_event_key.go +10 -10
  295. package/linthost/rules_unicorn_prefer_logical_operator_over_ternary.go +20 -20
  296. package/linthost/rules_unicorn_prefer_math_min_max.go +33 -33
  297. package/linthost/rules_unicorn_prefer_math_trunc.go +32 -32
  298. package/linthost/rules_unicorn_prefer_modern_dom_apis.go +18 -18
  299. package/linthost/rules_unicorn_prefer_modern_math_apis.go +38 -38
  300. package/linthost/rules_unicorn_prefer_module.go +22 -22
  301. package/linthost/rules_unicorn_prefer_native_coercion_functions.go +73 -73
  302. package/linthost/rules_unicorn_prefer_negative_index.go +46 -46
  303. package/linthost/rules_unicorn_prefer_node_protocol.go +90 -90
  304. package/linthost/rules_unicorn_prefer_number_properties.go +57 -57
  305. package/linthost/rules_unicorn_prefer_object_from_entries.go +26 -26
  306. package/linthost/rules_unicorn_prefer_optional_catch_binding.go +24 -24
  307. package/linthost/rules_unicorn_prefer_prototype_methods.go +25 -25
  308. package/linthost/rules_unicorn_prefer_query_selector.go +25 -25
  309. package/linthost/rules_unicorn_prefer_reflect_apply.go +10 -10
  310. package/linthost/rules_unicorn_prefer_regexp_test_rule.go +47 -47
  311. package/linthost/rules_unicorn_prefer_response_static_json.go +26 -26
  312. package/linthost/rules_unicorn_prefer_set_has.go +16 -16
  313. package/linthost/rules_unicorn_prefer_set_size.go +22 -22
  314. package/linthost/rules_unicorn_prefer_simple_condition_first.go +3 -3
  315. package/linthost/rules_unicorn_prefer_single_call.go +59 -59
  316. package/linthost/rules_unicorn_prefer_spread.go +24 -24
  317. package/linthost/rules_unicorn_prefer_string_raw.go +12 -12
  318. package/linthost/rules_unicorn_prefer_string_replace_all.go +46 -46
  319. package/linthost/rules_unicorn_prefer_string_slice.go +17 -17
  320. package/linthost/rules_unicorn_prefer_string_starts_ends_with.go +104 -104
  321. package/linthost/rules_unicorn_prefer_string_trim_start_end.go +21 -21
  322. package/linthost/rules_unicorn_prefer_structured_clone.go +36 -36
  323. package/linthost/rules_unicorn_prefer_switch.go +65 -65
  324. package/linthost/rules_unicorn_prefer_ternary.go +35 -35
  325. package/linthost/rules_unicorn_prefer_top_level_await.go +34 -34
  326. package/linthost/rules_unicorn_prefer_type_error.go +84 -84
  327. package/linthost/rules_unicorn_prevent_abbreviations.go +68 -68
  328. package/linthost/rules_unicorn_relative_url_style.go +19 -19
  329. package/linthost/rules_unicorn_require_array_join_separator.go +18 -18
  330. package/linthost/rules_unicorn_require_module_attributes.go +25 -25
  331. package/linthost/rules_unicorn_require_module_specifiers.go +28 -28
  332. package/linthost/rules_unicorn_require_number_to_fixed_digits_argument.go +18 -18
  333. package/linthost/rules_unicorn_require_post_message_target_origin.go +18 -18
  334. package/linthost/rules_unicorn_string_content.go +1 -1
  335. package/linthost/rules_unicorn_switch_case_braces.go +16 -16
  336. package/linthost/rules_unicorn_switch_case_break_position.go +3 -3
  337. package/linthost/rules_unicorn_template_indent.go +1 -1
  338. package/linthost/rules_unicorn_text_encoding_identifier_case.go +36 -36
  339. package/linthost/rules_unicorn_throw_new_error.go +30 -30
  340. package/linthost/rules_var.go +273 -3
  341. package/package.json +3 -3
  342. package/src/defaultFormat.ts +11 -7
  343. package/src/structures/ITtscLintConfig.ts +5 -5
  344. package/src/structures/TtscLintRuleSetting.ts +19 -19
  345. package/src/structures/{ITtscLintFormat.ts → format/ITtscLintFormat.ts} +48 -75
  346. package/src/structures/format/ITtscLintFormatJsDoc.ts +16 -0
  347. package/src/structures/format/ITtscLintFormatSortImports.ts +62 -0
  348. package/src/structures/format/index.ts +3 -0
  349. package/src/structures/index.ts +1 -1
  350. package/src/structures/rules/ITtscLintBoundariesRuleOptions.ts +20 -31
  351. package/src/structures/rules/ITtscLintBoundariesRules.ts +32 -36
  352. package/src/structures/rules/ITtscLintContributorRules.ts +6 -7
  353. package/src/structures/rules/ITtscLintCoreRules.ts +380 -408
  354. package/src/structures/rules/ITtscLintCypressRuleOptions.ts +5 -5
  355. package/src/structures/rules/ITtscLintCypressRules.ts +34 -38
  356. package/src/structures/rules/ITtscLintFunctionalRuleOptions.ts +28 -41
  357. package/src/structures/rules/ITtscLintFunctionalRules.ts +51 -56
  358. package/src/structures/rules/ITtscLintJestRules.ts +63 -74
  359. package/src/structures/rules/ITtscLintJsdocRules.ts +47 -54
  360. package/src/structures/rules/ITtscLintJsxA11yRules.ts +94 -102
  361. package/src/structures/rules/ITtscLintNextjsRules.ts +50 -55
  362. package/src/structures/rules/ITtscLintPlaywrightRules.ts +104 -122
  363. package/src/structures/rules/ITtscLintPromiseRules.ts +62 -71
  364. package/src/structures/rules/ITtscLintReactPerfRuleOptions.ts +4 -4
  365. package/src/structures/rules/ITtscLintReactPerfRules.ts +17 -19
  366. package/src/structures/rules/ITtscLintReactRuleOptions.ts +8 -10
  367. package/src/structures/rules/ITtscLintReactRules.ts +91 -104
  368. package/src/structures/rules/ITtscLintRegexpRules.ts +46 -54
  369. package/src/structures/rules/ITtscLintRuleOptionsMap.ts +7 -8
  370. package/src/structures/rules/ITtscLintSecurityRules.ts +45 -52
  371. package/src/structures/rules/ITtscLintSolidRules.ts +53 -56
  372. package/src/structures/rules/ITtscLintStorybookRuleOptions.ts +3 -4
  373. package/src/structures/rules/ITtscLintStorybookRules.ts +60 -69
  374. package/src/structures/rules/ITtscLintTanstackQueryRules.ts +31 -37
  375. package/src/structures/rules/ITtscLintTestingLibraryRuleOptions.ts +2 -3
  376. package/src/structures/rules/ITtscLintTestingLibraryRules.ts +102 -119
  377. package/src/structures/rules/ITtscLintTypeScriptRules.ts +460 -518
  378. package/src/structures/rules/ITtscLintVitestRules.ts +43 -51
  379. package/lib/structures/ITtscLintFormat.js.map +0 -1
  380. /package/lib/structures/{ITtscLintFormat.js → format/ITtscLintFormat.js} +0 -0
@@ -1,30 +1,29 @@
1
1
  import type { TtscLintRuleSetting } from "../TtscLintRuleSetting";
2
2
  /**
3
- * TypeScript-only rules and `@typescript-eslint` plugin equivalents,
4
- * exposed under the `typescript/*` namespace.
3
+ * TypeScript-only rules and `@typescript-eslint` plugin equivalents, exposed
4
+ * under the `typescript/*` namespace.
5
5
  *
6
- * Every rule listed here either requires TypeScript syntax (interface,
7
- * `enum`, `namespace`, `as`, `!`, `import type`, type parameters,
8
- * declaration merging, parameter properties, triple-slash references) or
9
- * originates from `@typescript-eslint` as a TS-aware extension that has no
10
- * counterpart in plain ESLint.
6
+ * Every rule listed here either requires TypeScript syntax (interface, `enum`,
7
+ * `namespace`, `as`, `!`, `import type`, type parameters, declaration merging,
8
+ * parameter properties, triple-slash references) or originates from
9
+ * `@typescript-eslint` as a TS-aware extension that has no counterpart in plain
10
+ * ESLint.
11
11
  *
12
12
  * Generic JS/TS rules (such as `eqeqeq`, `no-console`) stay unnamespaced in
13
13
  * {@link ITtscLintCoreRules}.
14
14
  *
15
- * This family deliberately mirrors `typescript-eslint`'s rule ids but
16
- * **only** under the `typescript/*` prefix — `@ttsc/lint` does not accept
17
- * legacy bare names or `@typescript-eslint/*` aliases for these rules.
15
+ * This family deliberately mirrors `typescript-eslint`'s rule ids but **only**
16
+ * under the `typescript/*` prefix — `@ttsc/lint` does not accept legacy bare
17
+ * names or `@typescript-eslint/*` aliases for these rules.
18
18
  *
19
19
  * @reference https://typescript-eslint.io/rules/
20
20
  */
21
21
  export interface ITtscLintTypeScriptRules {
22
22
  /**
23
- * Require overload declarations for the same member to be written
24
- * adjacently.
23
+ * Require overload declarations for the same member to be written adjacently.
25
24
  *
26
- * Splitting overloads with other members hides the full signature
27
- * set from readers and tools.
25
+ * Splitting overloads with other members hides the full signature set from
26
+ * readers and tools.
28
27
  *
29
28
  * @reference https://typescript-eslint.io/rules/adjacent-overload-signatures
30
29
  */
@@ -32,9 +31,8 @@ export interface ITtscLintTypeScriptRules {
32
31
  /**
33
32
  * Enforce one consistent spelling of array types.
34
33
  *
35
- * By default the rule prefers `T[]` / `readonly T[]` over `Array<T>`
36
- * / `ReadonlyArray<T>`, matching `@typescript-eslint`'s `array-type`
37
- * default.
34
+ * By default the rule prefers `T[]` / `readonly T[]` over `Array<T>` /
35
+ * `ReadonlyArray<T>`, matching `@typescript-eslint`'s `array-type` default.
38
36
  *
39
37
  * @reference https://typescript-eslint.io/rules/array-type
40
38
  */
@@ -42,60 +40,59 @@ export interface ITtscLintTypeScriptRules {
42
40
  /**
43
41
  * Reject `await` on operands that are not thenable.
44
42
  *
45
- * Type-aware — the Checker decides whether the awaited expression has
46
- * a `then` method. Autofixable: drops the `await`.
43
+ * Type-aware — the Checker decides whether the awaited expression has a
44
+ * `then` method. Autofixable: drops the `await`.
47
45
  *
48
46
  * @reference https://typescript-eslint.io/rules/await-thenable
49
47
  */
50
48
  "typescript/await-thenable"?: TtscLintRuleSetting;
51
49
  /**
52
- * Reject `@ts-ignore`, `@ts-expect-error`, `@ts-nocheck`, and
53
- * `@ts-check` comments.
50
+ * Reject `@ts-ignore` and `@ts-expect-error` comments.
54
51
  *
55
- * The default policy allows `@ts-expect-error` with an explanatory
56
- * `--` description.
52
+ * The rule flags both directives unconditionally. There is no
53
+ * description-based allowance, and the `@typescript-eslint` options are not
54
+ * implemented.
57
55
  *
58
56
  * @reference https://typescript-eslint.io/rules/ban-ts-comment
59
57
  */
60
58
  "typescript/ban-ts-comment"?: TtscLintRuleSetting;
61
59
  /**
62
- * Reject `// tslint:disable` and related TSLint directive comments
63
- * left behind from the legacy TSLint era.
60
+ * Reject `// tslint:disable` and related TSLint directive comments left
61
+ * behind from the legacy TSLint era.
64
62
  *
65
63
  * @reference https://typescript-eslint.io/rules/ban-tslint-comment
66
64
  */
67
65
  "typescript/ban-tslint-comment"?: TtscLintRuleSetting;
68
66
  /**
69
- * Prefer a `static readonly` field over a `get` accessor whose body
70
- * is a single `return <literal>;`. The getter form re-runs the body
71
- * on every read and obscures that the value is fixed; a readonly
72
- * field is shorter, narrows to the literal type, and signals "this
73
- * is a constant" at the call site. Skipped when the class also
74
- * declares a `set` accessor for the same member name the setter's
75
- * side effects cannot be reproduced by a field.
67
+ * Prefer a `static readonly` field over a `get` accessor whose body is a
68
+ * single `return <literal>;`. The getter form re-runs the body on every read
69
+ * and obscures that the value is fixed; a readonly field is shorter, narrows
70
+ * to the literal type, and signals "this is a constant" at the call site.
71
+ * Skipped when the class also declares a `set` accessor for the same member
72
+ * name the setter's side effects cannot be reproduced by a field.
76
73
  *
77
74
  * @reference https://typescript-eslint.io/rules/class-literal-property-style
78
75
  */
79
76
  "typescript/class-literal-property-style"?: TtscLintRuleSetting;
80
77
  /**
81
- * Prefer `Record<K, V>` over `{ [key: K]: V }` when an object type
82
- * has a single index signature and no other members.
78
+ * Prefer `Record<K, V>` over `{ [key: K]: V }` when an object type has a
79
+ * single index signature and no other members.
83
80
  *
84
81
  * @reference https://typescript-eslint.io/rules/consistent-indexed-object-style
85
82
  */
86
83
  "typescript/consistent-indexed-object-style"?: TtscLintRuleSetting;
87
84
  /**
88
- * Prefer the `as` form of type assertions over the angle-bracket
89
- * form `<T>expr`, which is ambiguous inside JSX.
85
+ * Prefer the `as` form of type assertions over the angle-bracket form
86
+ * `<T>expr`, which is ambiguous inside JSX.
90
87
  *
91
88
  * @reference https://typescript-eslint.io/rules/consistent-type-assertions
92
89
  */
93
90
  "typescript/consistent-type-assertions"?: TtscLintRuleSetting;
94
91
  /**
95
- * Reject the redundant pattern where a variable is annotated with a
96
- * generic type AND the same generic arguments are repeated on the
97
- * constructor: `const m: Map<K, V> = new Map<K, V>()`. One of the
98
- * two type-argument lists carries the binding; stating both is noise.
92
+ * Reject the redundant pattern where a variable is annotated with a generic
93
+ * type AND the same generic arguments are repeated on the constructor: `const
94
+ * m: Map<K, V> = new Map<K, V>()`. One of the two type-argument lists carries
95
+ * the binding; stating both is noise.
99
96
  *
100
97
  * @reference https://typescript-eslint.io/rules/consistent-generic-constructors
101
98
  */
@@ -103,53 +100,51 @@ export interface ITtscLintTypeScriptRules {
103
100
  /**
104
101
  * Enforce one consistent shape for object types.
105
102
  *
106
- * By default the rule prefers `interface` over `type` aliases for
107
- * plain object shapes.
103
+ * By default the rule prefers `interface` over `type` aliases for plain
104
+ * object shapes.
108
105
  *
109
106
  * @reference https://typescript-eslint.io/rules/consistent-type-definitions
110
107
  */
111
108
  "typescript/consistent-type-definitions"?: TtscLintRuleSetting;
112
109
  /**
113
- * Require type-only re-exports to use `export type { ... }` instead
114
- * of the value form `export { ... }` when the exported binding only
115
- * refers to a type alias or interface in the same file. The type
116
- * form has no runtime cost and signals intent to the downstream
117
- * import.
110
+ * Require type-only re-exports to use `export type { ... }` instead of the
111
+ * value form `export { ... }` when the exported binding only refers to a type
112
+ * alias or interface in the same file. The type form has no runtime cost and
113
+ * signals intent to the downstream import.
118
114
  *
119
115
  * @reference https://typescript-eslint.io/rules/consistent-type-exports
120
116
  */
121
117
  "typescript/consistent-type-exports"?: TtscLintRuleSetting;
122
118
  /**
123
- * Require imports that only reference types to use `import type {}`
124
- * so the import has no runtime cost.
119
+ * Require imports that only reference types to use `import type {}` so the
120
+ * import has no runtime cost.
125
121
  *
126
122
  * @reference https://typescript-eslint.io/rules/consistent-type-imports
127
123
  */
128
124
  "typescript/consistent-type-imports"?: TtscLintRuleSetting;
129
125
  /**
130
- * Require every exported function and method declaration to carry an
131
- * explicit return-type annotation. Implicit return types let
132
- * downstream consumers depend on inference details that can shift
133
- * with future edits; the explicit annotation pins the contract.
126
+ * Require every exported function and method declaration to carry an explicit
127
+ * return-type annotation. Implicit return types let downstream consumers
128
+ * depend on inference details that can shift with future edits; the explicit
129
+ * annotation pins the contract.
134
130
  *
135
131
  * @reference https://typescript-eslint.io/rules/explicit-function-return-type
136
132
  */
137
133
  "typescript/explicit-function-return-type"?: TtscLintRuleSetting;
138
134
  /**
139
- * Require an explicit accessibility modifier (`public`, `private`,
140
- * or `protected`) on every class member declaration. Implicit
141
- * public is permitted by TypeScript but obscures intent — the
142
- * modifier makes the encapsulation contract self-documenting.
143
- * Members declared with the `#name` private-hash form are exempt.
135
+ * Require an explicit accessibility modifier (`public`, `private`, or
136
+ * `protected`) on every class member declaration. Implicit public is
137
+ * permitted by TypeScript but obscures intent — the modifier makes the
138
+ * encapsulation contract self-documenting. Members declared with the `#name`
139
+ * private-hash form are exempt.
144
140
  *
145
141
  * @reference https://typescript-eslint.io/rules/explicit-member-accessibility
146
142
  */
147
143
  "typescript/explicit-member-accessibility"?: TtscLintRuleSetting;
148
144
  /**
149
- * Prefer a function-property signature (`f: () => void`) over a
150
- * shorthand method signature (`f(): void`) in interfaces and
151
- * type literals so the strict-function-types contravariance check
152
- * applies.
145
+ * Prefer a function-property signature (`f: () => void`) over a shorthand
146
+ * method signature (`f(): void`) in interfaces and type literals so the
147
+ * strict-function-types contravariance check applies.
153
148
  *
154
149
  * @reference https://typescript-eslint.io/rules/method-signature-style
155
150
  */
@@ -163,86 +158,82 @@ export interface ITtscLintTypeScriptRules {
163
158
  */
164
159
  "typescript/no-array-delete"?: TtscLintRuleSetting;
165
160
  /**
166
- * Prefer `for ... of` over `Array.prototype.forEach()`. The for-of
167
- * form supports early termination (`break`/`return`) and `await`,
168
- * while `forEach` swallows both.
161
+ * Prefer `for ... of` over `Array.prototype.forEach()`. The for-of form
162
+ * supports early termination (`break`/`return`) and `await`, while `forEach`
163
+ * swallows both.
169
164
  *
170
165
  * @reference https://typescript-eslint.io/rules/no-array-for-each
171
166
  */
172
167
  "typescript/no-array-for-each"?: TtscLintRuleSetting;
173
168
  /**
174
- * Reject string-coercion contexts (`` `${x}` ``, `x + ""`, `String(x)`)
175
- * where `x` has a type whose `toString` resolves to the default
169
+ * Reject string-coercion contexts (`${x}`, `x + ""`, `String(x)`) where `x`
170
+ * has a type whose `toString` resolves to the default
176
171
  * `Object.prototype.toString` and would print `"[object Object]"`.
177
172
  *
178
- * Type-aware via the Checker. Stringish primitives, `Date`, `Error`,
179
- * arrays, regexes, and any object that overrides `toString` are safe;
180
- * plain `{}` literals, `Record<...>` shapes, and structural interfaces
181
- * with no `toString` member are the ones that produce the useless
182
- * default string.
173
+ * Type-aware via the Checker. Stringish primitives, `Date`, `Error`, arrays,
174
+ * regexes, and any object that overrides `toString` are safe; plain `{}`
175
+ * literals, `Record<...>` shapes, and structural interfaces with no
176
+ * `toString` member are the ones that produce the useless default string.
183
177
  *
184
178
  * @reference https://typescript-eslint.io/rules/no-base-to-string
185
179
  */
186
180
  "typescript/no-base-to-string"?: TtscLintRuleSetting;
187
181
  /**
188
- * Reject classes that exist purely as a namespace for static members
189
- * or that are entirely empty. A namespace import or plain functions
190
- * are clearer than `class Util { static foo() {} }` — the class adds
191
- * indirection without providing instance behavior.
182
+ * Reject classes that exist purely as a namespace for static members or that
183
+ * are entirely empty. A namespace import or plain functions are clearer than
184
+ * `class Util { static foo() {} }` — the class adds indirection without
185
+ * providing instance behavior.
192
186
  *
193
187
  * @reference https://typescript-eslint.io/rules/no-extraneous-class
194
188
  */
195
189
  "typescript/no-extraneous-class"?: TtscLintRuleSetting;
196
190
  /**
197
- * Reject non-null assertions placed where they visually merge with
198
- * a following operator — `a! == b` (reads as `!=`), `a! in b`, or
199
- * `a! instanceof B`.
191
+ * Reject non-null assertions placed where they visually merge with a
192
+ * following operator — `a! == b` (reads as `!=`), `a! in b`, or `a!
193
+ * instanceof B`.
200
194
  *
201
- * Wrap the assertion in parentheses (`(a!) == b`) or drop it
202
- * entirely.
195
+ * Wrap the assertion in parentheses (`(a!) == b`) or drop it entirely.
203
196
  *
204
197
  * @reference https://typescript-eslint.io/rules/no-confusing-non-null-assertion
205
198
  */
206
199
  "typescript/no-confusing-non-null-assertion"?: TtscLintRuleSetting;
207
200
  /**
208
- * Reject `void X` expressions used in any position where the
209
- * surrounding context expects a value — initializer, call argument,
210
- * `return` operand, conditional, binary, or ternary subexpression.
201
+ * Reject `void X` expressions used in any position where the surrounding
202
+ * context expects a value — initializer, call argument, `return` operand,
203
+ * conditional, binary, or ternary subexpression.
211
204
  *
212
- * The only acceptable positions are an expression statement
213
- * (`void x;`), an arrow function's concise body (`() => void x`),
214
- * and the operand of an enclosing `void` operator (`void void x`).
205
+ * The only acceptable positions are an expression statement (`void x;`), an
206
+ * arrow function's concise body (`() => void x`), and the operand of an
207
+ * enclosing `void` operator (`void void x`).
215
208
  *
216
209
  * @reference https://typescript-eslint.io/rules/no-confusing-void-expression
217
210
  */
218
211
  "typescript/no-confusing-void-expression"?: TtscLintRuleSetting;
219
212
  /**
220
- * Reject references to declarations marked `@deprecated` in their
221
- * JSDoc.
213
+ * Reject references to declarations marked `@deprecated` in their JSDoc.
222
214
  *
223
215
  * Type-aware via the Checker. The rule resolves the symbol at each
224
- * identifier, property access, call, `new`, or JSX tag-name location,
225
- * walks the symbol's declarations for an attached `@deprecated`
226
- * JSDoc tag, and reports at the reference. References inside the
227
- * same declaration block as the deprecation marker are skipped so
228
- * the deprecation site itself doesn't fire.
216
+ * identifier, property access, call, `new`, or JSX tag-name location, walks
217
+ * the symbol's declarations for an attached `@deprecated` JSDoc tag, and
218
+ * reports at the reference. References inside the same declaration block as
219
+ * the deprecation marker are skipped so the deprecation site itself doesn't
220
+ * fire.
229
221
  *
230
222
  * @reference https://typescript-eslint.io/rules/no-deprecated
231
223
  */
232
224
  "typescript/no-deprecated"?: TtscLintRuleSetting;
233
225
  /**
234
- * Reject `enum` declarations whose members share the same literal
235
- * value.
226
+ * Reject `enum` declarations whose members share the same literal value.
236
227
  *
237
- * Reverse lookup (`E[E.X]`) returns whichever member is listed last,
238
- * so duplicates almost always reflect a copy-paste mistake.
228
+ * Reverse lookup (`E[E.X]`) returns whichever member is listed last, so
229
+ * duplicates almost always reflect a copy-paste mistake.
239
230
  *
240
231
  * @reference https://typescript-eslint.io/rules/no-duplicate-enum-values
241
232
  */
242
233
  "typescript/no-duplicate-enum-values"?: TtscLintRuleSetting;
243
234
  /**
244
- * Reject computed bracket-key `delete` expressions (`delete obj[x]`)
245
- * where `x` is not a string literal, since these escape type tracking.
235
+ * Reject computed bracket-key `delete` expressions (`delete obj[x]`) where
236
+ * `x` is not a string literal, since these escape type tracking.
246
237
  *
247
238
  * @reference https://typescript-eslint.io/rules/no-dynamic-delete
248
239
  */
@@ -250,8 +241,8 @@ export interface ITtscLintTypeScriptRules {
250
241
  /**
251
242
  * Reject empty `interface` declarations.
252
243
  *
253
- * An empty interface that does not `extends` anything is equivalent
254
- * to `unknown` and almost always represents incomplete typing work.
244
+ * An empty interface that does not `extends` anything is equivalent to
245
+ * `unknown` and almost always represents incomplete typing work.
255
246
  *
256
247
  * @reference https://typescript-eslint.io/rules/no-empty-interface
257
248
  */
@@ -259,9 +250,9 @@ export interface ITtscLintTypeScriptRules {
259
250
  /**
260
251
  * Reject `{}` as a type annotation.
261
252
  *
262
- * `{}` matches every non-nullish value and is almost never intended;
263
- * use `Record<string, unknown>` for a generic object, or `object` for
264
- * any non-primitive.
253
+ * `{}` matches every non-nullish value and is almost never intended; use
254
+ * `Record<string, unknown>` for a generic object, or `object` for any
255
+ * non-primitive.
265
256
  *
266
257
  * @reference https://typescript-eslint.io/rules/no-empty-object-type
267
258
  */
@@ -275,90 +266,88 @@ export interface ITtscLintTypeScriptRules {
275
266
  */
276
267
  "typescript/no-explicit-any"?: TtscLintRuleSetting;
277
268
  /**
278
- * Reject `x!!` — chained non-null assertions where the inner one
279
- * already removes nullability. Autofixable: drops the extra `!`.
269
+ * Reject `x!!` — chained non-null assertions where the inner one already
270
+ * removes nullability. Autofixable: drops the extra `!`.
280
271
  *
281
272
  * @reference https://typescript-eslint.io/rules/no-extra-non-null-assertion
282
273
  */
283
274
  "typescript/no-extra-non-null-assertion"?: TtscLintRuleSetting;
284
275
  /**
285
- * Reject Promise-typed expressions whose result is discarded — most
286
- * often a bare `getPromise();` expression statement.
276
+ * Reject Promise-typed expressions whose result is discarded — most often a
277
+ * bare `getPromise();` expression statement.
287
278
  *
288
- * Type-aware via the Checker. A floating promise loses its rejection
289
- * channel and runs out of order with surrounding code. Acceptable
290
- * sinks are `await`, `.catch(...)`, `.then(_, onRejected)`,
291
- * `.finally(...)`, assignment, the `void` operator, and `return`.
279
+ * Type-aware via the Checker. A floating promise loses its rejection channel
280
+ * and runs out of order with surrounding code. Acceptable sinks are `await`,
281
+ * `.catch(...)`, `.then(_, onRejected)`, `.finally(...)`, assignment, the
282
+ * `void` operator, and `return`.
292
283
  *
293
284
  * @reference https://typescript-eslint.io/rules/no-floating-promises
294
285
  */
295
286
  "typescript/no-floating-promises"?: TtscLintRuleSetting;
296
287
  /**
297
- * Reject `for (const k in arr)` where `arr` is statically typed as an
298
- * array or tuple.
288
+ * Reject `for (const k in arr)` where `arr` is statically typed as an array
289
+ * or tuple.
299
290
  *
300
- * Type-aware via the Checker. `for...in` iterates enumerable property
301
- * names (yielded as strings, including any inherited or custom-added
302
- * members), not array values or numeric indices — almost always a
303
- * mistake for `for...of`, `Array#forEach`, or an indexed `for` loop.
291
+ * Type-aware via the Checker. `for...in` iterates enumerable property names
292
+ * (yielded as strings, including any inherited or custom-added members), not
293
+ * array values or numeric indices — almost always a mistake for `for...of`,
294
+ * `Array#forEach`, or an indexed `for` loop.
304
295
  *
305
296
  * @reference https://typescript-eslint.io/rules/no-for-in-array
306
297
  */
307
298
  "typescript/no-for-in-array"?: TtscLintRuleSetting;
308
299
  /**
309
- * Hoist inline `type` modifiers on individual imports into a single
310
- * top-level `import type {}`. Autofixable.
300
+ * Hoist inline `type` modifiers on individual imports into a single top-level
301
+ * `import type {}`. Autofixable.
311
302
  *
312
303
  * @reference https://typescript-eslint.io/rules/no-import-type-side-effects
313
304
  */
314
305
  "typescript/no-import-type-side-effects"?: TtscLintRuleSetting;
315
306
  /**
316
- * Reject explicit type annotations that TypeScript can already
317
- * infer from the initializer (`const x: number = 1`).
307
+ * Reject explicit type annotations that TypeScript can already infer from the
308
+ * initializer (`const x: number = 1`).
318
309
  *
319
310
  * @reference https://typescript-eslint.io/rules/no-inferrable-types
320
311
  */
321
312
  "typescript/no-inferrable-types"?: TtscLintRuleSetting;
322
313
  /**
323
- * Reject `void` used as anything other than a function return type.
324
- * `void` in a union (`string | void`) or as a non-allow-listed
325
- * generic argument is almost always a confusion with `undefined`.
326
- * Allowed positions: function/method/arrow return-type annotations
327
- * and generic arguments to `Promise` / `Generator` /
328
- * `AsyncGenerator` / `Iterator` / `AsyncIterator` /
314
+ * Reject `void` used as anything other than a function return type. `void` in
315
+ * a union (`string | void`) or as a non-allow-listed generic argument is
316
+ * almost always a confusion with `undefined`. Allowed positions:
317
+ * function/method/arrow return-type annotations and generic arguments to
318
+ * `Promise` / `Generator` / `AsyncGenerator` / `Iterator` / `AsyncIterator` /
329
319
  * `IterableIterator` / `AsyncIterableIterator`.
330
320
  *
331
321
  * @reference https://typescript-eslint.io/rules/no-invalid-void-type
332
322
  */
333
323
  "typescript/no-invalid-void-type"?: TtscLintRuleSetting;
334
324
  /**
335
- * TypeScript-aware extension of `no-magic-numbers` that additionally ignores enum member values.
325
+ * TypeScript-aware extension of `no-magic-numbers` that additionally ignores
326
+ * enum member values.
336
327
  *
337
328
  * @reference https://typescript-eslint.io/rules/no-magic-numbers
338
329
  */
339
330
  "typescript/no-magic-numbers"?: TtscLintRuleSetting;
340
331
  /**
341
- * Reject `void X` where `X` is already statically typed `void` — the
342
- * `void` operator adds nothing because the operand already evaluates
343
- * to `undefined`. The operator is meaningful only on a value-
344
- * returning expression that the caller wants to discard.
332
+ * Reject `void X` where `X` is already statically typed `void` — the `void`
333
+ * operator adds nothing because the operand already evaluates to `undefined`.
334
+ * The operator is meaningful only on a value- returning expression that the
335
+ * caller wants to discard.
345
336
  *
346
- * Type-aware — the Checker decides whether the operand carries the
347
- * `void` type. The upstream `checkNever` option is left at its
348
- * default of `false`: only `void`-typed operands trigger, `never`
349
- * does not.
337
+ * Type-aware — the Checker decides whether the operand carries the `void`
338
+ * type. The upstream `checkNever` option is left at its default of `false`:
339
+ * only `void`-typed operands trigger, `never` does not.
350
340
  *
351
341
  * @reference https://typescript-eslint.io/rules/no-meaningless-void-operator
352
342
  */
353
343
  "typescript/no-meaningless-void-operator"?: TtscLintRuleSetting;
354
344
  /**
355
- * Reject signatures that fake a constructor or an instance `new`
356
- * method — `interface I { new (): I }` (TypeScript treats this as
357
- * the type of `new I()` regardless of intent) and `class C { new():
358
- * C }`.
345
+ * Reject signatures that fake a constructor or an instance `new` method —
346
+ * `interface I { new (): I }` (TypeScript treats this as the type of `new
347
+ * I()` regardless of intent) and `class C { new(): C }`.
359
348
  *
360
- * Use a separate construct signature on a factory type when the
361
- * intent is "anything callable with `new`".
349
+ * Use a separate construct signature on a factory type when the intent is
350
+ * "anything callable with `new`".
362
351
  *
363
352
  * @reference https://typescript-eslint.io/rules/no-misused-new
364
353
  */
@@ -366,58 +355,56 @@ export interface ITtscLintTypeScriptRules {
366
355
  /**
367
356
  * Reject Promise values supplied where a non-Promise was expected.
368
357
  *
369
- * Covers conditional positions (`if (promise)`, `while`, `for`,
370
- * ternary, `&&`, `||`, `??`) where the Promise is truthy by
371
- * reference, and `async` callbacks passed to APIs that expect a
372
- * void-returning function (e.g. `Array#forEach`, JSX event
373
- * handlers), where the returned Promise is silently dropped.
358
+ * Covers conditional positions (`if (promise)`, `while`, `for`, ternary,
359
+ * `&&`, `||`, `??`) where the Promise is truthy by reference, and `async`
360
+ * callbacks passed to APIs that expect a void-returning function (e.g.
361
+ * `Array#forEach`, JSX event handlers), where the returned Promise is
362
+ * silently dropped.
374
363
  *
375
364
  * @reference https://typescript-eslint.io/rules/no-misused-promises
376
365
  */
377
366
  "typescript/no-misused-promises"?: TtscLintRuleSetting;
378
367
  /**
379
- * Reject spread expressions whose operand is syntactically wrong
380
- * for the surrounding context.
368
+ * Reject spread expressions whose operand is syntactically wrong for the
369
+ * surrounding context.
381
370
  *
382
- * AST-only subset of the upstream rule — no Checker required.
383
- * Fires on object literal spread inside an array literal or a
384
- * call/construct argument (`[...{ a: 1 }]`, `f(...{ a: 1 })`) and
385
- * on array literal spread inside an object literal
386
- * (`{ ...[1, 2] }`). General iterability detection still needs the
371
+ * AST-only subset of the upstream rule — no Checker required. Fires on object
372
+ * literal spread inside an array literal or a call/construct argument (`[...{
373
+ * a: 1 }]`, `f(...{ a: 1 })`) and on array literal spread inside an object
374
+ * literal (`{ ...[1, 2] }`). General iterability detection still needs the
387
375
  * full type-aware rule.
388
376
  *
389
377
  * @reference https://typescript-eslint.io/rules/no-misused-spread
390
378
  */
391
379
  "typescript/no-misused-spread"?: TtscLintRuleSetting;
392
380
  /**
393
- * Reject `enum`s that mix numeric and string members, which makes
394
- * the resulting type unsafe for reverse lookups.
381
+ * Reject `enum`s that mix numeric and string members, which makes the
382
+ * resulting type unsafe for reverse lookups.
395
383
  *
396
384
  * @reference https://typescript-eslint.io/rules/no-mixed-enums
397
385
  */
398
386
  "typescript/no-mixed-enums"?: TtscLintRuleSetting;
399
387
  /**
400
- * Reject non-ambient `namespace` and `module Foo {}` declarations
401
- * in regular `.ts` files.
388
+ * Reject non-ambient `namespace` and `module Foo {}` declarations in regular
389
+ * `.ts` files.
402
390
  *
403
391
  * ES modules replace the legacy namespace concept; ambient `declare
404
- * namespace` in `.d.ts` files stays allowed by default for global
405
- * typings compatibility.
392
+ * namespace` in `.d.ts` files stays allowed by default for global typings
393
+ * compatibility.
406
394
  *
407
395
  * @reference https://typescript-eslint.io/rules/no-namespace
408
396
  */
409
397
  "typescript/no-namespace"?: TtscLintRuleSetting;
410
398
  /**
411
- * Reject `x! ?? y` — the `!` collapses `null | undefined` to a
412
- * non-nullish value, so the `??` branch is unreachable.
399
+ * Reject `x! ?? y` — the `!` collapses `null | undefined` to a non-nullish
400
+ * value, so the `??` branch is unreachable.
413
401
  *
414
402
  * @reference https://typescript-eslint.io/rules/no-non-null-asserted-nullish-coalescing
415
403
  */
416
404
  "typescript/no-non-null-asserted-nullish-coalescing"?: TtscLintRuleSetting;
417
405
  /**
418
406
  * Reject `x!?.y` — the non-null assertion makes the optional chain
419
- * meaningless because the inner expression is already known to be
420
- * defined.
407
+ * meaningless because the inner expression is already known to be defined.
421
408
  *
422
409
  * @reference https://typescript-eslint.io/rules/no-non-null-asserted-optional-chain
423
410
  */
@@ -425,151 +412,145 @@ export interface ITtscLintTypeScriptRules {
425
412
  /**
426
413
  * Reject postfix `!` non-null assertions altogether.
427
414
  *
428
- * The operator suppresses a real `null` / `undefined` possibility
429
- * without inserting a check; prefer a narrowing branch, optional
430
- * chaining, or refining the type at its source.
415
+ * The operator suppresses a real `null` / `undefined` possibility without
416
+ * inserting a check; prefer a narrowing branch, optional chaining, or
417
+ * refining the type at its source.
431
418
  *
432
419
  * @reference https://typescript-eslint.io/rules/no-non-null-assertion
433
420
  */
434
421
  "typescript/no-non-null-assertion"?: TtscLintRuleSetting;
435
422
  /**
436
- * Reject union and intersection type constituents that the type
437
- * system absorbs anyway — `string | any` collapses to `any`,
438
- * `T & never` collapses to `never`, `T & unknown` collapses to `T`,
439
- * and repeated constituents add nothing.
423
+ * Reject union and intersection type constituents that the type system
424
+ * absorbs anyway — `string | any` collapses to `any`, `T & never` collapses
425
+ * to `never`, `T & unknown` collapses to `T`, and repeated constituents add
426
+ * nothing.
440
427
  *
441
- * AST-only baseline: only the literal `any` / `unknown` / `never`
442
- * keyword constituents and duplicates matched by textual identity
443
- * are reported. Subset relations such as `string | "foo"` and
444
- * generic alias resolution still require the type-aware path.
428
+ * AST-only baseline: only the literal `any` / `unknown` / `never` keyword
429
+ * constituents and duplicates matched by textual identity are reported.
430
+ * Subset relations such as `string | "foo"` and generic alias resolution
431
+ * still require the type-aware path.
445
432
  *
446
433
  * @reference https://typescript-eslint.io/rules/no-redundant-type-constituents
447
434
  */
448
435
  "typescript/no-redundant-type-constituents"?: TtscLintRuleSetting;
449
436
  /**
450
- * Reject specific type-reference names that are almost always a
451
- * mistake — by default the global wrapper types `Object`, `Function`,
452
- * `Number`, `String`, and `Boolean`. The lowercase primitives
453
- * (`number`, `string`, `boolean`) and explicit call signatures
454
- * convey the intended type without the runtime-boxing semantics that
455
- * the wrapper names imply.
437
+ * Reject specific type-reference names that are almost always a mistake — by
438
+ * default the global wrapper types `Object`, `Function`, `Number`, `String`,
439
+ * and `Boolean`. The lowercase primitives (`number`, `string`, `boolean`) and
440
+ * explicit call signatures convey the intended type without the
441
+ * runtime-boxing semantics that the wrapper names imply.
456
442
  *
457
- * AST-only baseline: shadow guard reuses the same file-scope check
458
- * as `no-wrapper-object-types` so a user-declared `interface String
459
- * {}` is not flagged as the global wrapper.
443
+ * AST-only baseline: shadow guard reuses the same file-scope check as
444
+ * `no-wrapper-object-types` so a user-declared `interface String {}` is not
445
+ * flagged as the global wrapper.
460
446
  *
461
447
  * @reference https://typescript-eslint.io/rules/no-restricted-types
462
448
  */
463
449
  "typescript/no-restricted-types"?: TtscLintRuleSetting;
464
450
  /**
465
- * Reject `require(...)` calls and `import x = require(...)`
466
- * declarations.
451
+ * Reject `require(...)` calls and `import x = require(...)` declarations.
467
452
  *
468
- * Use ES module `import` syntax so the type-only / runtime-import
469
- * distinction is preserved and declaration shape stays consistent.
453
+ * Use ES module `import` syntax so the type-only / runtime-import distinction
454
+ * is preserved and declaration shape stays consistent.
470
455
  *
471
456
  * @reference https://typescript-eslint.io/rules/no-require-imports
472
457
  */
473
458
  "typescript/no-require-imports"?: TtscLintRuleSetting;
474
459
  /**
475
- * Reject aliasing `this` to a local (`const self = this`, `const
476
- * that = this`, destructuring `const { x } = this`).
460
+ * Reject aliasing `this` to a local (`const self = this`, `const that =
461
+ * this`, destructuring `const { x } = this`).
477
462
  *
478
- * Arrow functions and `.bind(this)` make the workaround unnecessary;
479
- * the alias also breaks type narrowing on `this`.
463
+ * Arrow functions and `.bind(this)` make the workaround unnecessary; the
464
+ * alias also breaks type narrowing on `this`.
480
465
  *
481
466
  * @reference https://typescript-eslint.io/rules/no-this-alias
482
467
  */
483
468
  "typescript/no-this-alias"?: TtscLintRuleSetting;
484
469
  /**
485
- * Reject direct comparison of a boolean-typed value with `true` /
486
- * `false` literals — `x === true` is just `x`, `x !== false` is
487
- * just `x`. The literal compare adds noise without changing the
488
- * result whenever the non-literal side is provably pure boolean.
470
+ * Reject direct comparison of a boolean-typed value with `true` / `false`
471
+ * literals — `x === true` is just `x`, `x !== false` is just `x`. The literal
472
+ * compare adds noise without changing the result whenever the non-literal
473
+ * side is provably pure boolean.
489
474
  *
490
- * Type-aware via the Checker. Skipped when the value side carries
491
- * `null` / `undefined` — the literal compare is also stripping
492
- * nullability there, and the rewrite would lose information.
475
+ * Type-aware via the Checker. Skipped when the value side carries `null` /
476
+ * `undefined` — the literal compare is also stripping nullability there, and
477
+ * the rewrite would lose information.
493
478
  *
494
479
  * @reference https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare
495
480
  */
496
481
  "typescript/no-unnecessary-boolean-literal-compare"?: TtscLintRuleSetting;
497
482
  /**
498
- * Reject conditions whose static type proves the runtime truthiness
499
- * is fixed — `if ({})`, `if (null)`, `while ("")`, `0 && f()`. The
500
- * conditional becomes either dead code (the always-false arm) or
501
- * unconditional execution (the always-true arm); the explicit shape
502
- * (`if (true)`, deleting the dead branch, or widening the type)
503
- * names the intent.
483
+ * Reject conditions whose static type proves the runtime truthiness is fixed
484
+ * — `if ({})`, `if (null)`, `while ("")`, `0 && f()`. The conditional becomes
485
+ * either dead code (the always-false arm) or unconditional execution (the
486
+ * always-true arm); the explicit shape (`if (true)`, deleting the dead
487
+ * branch, or widening the type) names the intent.
504
488
  *
505
- * Type-aware via the Checker. The rule stays silent on `any`,
506
- * `unknown`, plain `boolean`, plain `string`, plain `number`,
507
- * unions that mix truthy and falsy outcomes, and any other shape
508
- * whose runtime truthiness is not statically decidable — only the
509
- * provably always-truthy / always-falsy positions are flagged.
489
+ * Type-aware via the Checker. The rule stays silent on `any`, `unknown`,
490
+ * plain `boolean`, plain `string`, plain `number`, unions that mix truthy and
491
+ * falsy outcomes, and any other shape whose runtime truthiness is not
492
+ * statically decidable — only the provably always-truthy / always-falsy
493
+ * positions are flagged.
510
494
  *
511
495
  * @reference https://typescript-eslint.io/rules/no-unnecessary-condition
512
496
  */
513
497
  "typescript/no-unnecessary-condition"?: TtscLintRuleSetting;
514
498
  /**
515
- * Reject `this.x = x` in a constructor body when `x` is already
516
- * declared as a parameter property — TypeScript performs the
517
- * assignment automatically.
499
+ * Reject `this.x = x` in a constructor body when `x` is already declared as a
500
+ * parameter property — TypeScript performs the assignment automatically.
518
501
  *
519
502
  * @reference https://typescript-eslint.io/rules/no-unnecessary-parameter-property-assignment
520
503
  */
521
504
  "typescript/no-unnecessary-parameter-property-assignment"?: TtscLintRuleSetting;
522
505
  /**
523
- * Reject `Foo.Bar` references written inside `namespace Foo { ... }`
524
- * or `enum Foo { ..., X = Foo.Y, ... }` where the `Foo.` qualifier
525
- * names the same lexical scope the access lives in. Dropping the
526
- * qualifier leaves the identical binding lookup.
506
+ * Reject `Foo.Bar` references written inside `namespace Foo { ... }` or `enum
507
+ * Foo { ..., X = Foo.Y, ... }` where the `Foo.` qualifier names the same
508
+ * lexical scope the access lives in. Dropping the qualifier leaves the
509
+ * identical binding lookup.
527
510
  *
528
511
  * AST-only: walks `Parent` links for an enclosing namespace or enum
529
- * declaration whose identifier matches the qualifier's head. The
530
- * Checker is not required because the upstream rule operates on
531
- * lexical scope identity, which the AST already encodes via
532
- * declaration ancestry.
512
+ * declaration whose identifier matches the qualifier's head. The Checker is
513
+ * not required because the upstream rule operates on lexical scope identity,
514
+ * which the AST already encodes via declaration ancestry.
533
515
  *
534
516
  * @reference https://typescript-eslint.io/rules/no-unnecessary-qualifier
535
517
  */
536
518
  "typescript/no-unnecessary-qualifier"?: TtscLintRuleSetting;
537
519
  /**
538
520
  * Reject template literals that carry no template-only behavior — a
539
- * `` `${"abc"}` `` interpolation, a lone `` `${name}` `` span around
540
- * a string-typed value, or a `` `abc` `` no-substitution literal with
541
- * no escaped backticks. Each of these collapses to a regular string
542
- * literal without changing meaning, so the backtick form is just noise.
521
+ * `${"abc"}` interpolation, a lone `${name}` span around a string-typed
522
+ * value, or a `abc` no-substitution literal with no escaped backticks. Each
523
+ * of these collapses to a regular string literal without changing meaning, so
524
+ * the backtick form is just noise.
543
525
  *
544
- * Type-aware via the Checker. The interpolation forms are flagged only
545
- * when the span's expression statically resolves to a string-like type
546
- * and the surrounding head / tail text is empty — the runtime coercion
547
- * is then a no-op, mirroring the upstream rule.
526
+ * Type-aware via the Checker. The interpolation forms are flagged only when
527
+ * the span's expression statically resolves to a string-like type and the
528
+ * surrounding head / tail text is empty — the runtime coercion is then a
529
+ * no-op, mirroring the upstream rule.
548
530
  *
549
531
  * @reference https://typescript-eslint.io/rules/no-unnecessary-template-expression
550
532
  */
551
533
  "typescript/no-unnecessary-template-expression"?: TtscLintRuleSetting;
552
534
  /**
553
- * Reject `Foo<DefaultT>` calls where the supplied generic argument is
554
- * the same as the parameter's default — the argument adds nothing.
535
+ * Reject `Foo<DefaultT>` calls where the supplied generic argument is the
536
+ * same as the parameter's default — the argument adds nothing.
555
537
  *
556
- * Type-aware via the Checker. Walks the resolved type parameters of
557
- * the call's signature and compares each explicit argument against
558
- * the parameter's declared default. Only the contiguous trailing run
559
- * of default-equal arguments is reported — TypeScript can only omit
560
- * a suffix of the type-argument list.
538
+ * Type-aware via the Checker. Walks the resolved type parameters of the
539
+ * call's signature and compares each explicit argument against the
540
+ * parameter's declared default. Only the contiguous trailing run of
541
+ * default-equal arguments is reported — TypeScript can only omit a suffix of
542
+ * the type-argument list.
561
543
  *
562
544
  * @reference https://typescript-eslint.io/rules/no-unnecessary-type-arguments
563
545
  */
564
546
  "typescript/no-unnecessary-type-arguments"?: TtscLintRuleSetting;
565
547
  /**
566
- * Reject `x as T` and `<T>x` assertions whose target type is the same
567
- * as `x`'s already-known static type — the assertion adds nothing.
548
+ * Reject `x as T` and `<T>x` assertions whose target type is the same as
549
+ * `x`'s already-known static type — the assertion adds nothing.
568
550
  *
569
- * Also rejects `x!` non-null assertions when `x` is already
570
- * statically non-nullable. The `as const` syntax is excluded because
571
- * it produces a strictly different type and is handled by the
572
- * `prefer-as-const` rule.
551
+ * Also rejects `x!` non-null assertions when `x` is already statically
552
+ * non-nullable. The `as const` syntax is excluded because it produces a
553
+ * strictly different type and is handled by the `prefer-as-const` rule.
573
554
  *
574
555
  * Type-aware via the Checker.
575
556
  *
@@ -577,16 +558,16 @@ export interface ITtscLintTypeScriptRules {
577
558
  */
578
559
  "typescript/no-unnecessary-type-assertion"?: TtscLintRuleSetting;
579
560
  /**
580
- * Reject `<T extends unknown>` and similar constraints that match
581
- * everything. Autofixable: drops the constraint.
561
+ * Reject `<T extends unknown>` and similar constraints that match everything.
562
+ * Autofixable: drops the constraint.
582
563
  *
583
564
  * @reference https://typescript-eslint.io/rules/no-unnecessary-type-constraint
584
565
  */
585
566
  "typescript/no-unnecessary-type-constraint"?: TtscLintRuleSetting;
586
567
  /**
587
568
  * Reject passing an `any`-typed value into a parameter whose type is
588
- * concrete. The call still runs, but every static guarantee the
589
- * function's signature would otherwise enforce is silently dropped.
569
+ * concrete. The call still runs, but every static guarantee the function's
570
+ * signature would otherwise enforce is silently dropped.
590
571
  *
591
572
  * Type-aware via the Checker. `unknown` is not flagged.
592
573
  *
@@ -594,9 +575,9 @@ export interface ITtscLintTypeScriptRules {
594
575
  */
595
576
  "typescript/no-unsafe-argument"?: TtscLintRuleSetting;
596
577
  /**
597
- * Reject assigning an `any`-typed value into a concretely typed
598
- * location — variable initializer with an explicit annotation, or a
599
- * reassignment whose left-hand side has a static type.
578
+ * Reject assigning an `any`-typed value into a concretely typed location —
579
+ * variable initializer with an explicit annotation, or a reassignment whose
580
+ * left-hand side has a static type.
600
581
  *
601
582
  * Type-aware via the Checker. `unknown` is not flagged.
602
583
  *
@@ -604,9 +585,9 @@ export interface ITtscLintTypeScriptRules {
604
585
  */
605
586
  "typescript/no-unsafe-assignment"?: TtscLintRuleSetting;
606
587
  /**
607
- * Reject calling a value whose static type is `any`. The runtime
608
- * call still happens, but the signature is unchecked and the return
609
- * type spreads `any` to every downstream use.
588
+ * Reject calling a value whose static type is `any`. The runtime call still
589
+ * happens, but the signature is unchecked and the return type spreads `any`
590
+ * to every downstream use.
610
591
  *
611
592
  * Type-aware via the Checker. Visits plain calls, `new`, and tagged
612
593
  * templates. `unknown` is not flagged.
@@ -615,35 +596,32 @@ export interface ITtscLintTypeScriptRules {
615
596
  */
616
597
  "typescript/no-unsafe-call"?: TtscLintRuleSetting;
617
598
  /**
618
- * Reject declaration merging between an `interface` and a `class`
619
- * with the same name.
599
+ * Reject declaration merging between an `interface` and a `class` with the
600
+ * same name.
620
601
  *
621
- * The interface grafts members onto the class type without forcing a
622
- * runtime implementation, so the class object lies about what it
623
- * exposes.
602
+ * The interface grafts members onto the class type without forcing a runtime
603
+ * implementation, so the class object lies about what it exposes.
624
604
  *
625
605
  * @reference https://typescript-eslint.io/rules/no-unsafe-declaration-merging
626
606
  */
627
607
  "typescript/no-unsafe-declaration-merging"?: TtscLintRuleSetting;
628
608
  /**
629
- * Reject `==` / `===` / `!=` / `!==` comparisons between an
630
- * enum-typed value and a plain `number` or `string` of the same
631
- * widened primitive the comparison silently accepts unrelated
632
- * enums and raw literals that happen to share the underlying
633
- * primitive.
609
+ * Reject `==` / `===` / `!=` / `!==` comparisons between an enum-typed value
610
+ * and a plain `number` or `string` of the same widened primitive — the
611
+ * comparison silently accepts unrelated enums and raw literals that happen to
612
+ * share the underlying primitive.
634
613
  *
635
- * Type-aware via the Checker. The rule fires when one side carries
636
- * an enum type and the other is the widened primitive without
637
- * naming the same enum; comparisons against members of the same
638
- * enum, and against `any` / `unknown` / `never` (to keep generic
639
- * helpers quiet), pass through.
614
+ * Type-aware via the Checker. The rule fires when one side carries an enum
615
+ * type and the other is the widened primitive without naming the same enum;
616
+ * comparisons against members of the same enum, and against `any` / `unknown`
617
+ * / `never` (to keep generic helpers quiet), pass through.
640
618
  *
641
619
  * @reference https://typescript-eslint.io/rules/no-unsafe-enum-comparison
642
620
  */
643
621
  "typescript/no-unsafe-enum-comparison"?: TtscLintRuleSetting;
644
622
  /**
645
- * Reject the unsafe `Function` type, which matches every callable
646
- * regardless of signature.
623
+ * Reject the unsafe `Function` type, which matches every callable regardless
624
+ * of signature.
647
625
  *
648
626
  * Declare the specific call signature instead.
649
627
  *
@@ -651,47 +629,46 @@ export interface ITtscLintTypeScriptRules {
651
629
  */
652
630
  "typescript/no-unsafe-function-type"?: TtscLintRuleSetting;
653
631
  /**
654
- * Reject property access on a receiver whose static type is `any`.
655
- * The lookup still resolves at runtime, but the property type is
656
- * `any` and spreads through the rest of the program.
632
+ * Reject property access on a receiver whose static type is `any`. The lookup
633
+ * still resolves at runtime, but the property type is `any` and spreads
634
+ * through the rest of the program.
657
635
  *
658
- * Type-aware via the Checker. Visits dot access and computed
659
- * element access. `unknown` is not flagged.
636
+ * Type-aware via the Checker. Visits dot access and computed element access.
637
+ * `unknown` is not flagged.
660
638
  *
661
639
  * @reference https://typescript-eslint.io/rules/no-unsafe-member-access
662
640
  */
663
641
  "typescript/no-unsafe-member-access"?: TtscLintRuleSetting;
664
642
  /**
665
- * Reject a `return` expression whose static type is `any` from a
666
- * function whose declared return type is a concrete (non-`any` /
667
- * non-`unknown` / non-`void`) shape — the `any` leaks past the type
668
- * boundary and disables every downstream check on the returned
669
- * value.
643
+ * Reject a `return` expression whose static type is `any` from a function
644
+ * whose declared return type is a concrete (non-`any` / non-`unknown` /
645
+ * non-`void`) shape — the `any` leaks past the type boundary and disables
646
+ * every downstream check on the returned value.
670
647
  *
671
- * Type-aware via the Checker. The rule walks each `return` to its
672
- * enclosing function-like declaration, asks the Checker for that
673
- * function's signature, and compares the declared return type
674
- * against the expression type. `unknown`-typed expressions pass
675
- * through because they cannot be used without further narrowing.
648
+ * Type-aware via the Checker. The rule walks each `return` to its enclosing
649
+ * function-like declaration, asks the Checker for that function's signature,
650
+ * and compares the declared return type against the expression type.
651
+ * `unknown`-typed expressions pass through because they cannot be used
652
+ * without further narrowing.
676
653
  *
677
654
  * @reference https://typescript-eslint.io/rules/no-unsafe-return
678
655
  */
679
656
  "typescript/no-unsafe-return"?: TtscLintRuleSetting;
680
657
  /**
681
- * Reject the unary `-` operator applied to an operand whose static
682
- * type is not number-like or bigint-like — `-x` silently coerces
683
- * strings, objects, and other shapes via `Number(x)` and almost
684
- * always indicates a bug.
658
+ * Reject the unary `-` operator applied to an operand whose static type is
659
+ * not number-like or bigint-like — `-x` silently coerces strings, objects,
660
+ * and other shapes via `Number(x)` and almost always indicates a bug.
685
661
  *
686
- * Type-aware via the Checker. `any` / `unknown` / `never` operands
687
- * pass through to match the upstream `allowAny`-style defaults that
688
- * keep generic helpers quiet.
662
+ * Type-aware via the Checker. `any` / `unknown` / `never` operands pass
663
+ * through to match the upstream `allowAny`-style defaults that keep generic
664
+ * helpers quiet.
689
665
  *
690
666
  * @reference https://typescript-eslint.io/rules/no-unsafe-unary-minus
691
667
  */
692
668
  "typescript/no-unsafe-unary-minus"?: TtscLintRuleSetting;
693
669
  /**
694
- * TypeScript-aware extension of `no-useless-constructor` that tolerates a constructor existing solely to expose parameter properties.
670
+ * TypeScript-aware extension of `no-useless-constructor` that tolerates a
671
+ * constructor existing solely to expose parameter properties.
695
672
  *
696
673
  * @reference https://typescript-eslint.io/rules/no-useless-constructor
697
674
  */
@@ -699,55 +676,49 @@ export interface ITtscLintTypeScriptRules {
699
676
  /**
700
677
  * Reject redundant `export {}` declarations in module files.
701
678
  *
702
- * The file is already a module via its other top-level `import` /
703
- * `export`.
679
+ * The file is already a module via its other top-level `import` / `export`.
704
680
  *
705
681
  * @reference https://typescript-eslint.io/rules/no-useless-empty-export
706
682
  */
707
683
  "typescript/no-useless-empty-export"?: TtscLintRuleSetting;
708
684
  /**
709
- * Reject the wrapper object types `String`, `Number`, `Boolean`,
710
- * `Symbol`, and `BigInt`.
685
+ * Reject the wrapper object types `String`, `Number`, `Boolean`, `Symbol`,
686
+ * and `BigInt`.
711
687
  *
712
- * Autofixable to the corresponding primitive. `Object` stays
713
- * detection-only because it has slightly different semantics.
688
+ * Autofixable to the corresponding primitive. `Object` stays detection-only
689
+ * because it has slightly different semantics.
714
690
  *
715
691
  * @reference https://typescript-eslint.io/rules/no-wrapper-object-types
716
692
  */
717
693
  "typescript/no-wrapper-object-types"?: TtscLintRuleSetting;
718
694
  /**
719
- * Reject `x as Foo` assertions whose target type is the non-nullable
720
- * version of `x`'s static type — replace with the shorter `x!`
721
- * non-null assertion.
695
+ * Reject `x as Foo` assertions whose target type is the non-nullable version
696
+ * of `x`'s static type — replace with the shorter `x!` non-null assertion.
722
697
  *
723
- * Type-aware via the Checker. Fires when the source expression's
724
- * static type is `Foo | null`, `Foo | undefined`, or
725
- * `Foo | null | undefined`, and the asserted type equals the
726
- * non-nullable subset.
698
+ * Type-aware via the Checker. Fires when the source expression's static type
699
+ * is `Foo | null`, `Foo | undefined`, or `Foo | null | undefined`, and the
700
+ * asserted type equals the non-nullable subset.
727
701
  *
728
702
  * @reference https://typescript-eslint.io/rules/non-nullable-type-assertion-style
729
703
  */
730
704
  "typescript/non-nullable-type-assertion-style"?: TtscLintRuleSetting;
731
705
  /**
732
- * Reject `throw X` where `X` is statically known not to derive from
733
- * `Error` — string literals, numbers, plain object literals, and the
734
- * like.
706
+ * Reject `throw X` where `X` is statically known not to derive from `Error` —
707
+ * string literals, numbers, plain object literals, and the like.
735
708
  *
736
- * Type-aware via the Checker. Non-Error throws lose the stack trace
737
- * and confuse `instanceof` checks in the surrounding `catch`.
709
+ * Type-aware via the Checker. Non-Error throws lose the stack trace and
710
+ * confuse `instanceof` checks in the surrounding `catch`.
738
711
  *
739
712
  * @reference https://typescript-eslint.io/rules/only-throw-error
740
713
  */
741
714
  "typescript/only-throw-error"?: TtscLintRuleSetting;
742
715
  /**
743
- * Reject TypeScript parameter-property constructors
744
- * (`constructor(public foo: T)`) — prefer plain field declarations
745
- * so the class shape is visible from the member list instead of
746
- * buried inside the constructor parameter list.
716
+ * Reject TypeScript parameter-property constructors (`constructor(public foo:
717
+ * T)`) — prefer plain field declarations so the class shape is visible from
718
+ * the member list instead of buried inside the constructor parameter list.
747
719
  *
748
- * AST-only — the trigger is a syntactic modifier (`public` /
749
- * `private` / `protected` / `readonly` / `override`) on a
750
- * constructor parameter.
720
+ * AST-only — the trigger is a syntactic modifier (`public` / `private` /
721
+ * `protected` / `readonly` / `override`) on a constructor parameter.
751
722
  *
752
723
  * @reference https://typescript-eslint.io/rules/parameter-properties
753
724
  */
@@ -761,8 +732,8 @@ export interface ITtscLintTypeScriptRules {
761
732
  /**
762
733
  * Require every `enum` member to have an explicit initializer.
763
734
  *
764
- * Implicit auto-increment is fine for novelty enums but dangerous
765
- * once a value gets persisted.
735
+ * Implicit auto-increment is fine for novelty enums but dangerous once a
736
+ * value gets persisted.
766
737
  *
767
738
  * @reference https://typescript-eslint.io/rules/prefer-enum-initializers
768
739
  */
@@ -771,95 +742,88 @@ export interface ITtscLintTypeScriptRules {
771
742
  * Prefer `arr.find(predicate)` over `arr.filter(predicate)[0]` and
772
743
  * `arr.filter(predicate).at(0)`.
773
744
  *
774
- * Type-aware via the Checker. Fires only when the receiver of
775
- * `filter` is provably an array or tuple. `find` short-circuits on
776
- * the first match instead of materializing the whole filtered
777
- * array, so it expresses the "get me the first match" intent more
778
- * directly and is strictly faster on large inputs. Non-zero index
779
- * accesses (`[1]`, `.at(1)`, ...) are intentionally skipped because
780
- * `find` cannot express them.
745
+ * Type-aware via the Checker. Fires only when the receiver of `filter` is
746
+ * provably an array or tuple. `find` short-circuits on the first match
747
+ * instead of materializing the whole filtered array, so it expresses the "get
748
+ * me the first match" intent more directly and is strictly faster on large
749
+ * inputs. Non-zero index accesses (`[1]`, `.at(1)`, ...) are intentionally
750
+ * skipped because `find` cannot express them.
781
751
  *
782
752
  * @reference https://typescript-eslint.io/rules/prefer-find
783
753
  */
784
754
  "typescript/prefer-find"?: TtscLintRuleSetting;
785
755
  /**
786
- * Prefer a type alias over an interface that declares only a
787
- * single call signature — the type form composes better with
788
- * structural typing.
756
+ * Prefer a type alias over an interface that declares only a single call
757
+ * signature — the type form composes better with structural typing.
789
758
  *
790
759
  * @reference https://typescript-eslint.io/rules/prefer-function-type
791
760
  */
792
761
  "typescript/prefer-function-type"?: TtscLintRuleSetting;
793
762
  /**
794
- * Prefer `array.includes(x)` over `array.indexOf(x) !== -1` (and the
795
- * matching `=== -1`, `>= 0`, `< 0`, `> -1` shapes).
763
+ * Prefer `array.includes(x)` over `array.indexOf(x) !== -1` (and the matching
764
+ * `=== -1`, `>= 0`, `< 0`, `> -1` shapes).
796
765
  *
797
- * Type-aware via the Checker. Fires only when the receiver of
798
- * `indexOf` is provably an array, tuple, or string. The
799
- * `includes`-style call states the intent directly and avoids the
800
- * sentinel-vs-position confusion that comes with comparing an
801
- * `indexOf` return value against `-1`.
766
+ * Type-aware via the Checker. Fires only when the receiver of `indexOf` is
767
+ * provably an array, tuple, or string. The `includes`-style call states the
768
+ * intent directly and avoids the sentinel-vs-position confusion that comes
769
+ * with comparing an `indexOf` return value against `-1`.
802
770
  *
803
771
  * @reference https://typescript-eslint.io/rules/prefer-includes
804
772
  */
805
773
  "typescript/prefer-includes"?: TtscLintRuleSetting;
806
774
  /**
807
- * Prefer literal initializers (`= 0`, `= "FOO"`) for enum members
808
- * over computed expressions, so the value is decidable at compile
809
- * time.
775
+ * Prefer literal initializers (`= 0`, `= "FOO"`) for enum members over
776
+ * computed expressions, so the value is decidable at compile time.
810
777
  *
811
778
  * @reference https://typescript-eslint.io/rules/prefer-literal-enum-member
812
779
  */
813
780
  "typescript/prefer-literal-enum-member"?: TtscLintRuleSetting;
814
781
  /**
815
- * Prefer the `namespace` keyword over the legacy `module Foo {}`
816
- * form. Autofixable.
782
+ * Prefer the `namespace` keyword over the legacy `module Foo {}` form.
783
+ * Autofixable.
817
784
  *
818
785
  * @reference https://typescript-eslint.io/rules/prefer-namespace-keyword
819
786
  */
820
787
  "typescript/prefer-namespace-keyword"?: TtscLintRuleSetting;
821
788
  /**
822
- * Prefer `??` over `||` (and `??=` over `||=`, and `??` over the
823
- * ternary `x ? x : y`) when the intent is to default `null` /
824
- * `undefined`.
789
+ * Prefer `??` over `||` (and `??=` over `||=`, and `??` over the ternary `x ?
790
+ * x : y`) when the intent is to default `null` / `undefined`.
825
791
  *
826
- * `||` short-circuits on every falsy value (0, "", false, NaN), so
827
- * "default this if missing" silently coerces legitimate zeros and
828
- * empty strings. The AST-only baseline skips operands the surrounding
829
- * context already coerces to boolean (`if (a || b)`, `!(a || b)`,
830
- * ternary condition, etc.).
792
+ * `||` short-circuits on every falsy value (0, "", false, NaN), so "default
793
+ * this if missing" silently coerces legitimate zeros and empty strings. The
794
+ * AST-only baseline skips operands the surrounding context already coerces to
795
+ * boolean (`if (a || b)`, `!(a || b)`, ternary condition, etc.).
831
796
  *
832
797
  * @reference https://typescript-eslint.io/rules/prefer-nullish-coalescing
833
798
  */
834
799
  "typescript/prefer-nullish-coalescing"?: TtscLintRuleSetting;
835
800
  /**
836
- * Prefer an optional chain (`a?.b?.c`) over chained boolean guards
837
- * such as `a && a.b && a.b.c` or `a != null && a.b`.
801
+ * Prefer an optional chain (`a?.b?.c`) over chained boolean guards such as `a
802
+ * && a.b && a.b.c` or `a != null && a.b`.
838
803
  *
839
- * The optional-chain form is shorter and short-circuits to
840
- * `undefined` instead of the leftmost falsy value, which is almost
841
- * always the intent when guarding a property access against a
842
- * nullish base. AST-only: the rule matches by the textual identity
843
- * of the guard against the receiver of the right-hand access, and
844
- * skips chains that cross a call expression with arguments.
804
+ * The optional-chain form is shorter and short-circuits to `undefined`
805
+ * instead of the leftmost falsy value, which is almost always the intent when
806
+ * guarding a property access against a nullish base. AST-only: the rule
807
+ * matches by the textual identity of the guard against the receiver of the
808
+ * right-hand access, and skips chains that cross a call expression with
809
+ * arguments.
845
810
  *
846
811
  * @reference https://typescript-eslint.io/rules/prefer-optional-chain
847
812
  */
848
813
  "typescript/prefer-optional-chain"?: TtscLintRuleSetting;
849
814
  /**
850
- * Reject `Promise.reject(value)` where `value` is statically known
851
- * not to derive from `Error` — string literals, numbers, plain
852
- * primitives, and the like.
815
+ * Reject `Promise.reject(value)` where `value` is statically known not to
816
+ * derive from `Error` — string literals, numbers, plain primitives, and the
817
+ * like.
853
818
  *
854
- * Type-aware via the Checker. Mirrors `typescript/only-throw-error`
855
- * for the rejection side of the promise contract: a non-Error
856
- * rejection loses the structured stack trace and breaks downstream
857
- * `instanceof Error` checks in `.catch(...)` / `try { await … } catch
858
- * (err)` handlers. Covers `Promise.reject(arg)`, `<promise>.reject(arg)`
859
- * on a Promise-typed receiver, and `reject(arg)` calls bound to the
860
- * second parameter of a `new Promise((_, reject) => …)` executor.
861
- * `any` and `unknown` pass through, matching upstream's
862
- * `allowThrowingAny` / `allowThrowingUnknown` defaults.
819
+ * Type-aware via the Checker. Mirrors `typescript/only-throw-error` for the
820
+ * rejection side of the promise contract: a non-Error rejection loses the
821
+ * structured stack trace and breaks downstream `instanceof Error` checks in
822
+ * `.catch(...)` / `try { await … } catch (err)` handlers. Covers
823
+ * `Promise.reject(arg)`, `<promise>.reject(arg)` on a Promise-typed receiver,
824
+ * and `reject(arg)` calls bound to the second parameter of a `new Promise((_,
825
+ * reject) => …)` executor. `any` and `unknown` pass through, matching
826
+ * upstream's `allowThrowingAny` / `allowThrowingUnknown` defaults.
863
827
  *
864
828
  * @reference https://typescript-eslint.io/rules/prefer-promise-reject-errors
865
829
  */
@@ -867,15 +831,14 @@ export interface ITtscLintTypeScriptRules {
867
831
  /**
868
832
  * Reject private class fields that could carry `readonly`.
869
833
  *
870
- * AST-only baseline: fires on a `PropertyDeclaration` inside a class
871
- * body that is `private` (or uses the `#name` private-hash form),
872
- * does not already carry `readonly`, and is initialized at the
873
- * declaration site. A field initialized at declaration time is set
874
- * before the constructor runs, so locking it as `readonly` rules out
875
- * accidental reassignments without changing runtime behavior. The
876
- * fully type-aware upstream rule also walks assignments inside the
877
- * constructor and other methods; the AST baseline targets the
878
- * narrow but safe shape.
834
+ * AST-only baseline: fires on a `PropertyDeclaration` inside a class body
835
+ * that is `private` (or uses the `#name` private-hash form), does not already
836
+ * carry `readonly`, and is initialized at the declaration site. A field
837
+ * initialized at declaration time is set before the constructor runs, so
838
+ * locking it as `readonly` rules out accidental reassignments without
839
+ * changing runtime behavior. The fully type-aware upstream rule also walks
840
+ * assignments inside the constructor and other methods; the AST baseline
841
+ * targets the narrow but safe shape.
879
842
  *
880
843
  * @reference https://typescript-eslint.io/rules/prefer-readonly
881
844
  */
@@ -884,178 +847,162 @@ export interface ITtscLintTypeScriptRules {
884
847
  * Prefer `arr.reduce<T>(callback, initial)` over the assertion-on-
885
848
  * initial-value pattern `arr.reduce(callback, initial as T)`.
886
849
  *
887
- * Type-aware via the Checker. The accumulator type bound through a
888
- * call-site type parameter constrains the callback's accumulator
889
- * parameter directly; an `as` on the seed only widens the runtime
890
- * value and lets the callback infer the accumulator's parameter type
891
- * from the seed's widened literal shape instead. The rule fires only
892
- * when the `.reduce` receiver is provably an array or tuple, the call
893
- * has no existing type arguments, and the second argument is an `as`
894
- * or angle-bracket type assertion.
850
+ * Type-aware via the Checker. The accumulator type bound through a call-site
851
+ * type parameter constrains the callback's accumulator parameter directly; an
852
+ * `as` on the seed only widens the runtime value and lets the callback infer
853
+ * the accumulator's parameter type from the seed's widened literal shape
854
+ * instead. The rule fires only when the `.reduce` receiver is provably an
855
+ * array or tuple, the call has no existing type arguments, and the second
856
+ * argument is an `as` or angle-bracket type assertion.
895
857
  *
896
858
  * @reference https://typescript-eslint.io/rules/prefer-reduce-type-parameter
897
859
  */
898
860
  "typescript/prefer-reduce-type-parameter"?: TtscLintRuleSetting;
899
861
  /**
900
- * Prefer `re.exec(str)` over `str.match(re)` when the regex has no
901
- * `g` flag.
862
+ * Prefer `re.exec(str)` over `str.match(re)` when the regex has no `g` flag.
902
863
  *
903
- * Type-aware via the Checker. Both shapes return the same
904
- * `RegExpExecArray | null` for first-match queries, but
905
- * `String#match` silently switches to "every match" the moment the
906
- * regex gains the `g` flag a typo at the regex literal changes
907
- * the call's return shape from `[fullMatch, ...captures]` to a flat
908
- * `string[]` of matches. The AST-only baseline reads the flag
909
- * suffix off the regex literal directly; non-literal regex
910
- * arguments (a `new RegExp(...)`, a variable holding `/.../`) are
911
- * conservatively skipped because static flag tracking would explode
912
- * in scope.
864
+ * Type-aware via the Checker. Both shapes return the same `RegExpExecArray |
865
+ * null` for first-match queries, but `String#match` silently switches to
866
+ * "every match" the moment the regex gains the `g` flag — a typo at the regex
867
+ * literal changes the call's return shape from `[fullMatch, ...captures]` to
868
+ * a flat `string[]` of matches. The AST-only baseline reads the flag suffix
869
+ * off the regex literal directly; non-literal regex arguments (a `new
870
+ * RegExp(...)`, a variable holding `/.../`) are conservatively skipped
871
+ * because static flag tracking would explode in scope.
913
872
  *
914
873
  * @reference https://typescript-eslint.io/rules/prefer-regexp-exec
915
874
  */
916
875
  "typescript/prefer-regexp-exec"?: TtscLintRuleSetting;
917
876
  /**
918
- * When an instance method always `return this`, declare its return
919
- * type as `this` instead of the enclosing class name so subclass
920
- * call sites keep the narrower receiver type and method-chaining
921
- * stays polymorphic.
877
+ * When an instance method always `return this`, declare its return type as
878
+ * `this` instead of the enclosing class name so subclass call sites keep the
879
+ * narrower receiver type and method-chaining stays polymorphic.
922
880
  *
923
- * Type-aware via the Checker. Fires only when the method declares
924
- * an explicit non-`this` return-type annotation AND every
925
- * value-returning `return` statement in the body returns exactly
926
- * `this`. Methods with no annotation, methods with at least one
927
- * non-`this` return, `async` methods, generators, constructors,
928
- * accessors, and static methods are skipped each has return-shape
929
- * semantics the `this` rewrite does not preserve.
881
+ * Type-aware via the Checker. Fires only when the method declares an explicit
882
+ * non-`this` return-type annotation AND every value-returning `return`
883
+ * statement in the body returns exactly `this`. Methods with no annotation,
884
+ * methods with at least one non-`this` return, `async` methods, generators,
885
+ * constructors, accessors, and static methods are skipped — each has
886
+ * return-shape semantics the `this` rewrite does not preserve.
930
887
  *
931
888
  * @reference https://typescript-eslint.io/rules/prefer-return-this-type
932
889
  */
933
890
  "typescript/prefer-return-this-type"?: TtscLintRuleSetting;
934
891
  /**
935
- * Prefer `str.startsWith(prefix)` / `str.endsWith(suffix)` over the
936
- * `indexOf` / `lastIndexOf` and anchored-regex idioms — `str.indexOf(p)
937
- * === 0`, `str.indexOf(p, str.length - p.length) !== -1`,
938
- * `str.lastIndexOf(p) === str.length - p.length`, `/^prefix/.test(str)`,
939
- * and `/suffix$/.test(str)`.
892
+ * Prefer `str.startsWith(prefix)` / `str.endsWith(suffix)` over the `indexOf`
893
+ * / `lastIndexOf` and anchored-regex idioms — `str.indexOf(p) === 0`,
894
+ * `str.indexOf(p, str.length - p.length) !== -1`, `str.lastIndexOf(p) ===
895
+ * str.length - p.length`, `/^prefix/.test(str)`, and `/suffix$/.test(str)`.
940
896
  *
941
- * Type-aware via the Checker. Fires only when the string-position
942
- * subject is provably a `string`-like type. The dedicated methods
943
- * state the intent directly and avoid the off-by-one arithmetic and
944
- * regex-anchor pitfalls of the older shapes.
897
+ * Type-aware via the Checker. Fires only when the string-position subject is
898
+ * provably a `string`-like type. The dedicated methods state the intent
899
+ * directly and avoid the off-by-one arithmetic and regex-anchor pitfalls of
900
+ * the older shapes.
945
901
  *
946
902
  * @reference https://typescript-eslint.io/rules/prefer-string-starts-ends-with
947
903
  */
948
904
  "typescript/prefer-string-starts-ends-with"?: TtscLintRuleSetting;
949
905
  /**
950
- * Require functions whose return type is `Promise<T>` (or a
951
- * Promise-like thenable) to be declared with the `async` keyword.
906
+ * Require functions whose return type is `Promise<T>` (or a Promise-like
907
+ * thenable) to be declared with the `async` keyword.
952
908
  *
953
- * Type-aware via the Checker. An `async` function wraps a synchronous
954
- * `throw` into a rejected Promise so the caller's `await` /
955
- * `.catch(...)` observes it; the non-async equivalent throws
956
- * synchronously and bypasses every Promise-aware handler downstream.
957
- * Marking the function `async` keeps the rejection channel
958
- * consistent with the declared return type. Overload signatures,
959
- * abstract methods, and declaration-merging hosts (functions with
909
+ * Type-aware via the Checker. An `async` function wraps a synchronous `throw`
910
+ * into a rejected Promise so the caller's `await` / `.catch(...)` observes
911
+ * it; the non-async equivalent throws synchronously and bypasses every
912
+ * Promise-aware handler downstream. Marking the function `async` keeps the
913
+ * rejection channel consistent with the declared return type. Overload
914
+ * signatures, abstract methods, and declaration-merging hosts (functions with
960
915
  * no body) are skipped — there is no body to wrap.
961
916
  *
962
917
  * @reference https://typescript-eslint.io/rules/promise-function-async
963
918
  */
964
919
  "typescript/promise-function-async"?: TtscLintRuleSetting;
965
920
  /**
966
- * Reject a `get` accessor whose declared return type does not match
967
- * the parameter type of its companion `set` accessor on the same
968
- * class. The accessor pair presents a single conceptual field to
969
- * callers — `obj.x = v` followed by `w = obj.x` should round-trip
970
- * with compatible types — but TypeScript otherwise lets the two
971
- * accessors carry independent annotations.
921
+ * Reject a `get` accessor whose declared return type does not match the
922
+ * parameter type of its companion `set` accessor on the same class. The
923
+ * accessor pair presents a single conceptual field to callers — `obj.x = v`
924
+ * followed by `w = obj.x` should round-trip with compatible types — but
925
+ * TypeScript otherwise lets the two accessors carry independent annotations.
972
926
  *
973
- * Type-aware. The comparison resolves both sides through the
974
- * Checker so type aliases, generic parameters, and union
975
- * constituents collapse to the same set of values before equality
976
- * is decided.
927
+ * Type-aware. The comparison resolves both sides through the Checker so type
928
+ * aliases, generic parameters, and union constituents collapse to the same
929
+ * set of values before equality is decided.
977
930
  *
978
931
  * @reference https://typescript-eslint.io/rules/related-getter-setter-pairs
979
932
  */
980
933
  "typescript/related-getter-setter-pairs"?: TtscLintRuleSetting;
981
934
  /**
982
- * Require `arr.sort()` and `arr.toSorted()` calls to pass an
983
- * explicit `compareFunction`.
935
+ * Require `arr.sort()` and `arr.toSorted()` calls to pass an explicit
936
+ * `compareFunction`.
984
937
  *
985
- * Without a comparator both methods coerce elements to strings and
986
- * sort lexically, so `[10, 2, 1].sort()` returns `[1, 10, 2]` —
987
- * almost never the intent. Type-aware via the Checker: only fires
988
- * when the receiver is provably an array or tuple, so user-defined
989
- * methods named `sort` / `toSorted` on non-array types do not
990
- * trigger the rule.
938
+ * Without a comparator both methods coerce elements to strings and sort
939
+ * lexically, so `[10, 2, 1].sort()` returns `[1, 10, 2]` — almost never the
940
+ * intent. Type-aware via the Checker: only fires when the receiver is
941
+ * provably an array or tuple, so user-defined methods named `sort` /
942
+ * `toSorted` on non-array types do not trigger the rule.
991
943
  *
992
944
  * @reference https://typescript-eslint.io/rules/require-array-sort-compare
993
945
  */
994
946
  "typescript/require-array-sort-compare"?: TtscLintRuleSetting;
995
947
  /**
996
- * Reject `async` functions whose body contains no `await`
997
- * expression.
948
+ * Reject `async` functions whose body contains no `await` expression.
998
949
  *
999
- * An async function with no `await` only inflates the return type
1000
- * to `Promise<T>` without doing any asynchronous work; collapse it
1001
- * to a sync function. Async generators are accepted as long as
1002
- * they have at least one `yield`.
950
+ * An async function with no `await` only inflates the return type to
951
+ * `Promise<T>` without doing any asynchronous work; collapse it to a sync
952
+ * function. Async generators are accepted as long as they have at least one
953
+ * `yield`.
1003
954
  *
1004
955
  * @reference https://typescript-eslint.io/rules/require-await
1005
956
  */
1006
957
  "typescript/require-await"?: TtscLintRuleSetting;
1007
958
  /**
1008
- * Reject `+` expressions whose operands are not both `number`,
1009
- * both `string`, or both `bigint`.
959
+ * Reject `+` expressions whose operands are not both `number`, both `string`,
960
+ * or both `bigint`.
1010
961
  *
1011
- * Type-aware via the Checker. `1 + "a"`, `null + 5`, and
1012
- * `obj + 1` are silently coerced by the runtime — almost always
1013
- * a bug. Mixed `number`/`string` concatenations are likewise
1014
- * rejected: the author should convert explicitly with `String(x)`
1015
- * or use a template literal.
962
+ * Type-aware via the Checker. `1 + "a"`, `null + 5`, and `obj + 1` are
963
+ * silently coerced by the runtime — almost always a bug. Mixed
964
+ * `number`/`string` concatenations are likewise rejected: the author should
965
+ * convert explicitly with `String(x)` or use a template literal.
1016
966
  *
1017
967
  * @reference https://typescript-eslint.io/rules/restrict-plus-operands
1018
968
  */
1019
969
  "typescript/restrict-plus-operands"?: TtscLintRuleSetting;
1020
970
  /**
1021
- * Reject template-literal interpolations whose expression carries a
1022
- * type that does not stringify cleanly — `${obj}` prints
1023
- * `"[object Object]"`, `${null}` prints `"null"`, and so on.
971
+ * Reject template-literal interpolations whose expression carries a type that
972
+ * does not stringify cleanly — `${obj}` prints `"[object Object]"`, `${null}`
973
+ * prints `"null"`, and so on.
1024
974
  *
1025
- * Type-aware via the Checker. Each `${...}` span's type must be
1026
- * string-like, number-like, bigint-like, or boolean-like; `any`,
1027
- * `unknown`, and `never` pass through to avoid false positives on
1028
- * generic helpers, matching upstream `allowAny` / `allowNever`
1029
- * defaults. Union and intersection types must have every
1030
- * constituent stringify cleanly.
975
+ * Type-aware via the Checker. Each `${...}` span's type must be string-like,
976
+ * number-like, bigint-like, or boolean-like; `any`, `unknown`, and `never`
977
+ * pass through to avoid false positives on generic helpers, matching upstream
978
+ * `allowAny` / `allowNever` defaults. Union and intersection types must have
979
+ * every constituent stringify cleanly.
1031
980
  *
1032
981
  * @reference https://typescript-eslint.io/rules/restrict-template-expressions
1033
982
  */
1034
983
  "typescript/restrict-template-expressions"?: TtscLintRuleSetting;
1035
984
  /**
1036
- * Reject `return promise` inside `try`, `catch`, or `finally`;
1037
- * require `return await promise`.
985
+ * Reject `return promise` inside `try`, `catch`, or `finally`; require
986
+ * `return await promise`.
1038
987
  *
1039
- * Without the `await`, the surrounding handler unbinds before the
1040
- * promise settles, so a rejection skips the `catch` block entirely
1041
- * and the `finally` cleanup races the result.
988
+ * Without the `await`, the surrounding handler unbinds before the promise
989
+ * settles, so a rejection skips the `catch` block entirely and the `finally`
990
+ * cleanup races the result.
1042
991
  *
1043
992
  * @reference https://typescript-eslint.io/rules/return-await
1044
993
  */
1045
994
  "typescript/return-await"?: TtscLintRuleSetting;
1046
995
  /**
1047
996
  * Require union and intersection type constituents to be listed in a
1048
- * canonical group order — keyword primitives alphabetized first,
1049
- * named / object references alphabetized next, `null` / `undefined`
1050
- * last. Two authors writing the same set of values can otherwise
1051
- * disagree on the spelling, and the canonical order eliminates that
1052
- * discussion from review.
997
+ * canonical group order — keyword primitives alphabetized first, named /
998
+ * object references alphabetized next, `null` / `undefined` last. Two authors
999
+ * writing the same set of values can otherwise disagree on the spelling, and
1000
+ * the canonical order eliminates that discussion from review.
1053
1001
  *
1054
1002
  * AST-only baseline: ordering is decided by syntactic group (keyword
1055
- * primitive vs. named reference vs. nullish) and a within-group
1056
- * source-text sort. Nested unions / intersections are skipped — only
1057
- * the outermost shape, the one the author wrote, fires the
1058
- * diagnostic.
1003
+ * primitive vs. named reference vs. nullish) and a within-group source-text
1004
+ * sort. Nested unions / intersections are skipped — only the outermost shape,
1005
+ * the one the author wrote, fires the diagnostic.
1059
1006
  *
1060
1007
  * @reference https://typescript-eslint.io/rules/sort-type-constituents
1061
1008
  */
@@ -1063,36 +1010,33 @@ export interface ITtscLintTypeScriptRules {
1063
1010
  /**
1064
1011
  * Reject non-boolean values used in a boolean context.
1065
1012
  *
1066
- * Type-aware via the Checker. Fires when the test of an `if`,
1067
- * `while`, `do`, `for`, or ternary, the operand of `!`, or either
1068
- * side of `&&` / `||` carries a type whose flags are not pure
1069
- * boolean. Numbers (`if (count)` is truthy for any non-zero),
1070
- * strings (`""` is falsy), and nullable objects (`if (obj)`
1071
- * conflates `null` / `undefined` with a present object) all silently
1072
- * coerce in boolean position; an explicit comparison (`count !== 0`,
1013
+ * Type-aware via the Checker. Fires when the test of an `if`, `while`, `do`,
1014
+ * `for`, or ternary, the operand of `!`, or either side of `&&` / `||`
1015
+ * carries a type whose flags are not pure boolean. Numbers (`if (count)` is
1016
+ * truthy for any non-zero), strings (`""` is falsy), and nullable objects
1017
+ * (`if (obj)` conflates `null` / `undefined` with a present object) all
1018
+ * silently coerce in boolean position; an explicit comparison (`count !== 0`,
1073
1019
  * `str.length > 0`, `obj != null`) names the intent.
1074
1020
  *
1075
1021
  * @reference https://typescript-eslint.io/rules/strict-boolean-expressions
1076
1022
  */
1077
1023
  "typescript/strict-boolean-expressions"?: TtscLintRuleSetting;
1078
1024
  /**
1079
- * Require every member of a union or `enum` discriminant to be
1080
- * covered by an explicit `case`, unless a `default` clause is
1081
- * present.
1025
+ * Require every member of a union or `enum` discriminant to be covered by an
1026
+ * explicit `case`, unless a `default` clause is present.
1082
1027
  *
1083
- * Type-aware via the Checker. The rule resolves the discriminant
1084
- * type, walks each constituent of the union (or each member of the
1085
- * enum), matches it against the `case` expressions in the body, and
1086
- * flags the switch when at least one constituent is uncovered and no
1087
- * `default` clause is present. A `default` clause covers the
1088
- * remaining shape and silences the rule.
1028
+ * Type-aware via the Checker. The rule resolves the discriminant type, walks
1029
+ * each constituent of the union (or each member of the enum), matches it
1030
+ * against the `case` expressions in the body, and flags the switch when at
1031
+ * least one constituent is uncovered and no `default` clause is present. A
1032
+ * `default` clause covers the remaining shape and silences the rule.
1089
1033
  *
1090
1034
  * @reference https://typescript-eslint.io/rules/switch-exhaustiveness-check
1091
1035
  */
1092
1036
  "typescript/switch-exhaustiveness-check"?: TtscLintRuleSetting;
1093
1037
  /**
1094
- * Reject `/// <reference path="..." />`, `/// <reference types=""
1095
- * />`, and `/// <reference lib="" />` directives.
1038
+ * Reject `/// <reference path="..." />`, `/// <reference types="" />`, and
1039
+ * `/// <reference lib="" />` directives.
1096
1040
  *
1097
1041
  * Replace with `import` (or `import type`) declarations and
1098
1042
  * `compilerOptions.types` in `tsconfig.json`.
@@ -1101,30 +1045,28 @@ export interface ITtscLintTypeScriptRules {
1101
1045
  */
1102
1046
  "typescript/triple-slash-reference"?: TtscLintRuleSetting;
1103
1047
  /**
1104
- * Reject referencing a class instance method as a value instead of
1105
- * calling it (`obj.method` passed as a callback, aliased to a
1106
- * variable, or stored on another object).
1048
+ * Reject referencing a class instance method as a value instead of calling it
1049
+ * (`obj.method` passed as a callback, aliased to a variable, or stored on
1050
+ * another object).
1107
1051
  *
1108
- * Type-aware via the Checker. JavaScript methods are not bound to
1109
- * their receiver — once extracted, `this` resolves to whatever the
1110
- * caller supplies (usually `undefined` in strict mode or the host
1111
- * object the value lands on). Safe positions — immediate call
1112
- * (`obj.method()`), assignment target, `typeof` / `delete` operand,
1113
- * `instanceof` / `in` operand, and tagged-template tag — pass
1114
- * through; static methods are exempt because the constructor is
1115
- * stably bound.
1052
+ * Type-aware via the Checker. JavaScript methods are not bound to their
1053
+ * receiver — once extracted, `this` resolves to whatever the caller supplies
1054
+ * (usually `undefined` in strict mode or the host object the value lands on).
1055
+ * Safe positions — immediate call (`obj.method()`), assignment target,
1056
+ * `typeof` / `delete` operand, `instanceof` / `in` operand, and
1057
+ * tagged-template tag — pass through; static methods are exempt because the
1058
+ * constructor is stably bound.
1116
1059
  *
1117
1060
  * @reference https://typescript-eslint.io/rules/unbound-method
1118
1061
  */
1119
1062
  "typescript/unbound-method"?: TtscLintRuleSetting;
1120
1063
  /**
1121
- * Require the callback parameter of `.catch(...)` and the second
1122
- * argument of `.then(...)` to be typed `unknown`.
1064
+ * Require the callback parameter of `.catch(...)` and the second argument of
1065
+ * `.then(...)` to be typed `unknown`.
1123
1066
  *
1124
- * Mirrors TypeScript 4.4+ `useUnknownInCatchVariables`, which made
1125
- * `catch (e)` default to `unknown` — the same discipline applied to
1126
- * promise rejection handlers so a rejection cannot smuggle in an
1127
- * implicit `any`.
1067
+ * Mirrors TypeScript 4.4+ `useUnknownInCatchVariables`, which made `catch
1068
+ * (e)` default to `unknown` — the same discipline applied to promise
1069
+ * rejection handlers so a rejection cannot smuggle in an implicit `any`.
1128
1070
  *
1129
1071
  * @reference https://typescript-eslint.io/rules/use-unknown-in-catch-callback-variable
1130
1072
  */