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