@ttsc/lint 0.13.1 → 0.14.0-dev.20260528.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 (464) hide show
  1. package/README.md +948 -69
  2. package/lib/defaultFormat.d.ts +9 -6
  3. package/lib/defaultFormat.js +9 -6
  4. package/lib/defaultFormat.js.map +1 -1
  5. package/lib/index.d.ts +46 -0
  6. package/lib/index.js +35 -10
  7. package/lib/index.js.map +1 -1
  8. package/lib/structures/ITtscLintConfig.d.ts +12 -6
  9. package/lib/structures/{ITtscLintFormatConfig.d.ts → ITtscLintFormat.d.ts} +2 -2
  10. package/lib/structures/{TtscLintRuleMap.js → ITtscLintFormat.js} +1 -1
  11. package/lib/structures/ITtscLintFormat.js.map +1 -0
  12. package/lib/structures/TtscLintRuleSetting.d.ts +49 -0
  13. package/lib/structures/{TtscLintRuleOptions.js → TtscLintRuleSetting.js} +1 -1
  14. package/lib/structures/TtscLintRuleSetting.js.map +1 -0
  15. package/lib/structures/index.d.ts +3 -4
  16. package/lib/structures/index.js +3 -4
  17. package/lib/structures/index.js.map +1 -1
  18. package/lib/structures/rules/ITtscLintBoundariesRuleOptions.d.ts +104 -0
  19. package/lib/structures/rules/ITtscLintBoundariesRuleOptions.js +14 -0
  20. package/lib/structures/rules/ITtscLintBoundariesRuleOptions.js.map +1 -0
  21. package/lib/structures/rules/ITtscLintBoundariesRules.d.ts +79 -0
  22. package/lib/structures/rules/ITtscLintBoundariesRules.js +3 -0
  23. package/lib/structures/rules/ITtscLintBoundariesRules.js.map +1 -0
  24. package/lib/structures/rules/ITtscLintContributorRules.d.ts +17 -0
  25. package/lib/structures/rules/ITtscLintContributorRules.js +3 -0
  26. package/lib/structures/rules/ITtscLintContributorRules.js.map +1 -0
  27. package/lib/structures/rules/ITtscLintCoreRules.d.ts +1257 -0
  28. package/lib/structures/{ITtscLintFormatConfig.js → rules/ITtscLintCoreRules.js} +1 -1
  29. package/lib/structures/rules/ITtscLintCoreRules.js.map +1 -0
  30. package/lib/structures/rules/ITtscLintCypressRuleOptions.d.ts +17 -0
  31. package/lib/structures/rules/ITtscLintCypressRuleOptions.js +10 -0
  32. package/lib/structures/rules/ITtscLintCypressRuleOptions.js.map +1 -0
  33. package/lib/structures/rules/ITtscLintCypressRules.d.ts +129 -0
  34. package/lib/structures/rules/ITtscLintCypressRules.js +3 -0
  35. package/lib/structures/rules/ITtscLintCypressRules.js.map +1 -0
  36. package/lib/structures/rules/ITtscLintFunctionalRuleOptions.d.ts +157 -0
  37. package/lib/structures/rules/ITtscLintFunctionalRuleOptions.js +13 -0
  38. package/lib/structures/rules/ITtscLintFunctionalRuleOptions.js.map +1 -0
  39. package/lib/structures/rules/ITtscLintFunctionalRules.d.ts +167 -0
  40. package/lib/structures/rules/ITtscLintFunctionalRules.js +3 -0
  41. package/lib/structures/rules/ITtscLintFunctionalRules.js.map +1 -0
  42. package/lib/structures/rules/ITtscLintJestRules.d.ts +201 -0
  43. package/lib/structures/rules/ITtscLintJestRules.js +3 -0
  44. package/lib/structures/rules/ITtscLintJestRules.js.map +1 -0
  45. package/lib/structures/rules/ITtscLintJsdocRules.d.ts +140 -0
  46. package/lib/structures/rules/ITtscLintJsdocRules.js +3 -0
  47. package/lib/structures/rules/ITtscLintJsdocRules.js.map +1 -0
  48. package/lib/structures/rules/ITtscLintJsxA11yRules.d.ts +302 -0
  49. package/lib/structures/rules/ITtscLintJsxA11yRules.js +3 -0
  50. package/lib/structures/rules/ITtscLintJsxA11yRules.js.map +1 -0
  51. package/lib/structures/rules/ITtscLintNextjsRules.d.ts +185 -0
  52. package/lib/structures/rules/ITtscLintNextjsRules.js +3 -0
  53. package/lib/structures/rules/ITtscLintNextjsRules.js.map +1 -0
  54. package/lib/structures/rules/ITtscLintPlaywrightRules.d.ts +330 -0
  55. package/lib/structures/rules/ITtscLintPlaywrightRules.js +3 -0
  56. package/lib/structures/rules/ITtscLintPlaywrightRules.js.map +1 -0
  57. package/lib/structures/rules/ITtscLintPromiseRules.d.ts +188 -0
  58. package/lib/structures/rules/ITtscLintPromiseRules.js +3 -0
  59. package/lib/structures/rules/ITtscLintPromiseRules.js.map +1 -0
  60. package/lib/structures/rules/ITtscLintReactPerfRuleOptions.d.ts +18 -0
  61. package/lib/structures/rules/ITtscLintReactPerfRuleOptions.js +8 -0
  62. package/lib/structures/rules/ITtscLintReactPerfRuleOptions.js.map +1 -0
  63. package/lib/structures/rules/ITtscLintReactPerfRules.d.ts +51 -0
  64. package/lib/structures/rules/ITtscLintReactPerfRules.js +3 -0
  65. package/lib/structures/rules/ITtscLintReactPerfRules.js.map +1 -0
  66. package/lib/structures/rules/ITtscLintReactRuleOptions.d.ts +39 -0
  67. package/lib/structures/rules/ITtscLintReactRuleOptions.js +12 -0
  68. package/lib/structures/rules/ITtscLintReactRuleOptions.js.map +1 -0
  69. package/lib/structures/rules/ITtscLintReactRules.d.ts +289 -0
  70. package/lib/structures/rules/ITtscLintReactRules.js +3 -0
  71. package/lib/structures/rules/ITtscLintReactRules.js.map +1 -0
  72. package/lib/structures/rules/ITtscLintRegexpRules.d.ts +190 -0
  73. package/lib/structures/rules/ITtscLintRegexpRules.js +3 -0
  74. package/lib/structures/rules/ITtscLintRegexpRules.js.map +1 -0
  75. package/lib/structures/rules/ITtscLintRuleOptionsMap.d.ts +66 -0
  76. package/lib/structures/rules/ITtscLintRuleOptionsMap.js +3 -0
  77. package/lib/structures/rules/ITtscLintRuleOptionsMap.js.map +1 -0
  78. package/lib/structures/rules/ITtscLintRules.d.ts +55 -0
  79. package/lib/structures/{TtscLintRule.js → rules/ITtscLintRules.js} +1 -1
  80. package/lib/structures/rules/ITtscLintRules.js.map +1 -0
  81. package/lib/structures/rules/ITtscLintSecurityRules.d.ts +148 -0
  82. package/lib/structures/rules/ITtscLintSecurityRules.js +3 -0
  83. package/lib/structures/rules/ITtscLintSecurityRules.js.map +1 -0
  84. package/lib/structures/rules/ITtscLintSolidRules.d.ts +181 -0
  85. package/lib/structures/rules/ITtscLintSolidRules.js +3 -0
  86. package/lib/structures/rules/ITtscLintSolidRules.js.map +1 -0
  87. package/lib/structures/rules/ITtscLintStorybookRuleOptions.d.ts +21 -0
  88. package/lib/structures/rules/ITtscLintStorybookRuleOptions.js +9 -0
  89. package/lib/structures/rules/ITtscLintStorybookRuleOptions.js.map +1 -0
  90. package/lib/structures/rules/ITtscLintStorybookRules.d.ts +174 -0
  91. package/lib/structures/rules/ITtscLintStorybookRules.js +3 -0
  92. package/lib/structures/rules/ITtscLintStorybookRules.js.map +1 -0
  93. package/lib/structures/rules/ITtscLintTanstackQueryRules.d.ts +94 -0
  94. package/lib/structures/rules/ITtscLintTanstackQueryRules.js +3 -0
  95. package/lib/structures/rules/ITtscLintTanstackQueryRules.js.map +1 -0
  96. package/lib/structures/rules/ITtscLintTestingLibraryRuleOptions.d.ts +22 -0
  97. package/lib/structures/rules/ITtscLintTestingLibraryRuleOptions.js +10 -0
  98. package/lib/structures/rules/ITtscLintTestingLibraryRuleOptions.js.map +1 -0
  99. package/lib/structures/rules/ITtscLintTestingLibraryRules.d.ts +310 -0
  100. package/lib/structures/rules/ITtscLintTestingLibraryRules.js +3 -0
  101. package/lib/structures/rules/ITtscLintTestingLibraryRules.js.map +1 -0
  102. package/lib/structures/rules/ITtscLintTypeScriptRules.d.ts +1132 -0
  103. package/lib/structures/rules/ITtscLintTypeScriptRules.js +3 -0
  104. package/lib/structures/rules/ITtscLintTypeScriptRules.js.map +1 -0
  105. package/lib/structures/rules/ITtscLintUnicornRules.d.ts +997 -0
  106. package/lib/structures/rules/ITtscLintUnicornRules.js +3 -0
  107. package/lib/structures/rules/ITtscLintUnicornRules.js.map +1 -0
  108. package/lib/structures/rules/ITtscLintVitestRules.d.ts +141 -0
  109. package/lib/structures/rules/ITtscLintVitestRules.js +3 -0
  110. package/lib/structures/rules/ITtscLintVitestRules.js.map +1 -0
  111. package/lib/structures/rules/index.d.ts +31 -0
  112. package/lib/structures/rules/index.js +48 -0
  113. package/lib/structures/rules/index.js.map +1 -0
  114. package/linthost/ast_helpers.go +30 -5
  115. package/linthost/config.go +48 -17
  116. package/linthost/config_format.go +9 -9
  117. package/linthost/directives.go +67 -25
  118. package/linthost/dispatch.go +14 -3
  119. package/linthost/engine.go +152 -31
  120. package/linthost/fix.go +2 -2
  121. package/linthost/lsp.go +747 -0
  122. package/linthost/print_dispatch.go +2 -2
  123. package/linthost/print_nodes_function.go +2 -2
  124. package/linthost/print_nodes_object.go +1 -1
  125. package/linthost/rule_names.go +14 -0
  126. package/linthost/rules_arrays.go +2 -2
  127. package/linthost/rules_boundaries.go +532 -0
  128. package/linthost/rules_camelcase.go +133 -0
  129. package/linthost/rules_complexity.go +94 -0
  130. package/linthost/rules_consistent_return.go +130 -0
  131. package/linthost/rules_console.go +1 -1
  132. package/linthost/rules_core_extra.go +739 -0
  133. package/linthost/rules_curly.go +70 -0
  134. package/linthost/rules_cypress.go +608 -0
  135. package/linthost/rules_debugger.go +2 -2
  136. package/linthost/rules_default_case.go +39 -0
  137. package/linthost/rules_default_case_last.go +46 -0
  138. package/linthost/rules_dupes.go +3 -3
  139. package/linthost/rules_empty.go +3 -3
  140. package/linthost/rules_escape.go +44 -24
  141. package/linthost/rules_eval.go +2 -2
  142. package/linthost/rules_finally.go +2 -2
  143. package/linthost/rules_format_jsdoc.go +1 -1
  144. package/linthost/rules_format_print_width.go +9 -9
  145. package/linthost/rules_format_quotes.go +1 -1
  146. package/linthost/rules_format_semi.go +1 -1
  147. package/linthost/rules_format_sort_imports.go +1 -1
  148. package/linthost/rules_format_trailing_comma.go +1 -1
  149. package/linthost/rules_functional.go +967 -0
  150. package/linthost/rules_gap.go +24 -45
  151. package/linthost/rules_grouped_accessor_pairs.go +87 -0
  152. package/linthost/rules_guard_for_in.go +198 -0
  153. package/linthost/rules_id_length.go +77 -0
  154. package/linthost/rules_imports.go +70 -2
  155. package/linthost/rules_init_declarations.go +53 -0
  156. package/linthost/rules_jest.go +618 -0
  157. package/linthost/rules_jsdoc.go +502 -0
  158. package/linthost/rules_jsx_a11y.go +1264 -0
  159. package/linthost/rules_logic.go +12 -12
  160. package/linthost/rules_loops.go +1 -1
  161. package/linthost/rules_max_classes_per_file.go +58 -0
  162. package/linthost/rules_max_depth.go +83 -0
  163. package/linthost/rules_max_lines.go +101 -0
  164. package/linthost/rules_max_lines_per_function.go +57 -0
  165. package/linthost/rules_max_nested_callbacks.go +61 -0
  166. package/linthost/rules_max_params.go +49 -0
  167. package/linthost/rules_max_statements.go +59 -0
  168. package/linthost/rules_misc.go +1 -1
  169. package/linthost/rules_nextjs.go +697 -0
  170. package/linthost/rules_no_else_return.go +75 -0
  171. package/linthost/rules_no_empty_named_blocks.go +91 -0
  172. package/linthost/rules_no_extend_native.go +51 -0
  173. package/linthost/rules_no_import_assign.go +140 -0
  174. package/linthost/rules_no_invalid_this.go +52 -0
  175. package/linthost/rules_no_loop_func.go +85 -0
  176. package/linthost/rules_no_magic_numbers.go +123 -0
  177. package/linthost/rules_no_mixed_operators.go +80 -0
  178. package/linthost/rules_no_param_reassign.go +98 -0
  179. package/linthost/rules_no_redeclare.go +270 -0
  180. package/linthost/rules_no_restricted_imports.go +105 -0
  181. package/linthost/rules_no_restricted_syntax.go +49 -0
  182. package/linthost/rules_no_shadow.go +147 -0
  183. package/linthost/rules_no_unreachable.go +77 -0
  184. package/linthost/rules_no_useless_assignment.go +120 -0
  185. package/linthost/rules_no_useless_constructor.go +245 -0
  186. package/linthost/rules_no_useless_return.go +51 -0
  187. package/linthost/rules_params.go +1 -1
  188. package/linthost/rules_playwright.go +788 -0
  189. package/linthost/rules_prefer_arrow_callback.go +124 -0
  190. package/linthost/rules_prefer_destructuring.go +98 -0
  191. package/linthost/rules_prefer_named_capture_group.go +129 -0
  192. package/linthost/rules_prefer_rest_params.go +94 -0
  193. package/linthost/rules_problems.go +41 -30
  194. package/linthost/rules_promise.go +1128 -73
  195. package/linthost/rules_protos.go +2 -2
  196. package/linthost/rules_react.go +773 -0
  197. package/linthost/rules_react_extras.go +227 -0
  198. package/linthost/rules_react_hooks.go +848 -0
  199. package/linthost/rules_react_perf.go +293 -0
  200. package/linthost/rules_react_refresh.go +583 -0
  201. package/linthost/rules_regexp.go +410 -0
  202. package/linthost/rules_security.go +830 -0
  203. package/linthost/rules_self.go +2 -2
  204. package/linthost/rules_solid.go +1073 -0
  205. package/linthost/rules_sort_imports.go +69 -0
  206. package/linthost/rules_sort_keys.go +134 -0
  207. package/linthost/rules_storybook.go +1176 -0
  208. package/linthost/rules_strings.go +4 -4
  209. package/linthost/rules_suggestions.go +38 -38
  210. package/linthost/rules_tanstack_query.go +844 -0
  211. package/linthost/rules_testing_library.go +1204 -0
  212. package/linthost/rules_throw.go +1 -1
  213. package/linthost/rules_ts.go +19 -19
  214. package/linthost/rules_ts_async.go +399 -0
  215. package/linthost/rules_ts_class_literal_property_style.go +115 -0
  216. package/linthost/rules_ts_consistent_type_exports.go +256 -0
  217. package/linthost/rules_ts_explicit_function_return_type.go +67 -0
  218. package/linthost/rules_ts_extra.go +155 -36
  219. package/linthost/rules_ts_no_base_to_string.go +218 -0
  220. package/linthost/rules_ts_no_confusing_void.go +72 -0
  221. package/linthost/rules_ts_no_deprecated.go +195 -0
  222. package/linthost/rules_ts_no_for_in_array.go +84 -0
  223. package/linthost/rules_ts_no_magic_numbers.go +124 -0
  224. package/linthost/rules_ts_no_meaningless_void_operator.go +84 -0
  225. package/linthost/rules_ts_no_misused_spread.go +104 -0
  226. package/linthost/rules_ts_no_redundant_type_constituents.go +113 -0
  227. package/linthost/rules_ts_no_restricted_types.go +62 -0
  228. package/linthost/rules_ts_no_unnecessary_boolean_literal_compare.go +129 -0
  229. package/linthost/rules_ts_no_unnecessary_condition.go +250 -0
  230. package/linthost/rules_ts_no_unnecessary_qualifier.go +118 -0
  231. package/linthost/rules_ts_no_unnecessary_template_expression.go +178 -0
  232. package/linthost/rules_ts_no_unnecessary_type_arguments.go +234 -0
  233. package/linthost/rules_ts_no_unnecessary_type_assertion.go +157 -0
  234. package/linthost/rules_ts_no_unsafe_argument.go +82 -0
  235. package/linthost/rules_ts_no_unsafe_assignment.go +102 -0
  236. package/linthost/rules_ts_no_unsafe_call.go +82 -0
  237. package/linthost/rules_ts_no_unsafe_enum_comparison.go +235 -0
  238. package/linthost/rules_ts_no_unsafe_member_access.go +58 -0
  239. package/linthost/rules_ts_no_unsafe_return.go +126 -0
  240. package/linthost/rules_ts_no_unsafe_unary_minus.go +81 -0
  241. package/linthost/rules_ts_no_useless_constructor.go +52 -0
  242. package/linthost/rules_ts_non_nullable_type_assertion_style.go +108 -0
  243. package/linthost/rules_ts_parameter_properties.go +38 -0
  244. package/linthost/rules_ts_prefer_find.go +178 -0
  245. package/linthost/rules_ts_prefer_includes.go +255 -0
  246. package/linthost/rules_ts_prefer_nullish_coalescing.go +104 -0
  247. package/linthost/rules_ts_prefer_optional_chain.go +228 -0
  248. package/linthost/rules_ts_prefer_promise_reject_errors.go +176 -0
  249. package/linthost/rules_ts_prefer_readonly.go +73 -0
  250. package/linthost/rules_ts_prefer_reduce_type_parameter.go +116 -0
  251. package/linthost/rules_ts_prefer_regexp_exec.go +122 -0
  252. package/linthost/rules_ts_prefer_return_this_type.go +135 -0
  253. package/linthost/rules_ts_prefer_string_starts_ends_with.go +360 -0
  254. package/linthost/rules_ts_promise_function_async.go +77 -0
  255. package/linthost/rules_ts_related_getter_setter_pairs.go +113 -0
  256. package/linthost/rules_ts_require_array_sort_compare.go +96 -0
  257. package/linthost/rules_ts_restrict_plus_operands.go +127 -0
  258. package/linthost/rules_ts_restrict_template_expressions.go +95 -0
  259. package/linthost/rules_ts_simple.go +387 -0
  260. package/linthost/rules_ts_sort_type_constituents.go +144 -0
  261. package/linthost/rules_ts_strict_boolean_expressions.go +157 -0
  262. package/linthost/rules_ts_switch_exhaustiveness_check.go +147 -0
  263. package/linthost/rules_ts_unbound_method.go +126 -0
  264. package/linthost/rules_tsdoc.go +136 -0
  265. package/linthost/rules_unicorn_better_regex.go +27 -0
  266. package/linthost/rules_unicorn_catch_error_name.go +46 -0
  267. package/linthost/rules_unicorn_consistent_assert.go +47 -0
  268. package/linthost/rules_unicorn_consistent_date_clone.go +54 -0
  269. package/linthost/rules_unicorn_consistent_destructuring.go +25 -0
  270. package/linthost/rules_unicorn_consistent_empty_array_spread.go +62 -0
  271. package/linthost/rules_unicorn_consistent_existence_index_check.go +80 -0
  272. package/linthost/rules_unicorn_consistent_function_scoping.go +25 -0
  273. package/linthost/rules_unicorn_consistent_template_literal_escape.go +25 -0
  274. package/linthost/rules_unicorn_custom_error_definition.go +138 -0
  275. package/linthost/rules_unicorn_empty_brace_spaces.go +73 -0
  276. package/linthost/rules_unicorn_error_message.go +64 -0
  277. package/linthost/rules_unicorn_escape_case.go +51 -0
  278. package/linthost/rules_unicorn_expiring_todo_comments.go +78 -0
  279. package/linthost/rules_unicorn_explicit_length_check.go +88 -0
  280. package/linthost/rules_unicorn_filename_case.go +29 -0
  281. package/linthost/rules_unicorn_import_style.go +28 -0
  282. package/linthost/rules_unicorn_isolated_functions.go +29 -0
  283. package/linthost/rules_unicorn_new_for_builtins.go +87 -0
  284. package/linthost/rules_unicorn_no_abusive_eslint_disable.go +63 -0
  285. package/linthost/rules_unicorn_no_accessor_recursion.go +115 -0
  286. package/linthost/rules_unicorn_no_anonymous_default_export.go +74 -0
  287. package/linthost/rules_unicorn_no_array_callback_reference.go +65 -0
  288. package/linthost/rules_unicorn_no_array_for_each.go +40 -0
  289. package/linthost/rules_unicorn_no_array_method_this_argument.go +61 -0
  290. package/linthost/rules_unicorn_no_array_reduce.go +41 -0
  291. package/linthost/rules_unicorn_no_array_reverse.go +44 -0
  292. package/linthost/rules_unicorn_no_array_sort.go +43 -0
  293. package/linthost/rules_unicorn_no_await_expression_member.go +40 -0
  294. package/linthost/rules_unicorn_no_await_in_promise_methods.go +69 -0
  295. package/linthost/rules_unicorn_no_console_spaces.go +61 -0
  296. package/linthost/rules_unicorn_no_document_cookie.go +41 -0
  297. package/linthost/rules_unicorn_no_empty_file.go +44 -0
  298. package/linthost/rules_unicorn_no_for_loop.go +102 -0
  299. package/linthost/rules_unicorn_no_hex_escape.go +42 -0
  300. package/linthost/rules_unicorn_no_immediate_mutation.go +90 -0
  301. package/linthost/rules_unicorn_no_instanceof_builtins.go +66 -0
  302. package/linthost/rules_unicorn_no_invalid_fetch_options.go +79 -0
  303. package/linthost/rules_unicorn_no_invalid_remove_event_listener.go +51 -0
  304. package/linthost/rules_unicorn_no_keyword_prefix.go +101 -0
  305. package/linthost/rules_unicorn_no_lonely_if.go +44 -0
  306. package/linthost/rules_unicorn_no_magic_array_flat_depth.go +51 -0
  307. package/linthost/rules_unicorn_no_named_default.go +54 -0
  308. package/linthost/rules_unicorn_no_negated_condition.go +85 -0
  309. package/linthost/rules_unicorn_no_negation_in_equality_check.go +50 -0
  310. package/linthost/rules_unicorn_no_nested_ternary.go +43 -0
  311. package/linthost/rules_unicorn_no_new_array.go +30 -0
  312. package/linthost/rules_unicorn_no_new_buffer.go +31 -0
  313. package/linthost/rules_unicorn_no_null.go +24 -0
  314. package/linthost/rules_unicorn_no_object_as_default_parameter.go +48 -0
  315. package/linthost/rules_unicorn_no_process_exit.go +43 -0
  316. package/linthost/rules_unicorn_no_single_promise_in_promise_methods.go +59 -0
  317. package/linthost/rules_unicorn_no_static_only_class.go +56 -0
  318. package/linthost/rules_unicorn_no_thenable.go +74 -0
  319. package/linthost/rules_unicorn_no_this_assignment.go +35 -0
  320. package/linthost/rules_unicorn_no_typeof_undefined.go +58 -0
  321. package/linthost/rules_unicorn_no_unnecessary_array_flat_depth.go +49 -0
  322. package/linthost/rules_unicorn_no_unnecessary_array_splice_count.go +70 -0
  323. package/linthost/rules_unicorn_no_unnecessary_await.go +51 -0
  324. package/linthost/rules_unicorn_no_unnecessary_polyfills.go +32 -0
  325. package/linthost/rules_unicorn_no_unnecessary_slice_end.go +48 -0
  326. package/linthost/rules_unicorn_no_unreadable_array_destructuring.go +115 -0
  327. package/linthost/rules_unicorn_no_unreadable_iife.go +50 -0
  328. package/linthost/rules_unicorn_no_unused_properties.go +30 -0
  329. package/linthost/rules_unicorn_no_useless_collection_argument.go +63 -0
  330. package/linthost/rules_unicorn_no_useless_error_capture_stack_trace.go +46 -0
  331. package/linthost/rules_unicorn_no_useless_fallback_in_spread.go +81 -0
  332. package/linthost/rules_unicorn_no_useless_iterator_to_array.go +72 -0
  333. package/linthost/rules_unicorn_no_useless_length_check.go +144 -0
  334. package/linthost/rules_unicorn_no_useless_promise_resolve_reject.go +81 -0
  335. package/linthost/rules_unicorn_no_useless_spread.go +67 -0
  336. package/linthost/rules_unicorn_no_useless_switch_case.go +55 -0
  337. package/linthost/rules_unicorn_no_useless_undefined.go +55 -0
  338. package/linthost/rules_unicorn_no_zero_fractions.go +52 -0
  339. package/linthost/rules_unicorn_number_literal_case.go +69 -0
  340. package/linthost/rules_unicorn_numeric_separators_style.go +75 -0
  341. package/linthost/rules_unicorn_prefer_add_event_listener.go +66 -0
  342. package/linthost/rules_unicorn_prefer_array_find.go +51 -0
  343. package/linthost/rules_unicorn_prefer_array_flat.go +52 -0
  344. package/linthost/rules_unicorn_prefer_array_flat_map.go +63 -0
  345. package/linthost/rules_unicorn_prefer_array_index_of.go +147 -0
  346. package/linthost/rules_unicorn_prefer_array_some.go +67 -0
  347. package/linthost/rules_unicorn_prefer_at.go +77 -0
  348. package/linthost/rules_unicorn_prefer_bigint_literals.go +77 -0
  349. package/linthost/rules_unicorn_prefer_blob_reading_methods.go +44 -0
  350. package/linthost/rules_unicorn_prefer_class_fields.go +93 -0
  351. package/linthost/rules_unicorn_prefer_classlist_toggle.go +120 -0
  352. package/linthost/rules_unicorn_prefer_code_point.go +49 -0
  353. package/linthost/rules_unicorn_prefer_date_now.go +78 -0
  354. package/linthost/rules_unicorn_prefer_default_parameters.go +144 -0
  355. package/linthost/rules_unicorn_prefer_dom_node_append.go +40 -0
  356. package/linthost/rules_unicorn_prefer_dom_node_dataset.go +55 -0
  357. package/linthost/rules_unicorn_prefer_dom_node_remove.go +41 -0
  358. package/linthost/rules_unicorn_prefer_dom_node_text_content.go +37 -0
  359. package/linthost/rules_unicorn_prefer_event_target.go +36 -0
  360. package/linthost/rules_unicorn_prefer_export_from.go +129 -0
  361. package/linthost/rules_unicorn_prefer_global_this.go +127 -0
  362. package/linthost/rules_unicorn_prefer_import_meta_properties.go +66 -0
  363. package/linthost/rules_unicorn_prefer_includes.go +149 -0
  364. package/linthost/rules_unicorn_prefer_json_parse_buffer.go +65 -0
  365. package/linthost/rules_unicorn_prefer_keyboard_event_key.go +38 -0
  366. package/linthost/rules_unicorn_prefer_logical_operator_over_ternary.go +48 -0
  367. package/linthost/rules_unicorn_prefer_math_min_max.go +60 -0
  368. package/linthost/rules_unicorn_prefer_math_trunc.go +62 -0
  369. package/linthost/rules_unicorn_prefer_modern_dom_apis.go +47 -0
  370. package/linthost/rules_unicorn_prefer_modern_math_apis.go +70 -0
  371. package/linthost/rules_unicorn_prefer_module.go +50 -0
  372. package/linthost/rules_unicorn_prefer_native_coercion_functions.go +114 -0
  373. package/linthost/rules_unicorn_prefer_negative_index.go +74 -0
  374. package/linthost/rules_unicorn_prefer_node_protocol.go +122 -0
  375. package/linthost/rules_unicorn_prefer_number_properties.go +88 -0
  376. package/linthost/rules_unicorn_prefer_object_from_entries.go +55 -0
  377. package/linthost/rules_unicorn_prefer_optional_catch_binding.go +62 -0
  378. package/linthost/rules_unicorn_prefer_prototype_methods.go +54 -0
  379. package/linthost/rules_unicorn_prefer_query_selector.go +56 -0
  380. package/linthost/rules_unicorn_prefer_reflect_apply.go +36 -0
  381. package/linthost/rules_unicorn_prefer_regexp_test_rule.go +80 -0
  382. package/linthost/rules_unicorn_prefer_response_static_json.go +53 -0
  383. package/linthost/rules_unicorn_prefer_set_has.go +42 -0
  384. package/linthost/rules_unicorn_prefer_set_size.go +48 -0
  385. package/linthost/rules_unicorn_prefer_simple_condition_first.go +34 -0
  386. package/linthost/rules_unicorn_prefer_single_call.go +96 -0
  387. package/linthost/rules_unicorn_prefer_spread.go +51 -0
  388. package/linthost/rules_unicorn_prefer_string_raw.go +43 -0
  389. package/linthost/rules_unicorn_prefer_string_replace_all.go +95 -0
  390. package/linthost/rules_unicorn_prefer_string_slice.go +43 -0
  391. package/linthost/rules_unicorn_prefer_string_starts_ends_with.go +148 -0
  392. package/linthost/rules_unicorn_prefer_string_trim_start_end.go +48 -0
  393. package/linthost/rules_unicorn_prefer_structured_clone.go +71 -0
  394. package/linthost/rules_unicorn_prefer_switch.go +103 -0
  395. package/linthost/rules_unicorn_prefer_ternary.go +71 -0
  396. package/linthost/rules_unicorn_prefer_top_level_await.go +72 -0
  397. package/linthost/rules_unicorn_prefer_type_error.go +127 -0
  398. package/linthost/rules_unicorn_prevent_abbreviations.go +127 -0
  399. package/linthost/rules_unicorn_relative_url_style.go +49 -0
  400. package/linthost/rules_unicorn_require_array_join_separator.go +45 -0
  401. package/linthost/rules_unicorn_require_module_attributes.go +54 -0
  402. package/linthost/rules_unicorn_require_module_specifiers.go +55 -0
  403. package/linthost/rules_unicorn_require_number_to_fixed_digits_argument.go +43 -0
  404. package/linthost/rules_unicorn_require_post_message_target_origin.go +44 -0
  405. package/linthost/rules_unicorn_string_content.go +27 -0
  406. package/linthost/rules_unicorn_switch_case_braces.go +42 -0
  407. package/linthost/rules_unicorn_switch_case_break_position.go +31 -0
  408. package/linthost/rules_unicorn_template_indent.go +28 -0
  409. package/linthost/rules_unicorn_text_encoding_identifier_case.go +72 -0
  410. package/linthost/rules_unicorn_throw_new_error.go +61 -0
  411. package/linthost/rules_var.go +4 -4
  412. package/linthost/rules_vitest.go +568 -0
  413. package/package.json +3 -3
  414. package/plugin/main.go +49 -3
  415. package/rule/astutil/astutil.go +10 -3
  416. package/rule/rule.go +12 -10
  417. package/src/defaultFormat.ts +11 -8
  418. package/src/index.ts +40 -16
  419. package/src/structures/ITtscLintConfig.ts +12 -6
  420. package/src/structures/{ITtscLintFormatConfig.ts → ITtscLintFormat.ts} +2 -2
  421. package/src/structures/TtscLintRuleSetting.ts +55 -0
  422. package/src/structures/index.ts +3 -4
  423. package/src/structures/rules/ITtscLintBoundariesRuleOptions.ts +128 -0
  424. package/src/structures/rules/ITtscLintBoundariesRules.ts +95 -0
  425. package/src/structures/rules/ITtscLintContributorRules.ts +21 -0
  426. package/src/structures/rules/ITtscLintCoreRules.ts +1406 -0
  427. package/src/structures/rules/ITtscLintCypressRuleOptions.ts +18 -0
  428. package/src/structures/rules/ITtscLintCypressRules.ts +145 -0
  429. package/src/structures/rules/ITtscLintFunctionalRuleOptions.ts +213 -0
  430. package/src/structures/rules/ITtscLintFunctionalRules.ts +202 -0
  431. package/src/structures/rules/ITtscLintJestRules.ts +220 -0
  432. package/src/structures/rules/ITtscLintJsdocRules.ts +153 -0
  433. package/src/structures/rules/ITtscLintJsxA11yRules.ts +339 -0
  434. package/src/structures/rules/ITtscLintNextjsRules.ts +206 -0
  435. package/src/structures/rules/ITtscLintPlaywrightRules.ts +361 -0
  436. package/src/structures/rules/ITtscLintPromiseRules.ts +205 -0
  437. package/src/structures/rules/ITtscLintReactPerfRuleOptions.ts +19 -0
  438. package/src/structures/rules/ITtscLintReactPerfRules.ts +55 -0
  439. package/src/structures/rules/ITtscLintReactRuleOptions.ts +43 -0
  440. package/src/structures/rules/ITtscLintReactRules.ts +321 -0
  441. package/src/structures/rules/ITtscLintRegexpRules.ts +212 -0
  442. package/src/structures/rules/ITtscLintRuleOptionsMap.ts +89 -0
  443. package/src/structures/rules/ITtscLintRules.ts +77 -0
  444. package/src/structures/rules/ITtscLintSecurityRules.ts +162 -0
  445. package/src/structures/rules/ITtscLintSolidRules.ts +202 -0
  446. package/src/structures/rules/ITtscLintStorybookRuleOptions.ts +23 -0
  447. package/src/structures/rules/ITtscLintStorybookRules.ts +193 -0
  448. package/src/structures/rules/ITtscLintTanstackQueryRules.ts +102 -0
  449. package/src/structures/rules/ITtscLintTestingLibraryRuleOptions.ts +24 -0
  450. package/src/structures/rules/ITtscLintTestingLibraryRules.ts +342 -0
  451. package/src/structures/rules/ITtscLintTypeScriptRules.ts +1230 -0
  452. package/src/structures/rules/ITtscLintUnicornRules.ts +1143 -0
  453. package/src/structures/rules/ITtscLintVitestRules.ts +154 -0
  454. package/src/structures/rules/index.ts +31 -0
  455. package/lib/structures/ITtscLintFormatConfig.js.map +0 -1
  456. package/lib/structures/TtscLintRule.d.ts +0 -17
  457. package/lib/structures/TtscLintRule.js.map +0 -1
  458. package/lib/structures/TtscLintRuleMap.d.ts +0 -46
  459. package/lib/structures/TtscLintRuleMap.js.map +0 -1
  460. package/lib/structures/TtscLintRuleOptions.d.ts +0 -137
  461. package/lib/structures/TtscLintRuleOptions.js.map +0 -1
  462. package/src/structures/TtscLintRule.ts +0 -160
  463. package/src/structures/TtscLintRuleMap.ts +0 -55
  464. package/src/structures/TtscLintRuleOptions.ts +0 -151
