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