@ttsc/lint 0.13.0 → 0.14.0-dev.20260528

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