@@ -0,0 +1,1132 @@
1
+ import type { TtscLintRuleSetting } from "../TtscLintRuleSetting";
2
+ /**
3
+ * TypeScript-only rules and `@typescript-eslint` plugin equivalents,
4
+ * exposed under the `typescript/*` namespace.
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.
11
+ *
12
+ * Generic JS/TS rules (such as `eqeqeq`, `no-console`) stay unnamespaced in
13
+ * {@link ITtscLintCoreRules}.
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.
18
+ *
19
+ * @reference https://typescript-eslint.io/rules/
20
+ */
21
+ export interface ITtscLintTypeScriptRules {
22
+ /**
23
+ * Require overload declarations for the same member to be written
24
+ * adjacently.
25
+ *
26
+ * Splitting overloads with other members hides the full signature
27
+ * set from readers and tools.
28
+ *
29
+ * @reference https://typescript-eslint.io/rules/adjacent-overload-signatures
30
+ */
31
+ "typescript/adjacent-overload-signatures"?: TtscLintRuleSetting;
32
+ /**
33
+ * Enforce one consistent spelling of array types.
34
+ *
35
+ * By default the rule prefers `T[]` / `readonly T[]` over `Array<T>`
36
+ * / `ReadonlyArray<T>`, matching `@typescript-eslint`'s `array-type`
37
+ * default.
38
+ *
39
+ * @reference https://typescript-eslint.io/rules/array-type
40
+ */
41
+ "typescript/array-type"?: TtscLintRuleSetting;
42
+ /**
43
+ * Reject `await` on operands that are not thenable.
44
+ *
45
+ * Type-aware — the Checker decides whether the awaited expression has
46
+ * a `then` method. Autofixable: drops the `await`.
47
+ *
48
+ * @reference https://typescript-eslint.io/rules/await-thenable
49
+ */
50
+ "typescript/await-thenable"?: TtscLintRuleSetting;
51
+ /**
52
+ * Reject `@ts-ignore`, `@ts-expect-error`, `@ts-nocheck`, and
53
+ * `@ts-check` comments.
54
+ *
55
+ * The default policy allows `@ts-expect-error` with an explanatory
56
+ * `--` description.
57
+ *
58
+ * @reference https://typescript-eslint.io/rules/ban-ts-comment
59
+ */
60
+ "typescript/ban-ts-comment"?: TtscLintRuleSetting;
61
+ /**
62
+ * Reject `// tslint:disable` and related TSLint directive comments
63
+ * left behind from the legacy TSLint era.
64
+ *
65
+ * @reference https://typescript-eslint.io/rules/ban-tslint-comment
66
+ */
67
+ "typescript/ban-tslint-comment"?: TtscLintRuleSetting;
68
+ /**
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.
76
+ *
77
+ * @reference https://typescript-eslint.io/rules/class-literal-property-style
78
+ */
79
+ "typescript/class-literal-property-style"?: TtscLintRuleSetting;
80
+ /**
81
+ * Prefer `Record<K, V>` over `{ [key: K]: V }` when an object type
82
+ * has a single index signature and no other members.
83
+ *
84
+ * @reference https://typescript-eslint.io/rules/consistent-indexed-object-style
85
+ */
86
+ "typescript/consistent-indexed-object-style"?: TtscLintRuleSetting;
87
+ /**
88
+ * Prefer the `as` form of type assertions over the angle-bracket
89
+ * form `<T>expr`, which is ambiguous inside JSX.
90
+ *
91
+ * @reference https://typescript-eslint.io/rules/consistent-type-assertions
92
+ */
93
+ "typescript/consistent-type-assertions"?: TtscLintRuleSetting;
94
+ /**
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.
99
+ *
100
+ * @reference https://typescript-eslint.io/rules/consistent-generic-constructors
101
+ */
102
+ "typescript/consistent-generic-constructors"?: TtscLintRuleSetting;
103
+ /**
104
+ * Enforce one consistent shape for object types.
105
+ *
106
+ * By default the rule prefers `interface` over `type` aliases for
107
+ * plain object shapes.
108
+ *
109
+ * @reference https://typescript-eslint.io/rules/consistent-type-definitions
110
+ */
111
+ "typescript/consistent-type-definitions"?: TtscLintRuleSetting;
112
+ /**
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.
118
+ *
119
+ * @reference https://typescript-eslint.io/rules/consistent-type-exports
120
+ */
121
+ "typescript/consistent-type-exports"?: TtscLintRuleSetting;
122
+ /**
123
+ * Require imports that only reference types to use `import type {}`
124
+ * so the import has no runtime cost.
125
+ *
126
+ * @reference https://typescript-eslint.io/rules/consistent-type-imports
127
+ */
128
+ "typescript/consistent-type-imports"?: TtscLintRuleSetting;
129
+ /**
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.
134
+ *
135
+ * @reference https://typescript-eslint.io/rules/explicit-function-return-type
136
+ */
137
+ "typescript/explicit-function-return-type"?: TtscLintRuleSetting;
138
+ /**
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.
144
+ *
145
+ * @reference https://typescript-eslint.io/rules/explicit-member-accessibility
146
+ */
147
+ "typescript/explicit-member-accessibility"?: TtscLintRuleSetting;
148
+ /**
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.
153
+ *
154
+ * @reference https://typescript-eslint.io/rules/method-signature-style
155
+ */
156
+ "typescript/method-signature-style"?: TtscLintRuleSetting;
157
+ /**
158
+ * Reject `delete arr[i]` against array elements.
159
+ *
160
+ * `delete` leaves a hole; use `arr.splice` to shrink the array.
161
+ *
162
+ * @reference https://typescript-eslint.io/rules/no-array-delete
163
+ */
164
+ "typescript/no-array-delete"?: TtscLintRuleSetting;
165
+ /**
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.
169
+ *
170
+ * @reference https://typescript-eslint.io/rules/no-array-for-each
171
+ */
172
+ "typescript/no-array-for-each"?: TtscLintRuleSetting;
173
+ /**
174
+ * Reject string-coercion contexts (`` `${x}` ``, `x + ""`, `String(x)`)
175
+ * where `x` has a type whose `toString` resolves to the default
176
+ * `Object.prototype.toString` and would print `"[object Object]"`.
177
+ *
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.
183
+ *
184
+ * @reference https://typescript-eslint.io/rules/no-base-to-string
185
+ */
186
+ "typescript/no-base-to-string"?: TtscLintRuleSetting;
187
+ /**
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.
192
+ *
193
+ * @reference https://typescript-eslint.io/rules/no-extraneous-class
194
+ */
195
+ "typescript/no-extraneous-class"?: TtscLintRuleSetting;
196
+ /**
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`.
200
+ *
201
+ * Wrap the assertion in parentheses (`(a!) == b`) or drop it
202
+ * entirely.
203
+ *
204
+ * @reference https://typescript-eslint.io/rules/no-confusing-non-null-assertion
205
+ */
206
+ "typescript/no-confusing-non-null-assertion"?: TtscLintRuleSetting;
207
+ /**
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.
211
+ *
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`).
215
+ *
216
+ * @reference https://typescript-eslint.io/rules/no-confusing-void-expression
217
+ */
218
+ "typescript/no-confusing-void-expression"?: TtscLintRuleSetting;
219
+ /**
220
+ * Reject references to declarations marked `@deprecated` in their
221
+ * JSDoc.
222
+ *
223
+ * 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.
229
+ *
230
+ * @reference https://typescript-eslint.io/rules/no-deprecated
231
+ */
232
+ "typescript/no-deprecated"?: TtscLintRuleSetting;
233
+ /**
234
+ * Reject `enum` declarations whose members share the same literal
235
+ * value.
236
+ *
237
+ * Reverse lookup (`E[E.X]`) returns whichever member is listed last,
238
+ * so duplicates almost always reflect a copy-paste mistake.
239
+ *
240
+ * @reference https://typescript-eslint.io/rules/no-duplicate-enum-values
241
+ */
242
+ "typescript/no-duplicate-enum-values"?: TtscLintRuleSetting;
243
+ /**
244
+ * Reject computed bracket-key `delete` expressions (`delete obj[x]`)
245
+ * where `x` is not a string literal, since these escape type tracking.
246
+ *
247
+ * @reference https://typescript-eslint.io/rules/no-dynamic-delete
248
+ */
249
+ "typescript/no-dynamic-delete"?: TtscLintRuleSetting;
250
+ /**
251
+ * Reject empty `interface` declarations.
252
+ *
253
+ * An empty interface that does not `extends` anything is equivalent
254
+ * to `unknown` and almost always represents incomplete typing work.
255
+ *
256
+ * @reference https://typescript-eslint.io/rules/no-empty-interface
257
+ */
258
+ "typescript/no-empty-interface"?: TtscLintRuleSetting;
259
+ /**
260
+ * Reject `{}` as a type annotation.
261
+ *
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.
265
+ *
266
+ * @reference https://typescript-eslint.io/rules/no-empty-object-type
267
+ */
268
+ "typescript/no-empty-object-type"?: TtscLintRuleSetting;
269
+ /**
270
+ * Reject `any` type annotations.
271
+ *
272
+ * Typically configured as `"warning"` during incremental migrations.
273
+ *
274
+ * @reference https://typescript-eslint.io/rules/no-explicit-any
275
+ */
276
+ "typescript/no-explicit-any"?: TtscLintRuleSetting;
277
+ /**
278
+ * Reject `x!!` — chained non-null assertions where the inner one
279
+ * already removes nullability. Autofixable: drops the extra `!`.
280
+ *
281
+ * @reference https://typescript-eslint.io/rules/no-extra-non-null-assertion
282
+ */
283
+ "typescript/no-extra-non-null-assertion"?: TtscLintRuleSetting;
284
+ /**
285
+ * Reject Promise-typed expressions whose result is discarded — most
286
+ * often a bare `getPromise();` expression statement.
287
+ *
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`.
292
+ *
293
+ * @reference https://typescript-eslint.io/rules/no-floating-promises
294
+ */
295
+ "typescript/no-floating-promises"?: TtscLintRuleSetting;
296
+ /**
297
+ * Reject `for (const k in arr)` where `arr` is statically typed as an
298
+ * array or tuple.
299
+ *
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.
304
+ *
305
+ * @reference https://typescript-eslint.io/rules/no-for-in-array
306
+ */
307
+ "typescript/no-for-in-array"?: TtscLintRuleSetting;
308
+ /**
309
+ * Hoist inline `type` modifiers on individual imports into a single
310
+ * top-level `import type {}`. Autofixable.
311
+ *
312
+ * @reference https://typescript-eslint.io/rules/no-import-type-side-effects
313
+ */
314
+ "typescript/no-import-type-side-effects"?: TtscLintRuleSetting;
315
+ /**
316
+ * Reject explicit type annotations that TypeScript can already
317
+ * infer from the initializer (`const x: number = 1`).
318
+ *
319
+ * @reference https://typescript-eslint.io/rules/no-inferrable-types
320
+ */
321
+ "typescript/no-inferrable-types"?: TtscLintRuleSetting;
322
+ /**
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` /
329
+ * `IterableIterator` / `AsyncIterableIterator`.
330
+ *
331
+ * @reference https://typescript-eslint.io/rules/no-invalid-void-type
332
+ */
333
+ "typescript/no-invalid-void-type"?: TtscLintRuleSetting;
334
+ /**
335
+ * TypeScript-aware extension of `no-magic-numbers` that additionally ignores enum member values.
336
+ *
337
+ * @reference https://typescript-eslint.io/rules/no-magic-numbers
338
+ */
339
+ "typescript/no-magic-numbers"?: TtscLintRuleSetting;
340
+ /**
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.
345
+ *
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.
350
+ *
351
+ * @reference https://typescript-eslint.io/rules/no-meaningless-void-operator
352
+ */
353
+ "typescript/no-meaningless-void-operator"?: TtscLintRuleSetting;
354
+ /**
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 }`.
359
+ *
360
+ * Use a separate construct signature on a factory type when the
361
+ * intent is "anything callable with `new`".
362
+ *
363
+ * @reference https://typescript-eslint.io/rules/no-misused-new
364
+ */
365
+ "typescript/no-misused-new"?: TtscLintRuleSetting;
366
+ /**
367
+ * Reject Promise values supplied where a non-Promise was expected.
368
+ *
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.
374
+ *
375
+ * @reference https://typescript-eslint.io/rules/no-misused-promises
376
+ */
377
+ "typescript/no-misused-promises"?: TtscLintRuleSetting;
378
+ /**
379
+ * Reject spread expressions whose operand is syntactically wrong
380
+ * for the surrounding context.
381
+ *
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
387
+ * full type-aware rule.
388
+ *
389
+ * @reference https://typescript-eslint.io/rules/no-misused-spread
390
+ */
391
+ "typescript/no-misused-spread"?: TtscLintRuleSetting;
392
+ /**
393
+ * Reject `enum`s that mix numeric and string members, which makes
394
+ * the resulting type unsafe for reverse lookups.
395
+ *
396
+ * @reference https://typescript-eslint.io/rules/no-mixed-enums
397
+ */
398
+ "typescript/no-mixed-enums"?: TtscLintRuleSetting;
399
+ /**
400
+ * Reject non-ambient `namespace` and `module Foo {}` declarations
401
+ * in regular `.ts` files.
402
+ *
403
+ * ES modules replace the legacy namespace concept; ambient `declare
404
+ * namespace` in `.d.ts` files stays allowed by default for global
405
+ * typings compatibility.
406
+ *
407
+ * @reference https://typescript-eslint.io/rules/no-namespace
408
+ */
409
+ "typescript/no-namespace"?: TtscLintRuleSetting;
410
+ /**
411
+ * Reject `x! ?? y` — the `!` collapses `null | undefined` to a
412
+ * non-nullish value, so the `??` branch is unreachable.
413
+ *
414
+ * @reference https://typescript-eslint.io/rules/no-non-null-asserted-nullish-coalescing
415
+ */
416
+ "typescript/no-non-null-asserted-nullish-coalescing"?: TtscLintRuleSetting;
417
+ /**
418
+ * Reject `x!?.y` — the non-null assertion makes the optional chain
419
+ * meaningless because the inner expression is already known to be
420
+ * defined.
421
+ *
422
+ * @reference https://typescript-eslint.io/rules/no-non-null-asserted-optional-chain
423
+ */
424
+ "typescript/no-non-null-asserted-optional-chain"?: TtscLintRuleSetting;
425
+ /**
426
+ * Reject postfix `!` non-null assertions altogether.
427
+ *
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.
431
+ *
432
+ * @reference https://typescript-eslint.io/rules/no-non-null-assertion
433
+ */
434
+ "typescript/no-non-null-assertion"?: TtscLintRuleSetting;
435
+ /**
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.
440
+ *
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.
445
+ *
446
+ * @reference https://typescript-eslint.io/rules/no-redundant-type-constituents
447
+ */
448
+ "typescript/no-redundant-type-constituents"?: TtscLintRuleSetting;
449
+ /**
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.
456
+ *
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.
460
+ *
461
+ * @reference https://typescript-eslint.io/rules/no-restricted-types
462
+ */
463
+ "typescript/no-restricted-types"?: TtscLintRuleSetting;
464
+ /**
465
+ * Reject `require(...)` calls and `import x = require(...)`
466
+ * declarations.
467
+ *
468
+ * Use ES module `import` syntax so the type-only / runtime-import
469
+ * distinction is preserved and declaration shape stays consistent.
470
+ *
471
+ * @reference https://typescript-eslint.io/rules/no-require-imports
472
+ */
473
+ "typescript/no-require-imports"?: TtscLintRuleSetting;
474
+ /**
475
+ * Reject aliasing `this` to a local (`const self = this`, `const
476
+ * that = this`, destructuring `const { x } = this`).
477
+ *
478
+ * Arrow functions and `.bind(this)` make the workaround unnecessary;
479
+ * the alias also breaks type narrowing on `this`.
480
+ *
481
+ * @reference https://typescript-eslint.io/rules/no-this-alias
482
+ */
483
+ "typescript/no-this-alias"?: TtscLintRuleSetting;
484
+ /**
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.
489
+ *
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.
493
+ *
494
+ * @reference https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare
495
+ */
496
+ "typescript/no-unnecessary-boolean-literal-compare"?: TtscLintRuleSetting;
497
+ /**
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.
504
+ *
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.
510
+ *
511
+ * @reference https://typescript-eslint.io/rules/no-unnecessary-condition
512
+ */
513
+ "typescript/no-unnecessary-condition"?: TtscLintRuleSetting;
514
+ /**
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.
518
+ *
519
+ * @reference https://typescript-eslint.io/rules/no-unnecessary-parameter-property-assignment
520
+ */
521
+ "typescript/no-unnecessary-parameter-property-assignment"?: TtscLintRuleSetting;
522
+ /**
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.
527
+ *
528
+ * 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.
533
+ *
534
+ * @reference https://typescript-eslint.io/rules/no-unnecessary-qualifier
535
+ */
536
+ "typescript/no-unnecessary-qualifier"?: TtscLintRuleSetting;
537
+ /**
538
+ * 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.
543
+ *
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.
548
+ *
549
+ * @reference https://typescript-eslint.io/rules/no-unnecessary-template-expression
550
+ */
551
+ "typescript/no-unnecessary-template-expression"?: TtscLintRuleSetting;
552
+ /**
553
+ * Reject `Foo<DefaultT>` calls where the supplied generic argument is
554
+ * the same as the parameter's default — the argument adds nothing.
555
+ *
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.
561
+ *
562
+ * @reference https://typescript-eslint.io/rules/no-unnecessary-type-arguments
563
+ */
564
+ "typescript/no-unnecessary-type-arguments"?: TtscLintRuleSetting;
565
+ /**
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.
568
+ *
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.
573
+ *
574
+ * Type-aware via the Checker.
575
+ *
576
+ * @reference https://typescript-eslint.io/rules/no-unnecessary-type-assertion
577
+ */
578
+ "typescript/no-unnecessary-type-assertion"?: TtscLintRuleSetting;
579
+ /**
580
+ * Reject `<T extends unknown>` and similar constraints that match
581
+ * everything. Autofixable: drops the constraint.
582
+ *
583
+ * @reference https://typescript-eslint.io/rules/no-unnecessary-type-constraint
584
+ */
585
+ "typescript/no-unnecessary-type-constraint"?: TtscLintRuleSetting;
586
+ /**
587
+ * 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.
590
+ *
591
+ * Type-aware via the Checker. `unknown` is not flagged.
592
+ *
593
+ * @reference https://typescript-eslint.io/rules/no-unsafe-argument
594
+ */
595
+ "typescript/no-unsafe-argument"?: TtscLintRuleSetting;
596
+ /**
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.
600
+ *
601
+ * Type-aware via the Checker. `unknown` is not flagged.
602
+ *
603
+ * @reference https://typescript-eslint.io/rules/no-unsafe-assignment
604
+ */
605
+ "typescript/no-unsafe-assignment"?: TtscLintRuleSetting;
606
+ /**
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.
610
+ *
611
+ * Type-aware via the Checker. Visits plain calls, `new`, and tagged
612
+ * templates. `unknown` is not flagged.
613
+ *
614
+ * @reference https://typescript-eslint.io/rules/no-unsafe-call
615
+ */
616
+ "typescript/no-unsafe-call"?: TtscLintRuleSetting;
617
+ /**
618
+ * Reject declaration merging between an `interface` and a `class`
619
+ * with the same name.
620
+ *
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.
624
+ *
625
+ * @reference https://typescript-eslint.io/rules/no-unsafe-declaration-merging
626
+ */
627
+ "typescript/no-unsafe-declaration-merging"?: TtscLintRuleSetting;
628
+ /**
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.
634
+ *
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.
640
+ *
641
+ * @reference https://typescript-eslint.io/rules/no-unsafe-enum-comparison
642
+ */
643
+ "typescript/no-unsafe-enum-comparison"?: TtscLintRuleSetting;
644
+ /**
645
+ * Reject the unsafe `Function` type, which matches every callable
646
+ * regardless of signature.
647
+ *
648
+ * Declare the specific call signature instead.
649
+ *
650
+ * @reference https://typescript-eslint.io/rules/no-unsafe-function-type
651
+ */
652
+ "typescript/no-unsafe-function-type"?: TtscLintRuleSetting;
653
+ /**
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.
657
+ *
658
+ * Type-aware via the Checker. Visits dot access and computed
659
+ * element access. `unknown` is not flagged.
660
+ *
661
+ * @reference https://typescript-eslint.io/rules/no-unsafe-member-access
662
+ */
663
+ "typescript/no-unsafe-member-access"?: TtscLintRuleSetting;
664
+ /**
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.
670
+ *
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.
676
+ *
677
+ * @reference https://typescript-eslint.io/rules/no-unsafe-return
678
+ */
679
+ "typescript/no-unsafe-return"?: TtscLintRuleSetting;
680
+ /**
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.
685
+ *
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.
689
+ *
690
+ * @reference https://typescript-eslint.io/rules/no-unsafe-unary-minus
691
+ */
692
+ "typescript/no-unsafe-unary-minus"?: TtscLintRuleSetting;
693
+ /**
694
+ * TypeScript-aware extension of `no-useless-constructor` that tolerates a constructor existing solely to expose parameter properties.
695
+ *
696
+ * @reference https://typescript-eslint.io/rules/no-useless-constructor
697
+ */
698
+ "typescript/no-useless-constructor"?: TtscLintRuleSetting;
699
+ /**
700
+ * Reject redundant `export {}` declarations in module files.
701
+ *
702
+ * The file is already a module via its other top-level `import` /
703
+ * `export`.
704
+ *
705
+ * @reference https://typescript-eslint.io/rules/no-useless-empty-export
706
+ */
707
+ "typescript/no-useless-empty-export"?: TtscLintRuleSetting;
708
+ /**
709
+ * Reject the wrapper object types `String`, `Number`, `Boolean`,
710
+ * `Symbol`, and `BigInt`.
711
+ *
712
+ * Autofixable to the corresponding primitive. `Object` stays
713
+ * detection-only because it has slightly different semantics.
714
+ *
715
+ * @reference https://typescript-eslint.io/rules/no-wrapper-object-types
716
+ */
717
+ "typescript/no-wrapper-object-types"?: TtscLintRuleSetting;
718
+ /**
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.
722
+ *
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.
727
+ *
728
+ * @reference https://typescript-eslint.io/rules/non-nullable-type-assertion-style
729
+ */
730
+ "typescript/non-nullable-type-assertion-style"?: TtscLintRuleSetting;
731
+ /**
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.
735
+ *
736
+ * Type-aware via the Checker. Non-Error throws lose the stack trace
737
+ * and confuse `instanceof` checks in the surrounding `catch`.
738
+ *
739
+ * @reference https://typescript-eslint.io/rules/only-throw-error
740
+ */
741
+ "typescript/only-throw-error"?: TtscLintRuleSetting;
742
+ /**
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.
747
+ *
748
+ * AST-only — the trigger is a syntactic modifier (`public` /
749
+ * `private` / `protected` / `readonly` / `override`) on a
750
+ * constructor parameter.
751
+ *
752
+ * @reference https://typescript-eslint.io/rules/parameter-properties
753
+ */
754
+ "typescript/parameter-properties"?: TtscLintRuleSetting;
755
+ /**
756
+ * Prefer `as const` over `as "literal"` assertions. Autofixable.
757
+ *
758
+ * @reference https://typescript-eslint.io/rules/prefer-as-const
759
+ */
760
+ "typescript/prefer-as-const"?: TtscLintRuleSetting;
761
+ /**
762
+ * Require every `enum` member to have an explicit initializer.
763
+ *
764
+ * Implicit auto-increment is fine for novelty enums but dangerous
765
+ * once a value gets persisted.
766
+ *
767
+ * @reference https://typescript-eslint.io/rules/prefer-enum-initializers
768
+ */
769
+ "typescript/prefer-enum-initializers"?: TtscLintRuleSetting;
770
+ /**
771
+ * Prefer `arr.find(predicate)` over `arr.filter(predicate)[0]` and
772
+ * `arr.filter(predicate).at(0)`.
773
+ *
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.
781
+ *
782
+ * @reference https://typescript-eslint.io/rules/prefer-find
783
+ */
784
+ "typescript/prefer-find"?: TtscLintRuleSetting;
785
+ /**
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.
789
+ *
790
+ * @reference https://typescript-eslint.io/rules/prefer-function-type
791
+ */
792
+ "typescript/prefer-function-type"?: TtscLintRuleSetting;
793
+ /**
794
+ * Prefer `array.includes(x)` over `array.indexOf(x) !== -1` (and the
795
+ * matching `=== -1`, `>= 0`, `< 0`, `> -1` shapes).
796
+ *
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`.
802
+ *
803
+ * @reference https://typescript-eslint.io/rules/prefer-includes
804
+ */
805
+ "typescript/prefer-includes"?: TtscLintRuleSetting;
806
+ /**
807
+ * Prefer literal initializers (`= 0`, `= "FOO"`) for enum members
808
+ * over computed expressions, so the value is decidable at compile
809
+ * time.
810
+ *
811
+ * @reference https://typescript-eslint.io/rules/prefer-literal-enum-member
812
+ */
813
+ "typescript/prefer-literal-enum-member"?: TtscLintRuleSetting;
814
+ /**
815
+ * Prefer the `namespace` keyword over the legacy `module Foo {}`
816
+ * form. Autofixable.
817
+ *
818
+ * @reference https://typescript-eslint.io/rules/prefer-namespace-keyword
819
+ */
820
+ "typescript/prefer-namespace-keyword"?: TtscLintRuleSetting;
821
+ /**
822
+ * Prefer `??` over `||` (and `??=` over `||=`, and `??` over the
823
+ * ternary `x ? x : y`) when the intent is to default `null` /
824
+ * `undefined`.
825
+ *
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.).
831
+ *
832
+ * @reference https://typescript-eslint.io/rules/prefer-nullish-coalescing
833
+ */
834
+ "typescript/prefer-nullish-coalescing"?: TtscLintRuleSetting;
835
+ /**
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`.
838
+ *
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.
845
+ *
846
+ * @reference https://typescript-eslint.io/rules/prefer-optional-chain
847
+ */
848
+ "typescript/prefer-optional-chain"?: TtscLintRuleSetting;
849
+ /**
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.
853
+ *
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.
863
+ *
864
+ * @reference https://typescript-eslint.io/rules/prefer-promise-reject-errors
865
+ */
866
+ "typescript/prefer-promise-reject-errors"?: TtscLintRuleSetting;
867
+ /**
868
+ * Reject private class fields that could carry `readonly`.
869
+ *
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.
879
+ *
880
+ * @reference https://typescript-eslint.io/rules/prefer-readonly
881
+ */
882
+ "typescript/prefer-readonly"?: TtscLintRuleSetting;
883
+ /**
884
+ * Prefer `arr.reduce<T>(callback, initial)` over the assertion-on-
885
+ * initial-value pattern `arr.reduce(callback, initial as T)`.
886
+ *
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.
895
+ *
896
+ * @reference https://typescript-eslint.io/rules/prefer-reduce-type-parameter
897
+ */
898
+ "typescript/prefer-reduce-type-parameter"?: TtscLintRuleSetting;
899
+ /**
900
+ * Prefer `re.exec(str)` over `str.match(re)` when the regex has no
901
+ * `g` flag.
902
+ *
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.
913
+ *
914
+ * @reference https://typescript-eslint.io/rules/prefer-regexp-exec
915
+ */
916
+ "typescript/prefer-regexp-exec"?: TtscLintRuleSetting;
917
+ /**
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.
922
+ *
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.
930
+ *
931
+ * @reference https://typescript-eslint.io/rules/prefer-return-this-type
932
+ */
933
+ "typescript/prefer-return-this-type"?: TtscLintRuleSetting;
934
+ /**
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)`.
940
+ *
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.
945
+ *
946
+ * @reference https://typescript-eslint.io/rules/prefer-string-starts-ends-with
947
+ */
948
+ "typescript/prefer-string-starts-ends-with"?: TtscLintRuleSetting;
949
+ /**
950
+ * Require functions whose return type is `Promise<T>` (or a
951
+ * Promise-like thenable) to be declared with the `async` keyword.
952
+ *
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
960
+ * no body) are skipped — there is no body to wrap.
961
+ *
962
+ * @reference https://typescript-eslint.io/rules/promise-function-async
963
+ */
964
+ "typescript/promise-function-async"?: TtscLintRuleSetting;
965
+ /**
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.
972
+ *
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.
977
+ *
978
+ * @reference https://typescript-eslint.io/rules/related-getter-setter-pairs
979
+ */
980
+ "typescript/related-getter-setter-pairs"?: TtscLintRuleSetting;
981
+ /**
982
+ * Require `arr.sort()` and `arr.toSorted()` calls to pass an
983
+ * explicit `compareFunction`.
984
+ *
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.
991
+ *
992
+ * @reference https://typescript-eslint.io/rules/require-array-sort-compare
993
+ */
994
+ "typescript/require-array-sort-compare"?: TtscLintRuleSetting;
995
+ /**
996
+ * Reject `async` functions whose body contains no `await`
997
+ * expression.
998
+ *
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`.
1003
+ *
1004
+ * @reference https://typescript-eslint.io/rules/require-await
1005
+ */
1006
+ "typescript/require-await"?: TtscLintRuleSetting;
1007
+ /**
1008
+ * Reject `+` expressions whose operands are not both `number`,
1009
+ * both `string`, or both `bigint`.
1010
+ *
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.
1016
+ *
1017
+ * @reference https://typescript-eslint.io/rules/restrict-plus-operands
1018
+ */
1019
+ "typescript/restrict-plus-operands"?: TtscLintRuleSetting;
1020
+ /**
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.
1024
+ *
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.
1031
+ *
1032
+ * @reference https://typescript-eslint.io/rules/restrict-template-expressions
1033
+ */
1034
+ "typescript/restrict-template-expressions"?: TtscLintRuleSetting;
1035
+ /**
1036
+ * Reject `return promise` inside `try`, `catch`, or `finally`;
1037
+ * require `return await promise`.
1038
+ *
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.
1042
+ *
1043
+ * @reference https://typescript-eslint.io/rules/return-await
1044
+ */
1045
+ "typescript/return-await"?: TtscLintRuleSetting;
1046
+ /**
1047
+ * 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.
1053
+ *
1054
+ * 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.
1059
+ *
1060
+ * @reference https://typescript-eslint.io/rules/sort-type-constituents
1061
+ */
1062
+ "typescript/sort-type-constituents"?: TtscLintRuleSetting;
1063
+ /**
1064
+ * Reject non-boolean values used in a boolean context.
1065
+ *
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`,
1073
+ * `str.length > 0`, `obj != null`) names the intent.
1074
+ *
1075
+ * @reference https://typescript-eslint.io/rules/strict-boolean-expressions
1076
+ */
1077
+ "typescript/strict-boolean-expressions"?: TtscLintRuleSetting;
1078
+ /**
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.
1082
+ *
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.
1089
+ *
1090
+ * @reference https://typescript-eslint.io/rules/switch-exhaustiveness-check
1091
+ */
1092
+ "typescript/switch-exhaustiveness-check"?: TtscLintRuleSetting;
1093
+ /**
1094
+ * Reject `/// <reference path="..." />`, `/// <reference types=""
1095
+ * />`, and `/// <reference lib="" />` directives.
1096
+ *
1097
+ * Replace with `import` (or `import type`) declarations and
1098
+ * `compilerOptions.types` in `tsconfig.json`.
1099
+ *
1100
+ * @reference https://typescript-eslint.io/rules/triple-slash-reference
1101
+ */
1102
+ "typescript/triple-slash-reference"?: TtscLintRuleSetting;
1103
+ /**
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).
1107
+ *
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.
1116
+ *
1117
+ * @reference https://typescript-eslint.io/rules/unbound-method
1118
+ */
1119
+ "typescript/unbound-method"?: TtscLintRuleSetting;
1120
+ /**
1121
+ * Require the callback parameter of `.catch(...)` and the second
1122
+ * argument of `.then(...)` to be typed `unknown`.
1123
+ *
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`.
1128
+ *
1129
+ * @reference https://typescript-eslint.io/rules/use-unknown-in-catch-callback-variable
1130
+ */
1131
+ "typescript/use-unknown-in-catch-callback-variable"?: TtscLintRuleSetting;
1132
+ }