@ttsc/lint 0.13.1 → 0.14.0-dev.20260528

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (464) hide show
  1. package/README.md +948 -69
  2. package/lib/defaultFormat.d.ts +9 -6
  3. package/lib/defaultFormat.js +9 -6
  4. package/lib/defaultFormat.js.map +1 -1
  5. package/lib/index.d.ts +46 -0
  6. package/lib/index.js +35 -10
  7. package/lib/index.js.map +1 -1
  8. package/lib/structures/ITtscLintConfig.d.ts +12 -6
  9. package/lib/structures/{ITtscLintFormatConfig.d.ts → ITtscLintFormat.d.ts} +2 -2
  10. package/lib/structures/{TtscLintRuleMap.js → ITtscLintFormat.js} +1 -1
  11. package/lib/structures/ITtscLintFormat.js.map +1 -0
  12. package/lib/structures/TtscLintRuleSetting.d.ts +49 -0
  13. package/lib/structures/{TtscLintRuleOptions.js → TtscLintRuleSetting.js} +1 -1
  14. package/lib/structures/TtscLintRuleSetting.js.map +1 -0
  15. package/lib/structures/index.d.ts +3 -4
  16. package/lib/structures/index.js +3 -4
  17. package/lib/structures/index.js.map +1 -1
  18. package/lib/structures/rules/ITtscLintBoundariesRuleOptions.d.ts +104 -0
  19. package/lib/structures/rules/ITtscLintBoundariesRuleOptions.js +14 -0
  20. package/lib/structures/rules/ITtscLintBoundariesRuleOptions.js.map +1 -0
  21. package/lib/structures/rules/ITtscLintBoundariesRules.d.ts +79 -0
  22. package/lib/structures/rules/ITtscLintBoundariesRules.js +3 -0
  23. package/lib/structures/rules/ITtscLintBoundariesRules.js.map +1 -0
  24. package/lib/structures/rules/ITtscLintContributorRules.d.ts +17 -0
  25. package/lib/structures/rules/ITtscLintContributorRules.js +3 -0
  26. package/lib/structures/rules/ITtscLintContributorRules.js.map +1 -0
  27. package/lib/structures/rules/ITtscLintCoreRules.d.ts +1257 -0
  28. package/lib/structures/{ITtscLintFormatConfig.js → rules/ITtscLintCoreRules.js} +1 -1
  29. package/lib/structures/rules/ITtscLintCoreRules.js.map +1 -0
  30. package/lib/structures/rules/ITtscLintCypressRuleOptions.d.ts +17 -0
  31. package/lib/structures/rules/ITtscLintCypressRuleOptions.js +10 -0
  32. package/lib/structures/rules/ITtscLintCypressRuleOptions.js.map +1 -0
  33. package/lib/structures/rules/ITtscLintCypressRules.d.ts +129 -0
  34. package/lib/structures/rules/ITtscLintCypressRules.js +3 -0
  35. package/lib/structures/rules/ITtscLintCypressRules.js.map +1 -0
  36. package/lib/structures/rules/ITtscLintFunctionalRuleOptions.d.ts +157 -0
  37. package/lib/structures/rules/ITtscLintFunctionalRuleOptions.js +13 -0
  38. package/lib/structures/rules/ITtscLintFunctionalRuleOptions.js.map +1 -0
  39. package/lib/structures/rules/ITtscLintFunctionalRules.d.ts +167 -0
  40. package/lib/structures/rules/ITtscLintFunctionalRules.js +3 -0
  41. package/lib/structures/rules/ITtscLintFunctionalRules.js.map +1 -0
  42. package/lib/structures/rules/ITtscLintJestRules.d.ts +201 -0
  43. package/lib/structures/rules/ITtscLintJestRules.js +3 -0
  44. package/lib/structures/rules/ITtscLintJestRules.js.map +1 -0
  45. package/lib/structures/rules/ITtscLintJsdocRules.d.ts +140 -0
  46. package/lib/structures/rules/ITtscLintJsdocRules.js +3 -0
  47. package/lib/structures/rules/ITtscLintJsdocRules.js.map +1 -0
  48. package/lib/structures/rules/ITtscLintJsxA11yRules.d.ts +302 -0
  49. package/lib/structures/rules/ITtscLintJsxA11yRules.js +3 -0
  50. package/lib/structures/rules/ITtscLintJsxA11yRules.js.map +1 -0
  51. package/lib/structures/rules/ITtscLintNextjsRules.d.ts +185 -0
  52. package/lib/structures/rules/ITtscLintNextjsRules.js +3 -0
  53. package/lib/structures/rules/ITtscLintNextjsRules.js.map +1 -0
  54. package/lib/structures/rules/ITtscLintPlaywrightRules.d.ts +330 -0
  55. package/lib/structures/rules/ITtscLintPlaywrightRules.js +3 -0
  56. package/lib/structures/rules/ITtscLintPlaywrightRules.js.map +1 -0
  57. package/lib/structures/rules/ITtscLintPromiseRules.d.ts +188 -0
  58. package/lib/structures/rules/ITtscLintPromiseRules.js +3 -0
  59. package/lib/structures/rules/ITtscLintPromiseRules.js.map +1 -0
  60. package/lib/structures/rules/ITtscLintReactPerfRuleOptions.d.ts +18 -0
  61. package/lib/structures/rules/ITtscLintReactPerfRuleOptions.js +8 -0
  62. package/lib/structures/rules/ITtscLintReactPerfRuleOptions.js.map +1 -0
  63. package/lib/structures/rules/ITtscLintReactPerfRules.d.ts +51 -0
  64. package/lib/structures/rules/ITtscLintReactPerfRules.js +3 -0
  65. package/lib/structures/rules/ITtscLintReactPerfRules.js.map +1 -0
  66. package/lib/structures/rules/ITtscLintReactRuleOptions.d.ts +39 -0
  67. package/lib/structures/rules/ITtscLintReactRuleOptions.js +12 -0
  68. package/lib/structures/rules/ITtscLintReactRuleOptions.js.map +1 -0
  69. package/lib/structures/rules/ITtscLintReactRules.d.ts +289 -0
  70. package/lib/structures/rules/ITtscLintReactRules.js +3 -0
  71. package/lib/structures/rules/ITtscLintReactRules.js.map +1 -0
  72. package/lib/structures/rules/ITtscLintRegexpRules.d.ts +190 -0
  73. package/lib/structures/rules/ITtscLintRegexpRules.js +3 -0
  74. package/lib/structures/rules/ITtscLintRegexpRules.js.map +1 -0
  75. package/lib/structures/rules/ITtscLintRuleOptionsMap.d.ts +66 -0
  76. package/lib/structures/rules/ITtscLintRuleOptionsMap.js +3 -0
  77. package/lib/structures/rules/ITtscLintRuleOptionsMap.js.map +1 -0
  78. package/lib/structures/rules/ITtscLintRules.d.ts +55 -0
  79. package/lib/structures/{TtscLintRule.js → rules/ITtscLintRules.js} +1 -1
  80. package/lib/structures/rules/ITtscLintRules.js.map +1 -0
  81. package/lib/structures/rules/ITtscLintSecurityRules.d.ts +148 -0
  82. package/lib/structures/rules/ITtscLintSecurityRules.js +3 -0
  83. package/lib/structures/rules/ITtscLintSecurityRules.js.map +1 -0
  84. package/lib/structures/rules/ITtscLintSolidRules.d.ts +181 -0
  85. package/lib/structures/rules/ITtscLintSolidRules.js +3 -0
  86. package/lib/structures/rules/ITtscLintSolidRules.js.map +1 -0
  87. package/lib/structures/rules/ITtscLintStorybookRuleOptions.d.ts +21 -0
  88. package/lib/structures/rules/ITtscLintStorybookRuleOptions.js +9 -0
  89. package/lib/structures/rules/ITtscLintStorybookRuleOptions.js.map +1 -0
  90. package/lib/structures/rules/ITtscLintStorybookRules.d.ts +174 -0
  91. package/lib/structures/rules/ITtscLintStorybookRules.js +3 -0
  92. package/lib/structures/rules/ITtscLintStorybookRules.js.map +1 -0
  93. package/lib/structures/rules/ITtscLintTanstackQueryRules.d.ts +94 -0
  94. package/lib/structures/rules/ITtscLintTanstackQueryRules.js +3 -0
  95. package/lib/structures/rules/ITtscLintTanstackQueryRules.js.map +1 -0
  96. package/lib/structures/rules/ITtscLintTestingLibraryRuleOptions.d.ts +22 -0
  97. package/lib/structures/rules/ITtscLintTestingLibraryRuleOptions.js +10 -0
  98. package/lib/structures/rules/ITtscLintTestingLibraryRuleOptions.js.map +1 -0
  99. package/lib/structures/rules/ITtscLintTestingLibraryRules.d.ts +310 -0
  100. package/lib/structures/rules/ITtscLintTestingLibraryRules.js +3 -0
  101. package/lib/structures/rules/ITtscLintTestingLibraryRules.js.map +1 -0
  102. package/lib/structures/rules/ITtscLintTypeScriptRules.d.ts +1132 -0
  103. package/lib/structures/rules/ITtscLintTypeScriptRules.js +3 -0
  104. package/lib/structures/rules/ITtscLintTypeScriptRules.js.map +1 -0
  105. package/lib/structures/rules/ITtscLintUnicornRules.d.ts +997 -0
  106. package/lib/structures/rules/ITtscLintUnicornRules.js +3 -0
  107. package/lib/structures/rules/ITtscLintUnicornRules.js.map +1 -0
  108. package/lib/structures/rules/ITtscLintVitestRules.d.ts +141 -0
  109. package/lib/structures/rules/ITtscLintVitestRules.js +3 -0
  110. package/lib/structures/rules/ITtscLintVitestRules.js.map +1 -0
  111. package/lib/structures/rules/index.d.ts +31 -0
  112. package/lib/structures/rules/index.js +48 -0
  113. package/lib/structures/rules/index.js.map +1 -0
  114. package/linthost/ast_helpers.go +30 -5
  115. package/linthost/config.go +48 -17
  116. package/linthost/config_format.go +9 -9
  117. package/linthost/directives.go +67 -25
  118. package/linthost/dispatch.go +14 -3
  119. package/linthost/engine.go +152 -31
  120. package/linthost/fix.go +2 -2
  121. package/linthost/lsp.go +747 -0
  122. package/linthost/print_dispatch.go +2 -2
  123. package/linthost/print_nodes_function.go +2 -2
  124. package/linthost/print_nodes_object.go +1 -1
  125. package/linthost/rule_names.go +14 -0
  126. package/linthost/rules_arrays.go +2 -2
  127. package/linthost/rules_boundaries.go +532 -0
  128. package/linthost/rules_camelcase.go +133 -0
  129. package/linthost/rules_complexity.go +94 -0
  130. package/linthost/rules_consistent_return.go +130 -0
  131. package/linthost/rules_console.go +1 -1
  132. package/linthost/rules_core_extra.go +739 -0
  133. package/linthost/rules_curly.go +70 -0
  134. package/linthost/rules_cypress.go +608 -0
  135. package/linthost/rules_debugger.go +2 -2
  136. package/linthost/rules_default_case.go +39 -0
  137. package/linthost/rules_default_case_last.go +46 -0
  138. package/linthost/rules_dupes.go +3 -3
  139. package/linthost/rules_empty.go +3 -3
  140. package/linthost/rules_escape.go +44 -24
  141. package/linthost/rules_eval.go +2 -2
  142. package/linthost/rules_finally.go +2 -2
  143. package/linthost/rules_format_jsdoc.go +1 -1
  144. package/linthost/rules_format_print_width.go +9 -9
  145. package/linthost/rules_format_quotes.go +1 -1
  146. package/linthost/rules_format_semi.go +1 -1
  147. package/linthost/rules_format_sort_imports.go +1 -1
  148. package/linthost/rules_format_trailing_comma.go +1 -1
  149. package/linthost/rules_functional.go +967 -0
  150. package/linthost/rules_gap.go +24 -45
  151. package/linthost/rules_grouped_accessor_pairs.go +87 -0
  152. package/linthost/rules_guard_for_in.go +198 -0
  153. package/linthost/rules_id_length.go +77 -0
  154. package/linthost/rules_imports.go +70 -2
  155. package/linthost/rules_init_declarations.go +53 -0
  156. package/linthost/rules_jest.go +618 -0
  157. package/linthost/rules_jsdoc.go +502 -0
  158. package/linthost/rules_jsx_a11y.go +1264 -0
  159. package/linthost/rules_logic.go +12 -12
  160. package/linthost/rules_loops.go +1 -1
  161. package/linthost/rules_max_classes_per_file.go +58 -0
  162. package/linthost/rules_max_depth.go +83 -0
  163. package/linthost/rules_max_lines.go +101 -0
  164. package/linthost/rules_max_lines_per_function.go +57 -0
  165. package/linthost/rules_max_nested_callbacks.go +61 -0
  166. package/linthost/rules_max_params.go +49 -0
  167. package/linthost/rules_max_statements.go +59 -0
  168. package/linthost/rules_misc.go +1 -1
  169. package/linthost/rules_nextjs.go +697 -0
  170. package/linthost/rules_no_else_return.go +75 -0
  171. package/linthost/rules_no_empty_named_blocks.go +91 -0
  172. package/linthost/rules_no_extend_native.go +51 -0
  173. package/linthost/rules_no_import_assign.go +140 -0
  174. package/linthost/rules_no_invalid_this.go +52 -0
  175. package/linthost/rules_no_loop_func.go +85 -0
  176. package/linthost/rules_no_magic_numbers.go +123 -0
  177. package/linthost/rules_no_mixed_operators.go +80 -0
  178. package/linthost/rules_no_param_reassign.go +98 -0
  179. package/linthost/rules_no_redeclare.go +270 -0
  180. package/linthost/rules_no_restricted_imports.go +105 -0
  181. package/linthost/rules_no_restricted_syntax.go +49 -0
  182. package/linthost/rules_no_shadow.go +147 -0
  183. package/linthost/rules_no_unreachable.go +77 -0
  184. package/linthost/rules_no_useless_assignment.go +120 -0
  185. package/linthost/rules_no_useless_constructor.go +245 -0
  186. package/linthost/rules_no_useless_return.go +51 -0
  187. package/linthost/rules_params.go +1 -1
  188. package/linthost/rules_playwright.go +788 -0
  189. package/linthost/rules_prefer_arrow_callback.go +124 -0
  190. package/linthost/rules_prefer_destructuring.go +98 -0
  191. package/linthost/rules_prefer_named_capture_group.go +129 -0
  192. package/linthost/rules_prefer_rest_params.go +94 -0
  193. package/linthost/rules_problems.go +41 -30
  194. package/linthost/rules_promise.go +1128 -73
  195. package/linthost/rules_protos.go +2 -2
  196. package/linthost/rules_react.go +773 -0
  197. package/linthost/rules_react_extras.go +227 -0
  198. package/linthost/rules_react_hooks.go +848 -0
  199. package/linthost/rules_react_perf.go +293 -0
  200. package/linthost/rules_react_refresh.go +583 -0
  201. package/linthost/rules_regexp.go +410 -0
  202. package/linthost/rules_security.go +830 -0
  203. package/linthost/rules_self.go +2 -2
  204. package/linthost/rules_solid.go +1073 -0
  205. package/linthost/rules_sort_imports.go +69 -0
  206. package/linthost/rules_sort_keys.go +134 -0
  207. package/linthost/rules_storybook.go +1176 -0
  208. package/linthost/rules_strings.go +4 -4
  209. package/linthost/rules_suggestions.go +38 -38
  210. package/linthost/rules_tanstack_query.go +844 -0
  211. package/linthost/rules_testing_library.go +1204 -0
  212. package/linthost/rules_throw.go +1 -1
  213. package/linthost/rules_ts.go +19 -19
  214. package/linthost/rules_ts_async.go +399 -0
  215. package/linthost/rules_ts_class_literal_property_style.go +115 -0
  216. package/linthost/rules_ts_consistent_type_exports.go +256 -0
  217. package/linthost/rules_ts_explicit_function_return_type.go +67 -0
  218. package/linthost/rules_ts_extra.go +155 -36
  219. package/linthost/rules_ts_no_base_to_string.go +218 -0
  220. package/linthost/rules_ts_no_confusing_void.go +72 -0
  221. package/linthost/rules_ts_no_deprecated.go +195 -0
  222. package/linthost/rules_ts_no_for_in_array.go +84 -0
  223. package/linthost/rules_ts_no_magic_numbers.go +124 -0
  224. package/linthost/rules_ts_no_meaningless_void_operator.go +84 -0
  225. package/linthost/rules_ts_no_misused_spread.go +104 -0
  226. package/linthost/rules_ts_no_redundant_type_constituents.go +113 -0
  227. package/linthost/rules_ts_no_restricted_types.go +62 -0
  228. package/linthost/rules_ts_no_unnecessary_boolean_literal_compare.go +129 -0
  229. package/linthost/rules_ts_no_unnecessary_condition.go +250 -0
  230. package/linthost/rules_ts_no_unnecessary_qualifier.go +118 -0
  231. package/linthost/rules_ts_no_unnecessary_template_expression.go +178 -0
  232. package/linthost/rules_ts_no_unnecessary_type_arguments.go +234 -0
  233. package/linthost/rules_ts_no_unnecessary_type_assertion.go +157 -0
  234. package/linthost/rules_ts_no_unsafe_argument.go +82 -0
  235. package/linthost/rules_ts_no_unsafe_assignment.go +102 -0
  236. package/linthost/rules_ts_no_unsafe_call.go +82 -0
  237. package/linthost/rules_ts_no_unsafe_enum_comparison.go +235 -0
  238. package/linthost/rules_ts_no_unsafe_member_access.go +58 -0
  239. package/linthost/rules_ts_no_unsafe_return.go +126 -0
  240. package/linthost/rules_ts_no_unsafe_unary_minus.go +81 -0
  241. package/linthost/rules_ts_no_useless_constructor.go +52 -0
  242. package/linthost/rules_ts_non_nullable_type_assertion_style.go +108 -0
  243. package/linthost/rules_ts_parameter_properties.go +38 -0
  244. package/linthost/rules_ts_prefer_find.go +178 -0
  245. package/linthost/rules_ts_prefer_includes.go +255 -0
  246. package/linthost/rules_ts_prefer_nullish_coalescing.go +104 -0
  247. package/linthost/rules_ts_prefer_optional_chain.go +228 -0
  248. package/linthost/rules_ts_prefer_promise_reject_errors.go +176 -0
  249. package/linthost/rules_ts_prefer_readonly.go +73 -0
  250. package/linthost/rules_ts_prefer_reduce_type_parameter.go +116 -0
  251. package/linthost/rules_ts_prefer_regexp_exec.go +122 -0
  252. package/linthost/rules_ts_prefer_return_this_type.go +135 -0
  253. package/linthost/rules_ts_prefer_string_starts_ends_with.go +360 -0
  254. package/linthost/rules_ts_promise_function_async.go +77 -0
  255. package/linthost/rules_ts_related_getter_setter_pairs.go +113 -0
  256. package/linthost/rules_ts_require_array_sort_compare.go +96 -0
  257. package/linthost/rules_ts_restrict_plus_operands.go +127 -0
  258. package/linthost/rules_ts_restrict_template_expressions.go +95 -0
  259. package/linthost/rules_ts_simple.go +387 -0
  260. package/linthost/rules_ts_sort_type_constituents.go +144 -0
  261. package/linthost/rules_ts_strict_boolean_expressions.go +157 -0
  262. package/linthost/rules_ts_switch_exhaustiveness_check.go +147 -0
  263. package/linthost/rules_ts_unbound_method.go +126 -0
  264. package/linthost/rules_tsdoc.go +136 -0
  265. package/linthost/rules_unicorn_better_regex.go +27 -0
  266. package/linthost/rules_unicorn_catch_error_name.go +46 -0
  267. package/linthost/rules_unicorn_consistent_assert.go +47 -0
  268. package/linthost/rules_unicorn_consistent_date_clone.go +54 -0
  269. package/linthost/rules_unicorn_consistent_destructuring.go +25 -0
  270. package/linthost/rules_unicorn_consistent_empty_array_spread.go +62 -0
  271. package/linthost/rules_unicorn_consistent_existence_index_check.go +80 -0
  272. package/linthost/rules_unicorn_consistent_function_scoping.go +25 -0
  273. package/linthost/rules_unicorn_consistent_template_literal_escape.go +25 -0
  274. package/linthost/rules_unicorn_custom_error_definition.go +138 -0
  275. package/linthost/rules_unicorn_empty_brace_spaces.go +73 -0
  276. package/linthost/rules_unicorn_error_message.go +64 -0
  277. package/linthost/rules_unicorn_escape_case.go +51 -0
  278. package/linthost/rules_unicorn_expiring_todo_comments.go +78 -0
  279. package/linthost/rules_unicorn_explicit_length_check.go +88 -0
  280. package/linthost/rules_unicorn_filename_case.go +29 -0
  281. package/linthost/rules_unicorn_import_style.go +28 -0
  282. package/linthost/rules_unicorn_isolated_functions.go +29 -0
  283. package/linthost/rules_unicorn_new_for_builtins.go +87 -0
  284. package/linthost/rules_unicorn_no_abusive_eslint_disable.go +63 -0
  285. package/linthost/rules_unicorn_no_accessor_recursion.go +115 -0
  286. package/linthost/rules_unicorn_no_anonymous_default_export.go +74 -0
  287. package/linthost/rules_unicorn_no_array_callback_reference.go +65 -0
  288. package/linthost/rules_unicorn_no_array_for_each.go +40 -0
  289. package/linthost/rules_unicorn_no_array_method_this_argument.go +61 -0
  290. package/linthost/rules_unicorn_no_array_reduce.go +41 -0
  291. package/linthost/rules_unicorn_no_array_reverse.go +44 -0
  292. package/linthost/rules_unicorn_no_array_sort.go +43 -0
  293. package/linthost/rules_unicorn_no_await_expression_member.go +40 -0
  294. package/linthost/rules_unicorn_no_await_in_promise_methods.go +69 -0
  295. package/linthost/rules_unicorn_no_console_spaces.go +61 -0
  296. package/linthost/rules_unicorn_no_document_cookie.go +41 -0
  297. package/linthost/rules_unicorn_no_empty_file.go +44 -0
  298. package/linthost/rules_unicorn_no_for_loop.go +102 -0
  299. package/linthost/rules_unicorn_no_hex_escape.go +42 -0
  300. package/linthost/rules_unicorn_no_immediate_mutation.go +90 -0
  301. package/linthost/rules_unicorn_no_instanceof_builtins.go +66 -0
  302. package/linthost/rules_unicorn_no_invalid_fetch_options.go +79 -0
  303. package/linthost/rules_unicorn_no_invalid_remove_event_listener.go +51 -0
  304. package/linthost/rules_unicorn_no_keyword_prefix.go +101 -0
  305. package/linthost/rules_unicorn_no_lonely_if.go +44 -0
  306. package/linthost/rules_unicorn_no_magic_array_flat_depth.go +51 -0
  307. package/linthost/rules_unicorn_no_named_default.go +54 -0
  308. package/linthost/rules_unicorn_no_negated_condition.go +85 -0
  309. package/linthost/rules_unicorn_no_negation_in_equality_check.go +50 -0
  310. package/linthost/rules_unicorn_no_nested_ternary.go +43 -0
  311. package/linthost/rules_unicorn_no_new_array.go +30 -0
  312. package/linthost/rules_unicorn_no_new_buffer.go +31 -0
  313. package/linthost/rules_unicorn_no_null.go +24 -0
  314. package/linthost/rules_unicorn_no_object_as_default_parameter.go +48 -0
  315. package/linthost/rules_unicorn_no_process_exit.go +43 -0
  316. package/linthost/rules_unicorn_no_single_promise_in_promise_methods.go +59 -0
  317. package/linthost/rules_unicorn_no_static_only_class.go +56 -0
  318. package/linthost/rules_unicorn_no_thenable.go +74 -0
  319. package/linthost/rules_unicorn_no_this_assignment.go +35 -0
  320. package/linthost/rules_unicorn_no_typeof_undefined.go +58 -0
  321. package/linthost/rules_unicorn_no_unnecessary_array_flat_depth.go +49 -0
  322. package/linthost/rules_unicorn_no_unnecessary_array_splice_count.go +70 -0
  323. package/linthost/rules_unicorn_no_unnecessary_await.go +51 -0
  324. package/linthost/rules_unicorn_no_unnecessary_polyfills.go +32 -0
  325. package/linthost/rules_unicorn_no_unnecessary_slice_end.go +48 -0
  326. package/linthost/rules_unicorn_no_unreadable_array_destructuring.go +115 -0
  327. package/linthost/rules_unicorn_no_unreadable_iife.go +50 -0
  328. package/linthost/rules_unicorn_no_unused_properties.go +30 -0
  329. package/linthost/rules_unicorn_no_useless_collection_argument.go +63 -0
  330. package/linthost/rules_unicorn_no_useless_error_capture_stack_trace.go +46 -0
  331. package/linthost/rules_unicorn_no_useless_fallback_in_spread.go +81 -0
  332. package/linthost/rules_unicorn_no_useless_iterator_to_array.go +72 -0
  333. package/linthost/rules_unicorn_no_useless_length_check.go +144 -0
  334. package/linthost/rules_unicorn_no_useless_promise_resolve_reject.go +81 -0
  335. package/linthost/rules_unicorn_no_useless_spread.go +67 -0
  336. package/linthost/rules_unicorn_no_useless_switch_case.go +55 -0
  337. package/linthost/rules_unicorn_no_useless_undefined.go +55 -0
  338. package/linthost/rules_unicorn_no_zero_fractions.go +52 -0
  339. package/linthost/rules_unicorn_number_literal_case.go +69 -0
  340. package/linthost/rules_unicorn_numeric_separators_style.go +75 -0
  341. package/linthost/rules_unicorn_prefer_add_event_listener.go +66 -0
  342. package/linthost/rules_unicorn_prefer_array_find.go +51 -0
  343. package/linthost/rules_unicorn_prefer_array_flat.go +52 -0
  344. package/linthost/rules_unicorn_prefer_array_flat_map.go +63 -0
  345. package/linthost/rules_unicorn_prefer_array_index_of.go +147 -0
  346. package/linthost/rules_unicorn_prefer_array_some.go +67 -0
  347. package/linthost/rules_unicorn_prefer_at.go +77 -0
  348. package/linthost/rules_unicorn_prefer_bigint_literals.go +77 -0
  349. package/linthost/rules_unicorn_prefer_blob_reading_methods.go +44 -0
  350. package/linthost/rules_unicorn_prefer_class_fields.go +93 -0
  351. package/linthost/rules_unicorn_prefer_classlist_toggle.go +120 -0
  352. package/linthost/rules_unicorn_prefer_code_point.go +49 -0
  353. package/linthost/rules_unicorn_prefer_date_now.go +78 -0
  354. package/linthost/rules_unicorn_prefer_default_parameters.go +144 -0
  355. package/linthost/rules_unicorn_prefer_dom_node_append.go +40 -0
  356. package/linthost/rules_unicorn_prefer_dom_node_dataset.go +55 -0
  357. package/linthost/rules_unicorn_prefer_dom_node_remove.go +41 -0
  358. package/linthost/rules_unicorn_prefer_dom_node_text_content.go +37 -0
  359. package/linthost/rules_unicorn_prefer_event_target.go +36 -0
  360. package/linthost/rules_unicorn_prefer_export_from.go +129 -0
  361. package/linthost/rules_unicorn_prefer_global_this.go +127 -0
  362. package/linthost/rules_unicorn_prefer_import_meta_properties.go +66 -0
  363. package/linthost/rules_unicorn_prefer_includes.go +149 -0
  364. package/linthost/rules_unicorn_prefer_json_parse_buffer.go +65 -0
  365. package/linthost/rules_unicorn_prefer_keyboard_event_key.go +38 -0
  366. package/linthost/rules_unicorn_prefer_logical_operator_over_ternary.go +48 -0
  367. package/linthost/rules_unicorn_prefer_math_min_max.go +60 -0
  368. package/linthost/rules_unicorn_prefer_math_trunc.go +62 -0
  369. package/linthost/rules_unicorn_prefer_modern_dom_apis.go +47 -0
  370. package/linthost/rules_unicorn_prefer_modern_math_apis.go +70 -0
  371. package/linthost/rules_unicorn_prefer_module.go +50 -0
  372. package/linthost/rules_unicorn_prefer_native_coercion_functions.go +114 -0
  373. package/linthost/rules_unicorn_prefer_negative_index.go +74 -0
  374. package/linthost/rules_unicorn_prefer_node_protocol.go +122 -0
  375. package/linthost/rules_unicorn_prefer_number_properties.go +88 -0
  376. package/linthost/rules_unicorn_prefer_object_from_entries.go +55 -0
  377. package/linthost/rules_unicorn_prefer_optional_catch_binding.go +62 -0
  378. package/linthost/rules_unicorn_prefer_prototype_methods.go +54 -0
  379. package/linthost/rules_unicorn_prefer_query_selector.go +56 -0
  380. package/linthost/rules_unicorn_prefer_reflect_apply.go +36 -0
  381. package/linthost/rules_unicorn_prefer_regexp_test_rule.go +80 -0
  382. package/linthost/rules_unicorn_prefer_response_static_json.go +53 -0
  383. package/linthost/rules_unicorn_prefer_set_has.go +42 -0
  384. package/linthost/rules_unicorn_prefer_set_size.go +48 -0
  385. package/linthost/rules_unicorn_prefer_simple_condition_first.go +34 -0
  386. package/linthost/rules_unicorn_prefer_single_call.go +96 -0
  387. package/linthost/rules_unicorn_prefer_spread.go +51 -0
  388. package/linthost/rules_unicorn_prefer_string_raw.go +43 -0
  389. package/linthost/rules_unicorn_prefer_string_replace_all.go +95 -0
  390. package/linthost/rules_unicorn_prefer_string_slice.go +43 -0
  391. package/linthost/rules_unicorn_prefer_string_starts_ends_with.go +148 -0
  392. package/linthost/rules_unicorn_prefer_string_trim_start_end.go +48 -0
  393. package/linthost/rules_unicorn_prefer_structured_clone.go +71 -0
  394. package/linthost/rules_unicorn_prefer_switch.go +103 -0
  395. package/linthost/rules_unicorn_prefer_ternary.go +71 -0
  396. package/linthost/rules_unicorn_prefer_top_level_await.go +72 -0
  397. package/linthost/rules_unicorn_prefer_type_error.go +127 -0
  398. package/linthost/rules_unicorn_prevent_abbreviations.go +127 -0
  399. package/linthost/rules_unicorn_relative_url_style.go +49 -0
  400. package/linthost/rules_unicorn_require_array_join_separator.go +45 -0
  401. package/linthost/rules_unicorn_require_module_attributes.go +54 -0
  402. package/linthost/rules_unicorn_require_module_specifiers.go +55 -0
  403. package/linthost/rules_unicorn_require_number_to_fixed_digits_argument.go +43 -0
  404. package/linthost/rules_unicorn_require_post_message_target_origin.go +44 -0
  405. package/linthost/rules_unicorn_string_content.go +27 -0
  406. package/linthost/rules_unicorn_switch_case_braces.go +42 -0
  407. package/linthost/rules_unicorn_switch_case_break_position.go +31 -0
  408. package/linthost/rules_unicorn_template_indent.go +28 -0
  409. package/linthost/rules_unicorn_text_encoding_identifier_case.go +72 -0
  410. package/linthost/rules_unicorn_throw_new_error.go +61 -0
  411. package/linthost/rules_var.go +4 -4
  412. package/linthost/rules_vitest.go +568 -0
  413. package/package.json +3 -3
  414. package/plugin/main.go +49 -3
  415. package/rule/astutil/astutil.go +10 -3
  416. package/rule/rule.go +12 -10
  417. package/src/defaultFormat.ts +11 -8
  418. package/src/index.ts +40 -16
  419. package/src/structures/ITtscLintConfig.ts +12 -6
  420. package/src/structures/{ITtscLintFormatConfig.ts → ITtscLintFormat.ts} +2 -2
  421. package/src/structures/TtscLintRuleSetting.ts +55 -0
  422. package/src/structures/index.ts +3 -4
  423. package/src/structures/rules/ITtscLintBoundariesRuleOptions.ts +128 -0
  424. package/src/structures/rules/ITtscLintBoundariesRules.ts +95 -0
  425. package/src/structures/rules/ITtscLintContributorRules.ts +21 -0
  426. package/src/structures/rules/ITtscLintCoreRules.ts +1406 -0
  427. package/src/structures/rules/ITtscLintCypressRuleOptions.ts +18 -0
  428. package/src/structures/rules/ITtscLintCypressRules.ts +145 -0
  429. package/src/structures/rules/ITtscLintFunctionalRuleOptions.ts +213 -0
  430. package/src/structures/rules/ITtscLintFunctionalRules.ts +202 -0
  431. package/src/structures/rules/ITtscLintJestRules.ts +220 -0
  432. package/src/structures/rules/ITtscLintJsdocRules.ts +153 -0
  433. package/src/structures/rules/ITtscLintJsxA11yRules.ts +339 -0
  434. package/src/structures/rules/ITtscLintNextjsRules.ts +206 -0
  435. package/src/structures/rules/ITtscLintPlaywrightRules.ts +361 -0
  436. package/src/structures/rules/ITtscLintPromiseRules.ts +205 -0
  437. package/src/structures/rules/ITtscLintReactPerfRuleOptions.ts +19 -0
  438. package/src/structures/rules/ITtscLintReactPerfRules.ts +55 -0
  439. package/src/structures/rules/ITtscLintReactRuleOptions.ts +43 -0
  440. package/src/structures/rules/ITtscLintReactRules.ts +321 -0
  441. package/src/structures/rules/ITtscLintRegexpRules.ts +212 -0
  442. package/src/structures/rules/ITtscLintRuleOptionsMap.ts +89 -0
  443. package/src/structures/rules/ITtscLintRules.ts +77 -0
  444. package/src/structures/rules/ITtscLintSecurityRules.ts +162 -0
  445. package/src/structures/rules/ITtscLintSolidRules.ts +202 -0
  446. package/src/structures/rules/ITtscLintStorybookRuleOptions.ts +23 -0
  447. package/src/structures/rules/ITtscLintStorybookRules.ts +193 -0
  448. package/src/structures/rules/ITtscLintTanstackQueryRules.ts +102 -0
  449. package/src/structures/rules/ITtscLintTestingLibraryRuleOptions.ts +24 -0
  450. package/src/structures/rules/ITtscLintTestingLibraryRules.ts +342 -0
  451. package/src/structures/rules/ITtscLintTypeScriptRules.ts +1230 -0
  452. package/src/structures/rules/ITtscLintUnicornRules.ts +1143 -0
  453. package/src/structures/rules/ITtscLintVitestRules.ts +154 -0
  454. package/src/structures/rules/index.ts +31 -0
  455. package/lib/structures/ITtscLintFormatConfig.js.map +0 -1
  456. package/lib/structures/TtscLintRule.d.ts +0 -17
  457. package/lib/structures/TtscLintRule.js.map +0 -1
  458. package/lib/structures/TtscLintRuleMap.d.ts +0 -46
  459. package/lib/structures/TtscLintRuleMap.js.map +0 -1
  460. package/lib/structures/TtscLintRuleOptions.d.ts +0 -137
  461. package/lib/structures/TtscLintRuleOptions.js.map +0 -1
  462. package/src/structures/TtscLintRule.ts +0 -160
  463. package/src/structures/TtscLintRuleMap.ts +0 -55
  464. package/src/structures/TtscLintRuleOptions.ts +0 -151
@@ -0,0 +1,1257 @@
1
+ import type { TtscLintRuleSetting } from "../TtscLintRuleSetting";
2
+ /**
3
+ * Generic ESLint-compatible rules that apply to both JavaScript and
4
+ * TypeScript source.
5
+ *
6
+ * Every rule listed here corresponds 1-to-1 with an ESLint core rule of the
7
+ * same kebab-case id. TypeScript-only rules and `@typescript-eslint`
8
+ * extension rules do **not** live here — they belong to
9
+ * {@link ITtscLintTypeScriptRules}.
10
+ *
11
+ * Keeping the core family namespace-free means projects migrating from
12
+ * ESLint can paste their rule severities into a `ttsc.lint.config.ts` file
13
+ * without renaming anything.
14
+ *
15
+ * The fix availability noted in each rule's JSDoc applies when `ttsc fix`
16
+ * or the LSP code action is invoked; a rule marked *Autofixable* may still
17
+ * produce diagnostics that require human review for edge cases.
18
+ *
19
+ * @reference https://eslint.org/docs/latest/rules/
20
+ */
21
+ export interface ITtscLintCoreRules {
22
+ /**
23
+ * Require block statements for every `if`, `else`, `while`, `for`, and `do` body — reject the single-statement shorthand.
24
+ *
25
+ * @reference https://eslint.org/docs/latest/rules/curly
26
+ */
27
+ "curly"?: TtscLintRuleSetting;
28
+ /**
29
+ * Require `switch` statements to include a `default` clause.
30
+ *
31
+ * A switch without `default` silently drops every discriminant value
32
+ * that no `case` label matched. The rule forces the catch-all branch
33
+ * to be written out so unhandled cases become an intentional decision
34
+ * instead of a hidden fall-through.
35
+ *
36
+ * @reference https://eslint.org/docs/latest/rules/default-case
37
+ */
38
+ "default-case"?: TtscLintRuleSetting;
39
+ /**
40
+ * Require the `default` clause of a `switch` statement to appear
41
+ * after every explicit `case` label.
42
+ *
43
+ * Placing `default` ahead of a `case` reverses the visual order of
44
+ * the labels and changes the fall-through path — running `default`
45
+ * and then falling into the next `case` is almost always a
46
+ * misordering rather than intent.
47
+ *
48
+ * @reference https://eslint.org/docs/latest/rules/default-case-last
49
+ */
50
+ "default-case-last"?: TtscLintRuleSetting;
51
+ /**
52
+ * Reject identifier declarations that aren't camelCase or PascalCase — snake_case bindings are flagged.
53
+ *
54
+ * @reference https://eslint.org/docs/latest/rules/camelcase
55
+ */
56
+ "camelcase"?: TtscLintRuleSetting;
57
+ /**
58
+ * Reject function bodies whose cyclomatic complexity exceeds twenty (default ESLint threshold).
59
+ *
60
+ * @reference https://eslint.org/docs/latest/rules/complexity
61
+ */
62
+ "complexity"?: TtscLintRuleSetting;
63
+ /**
64
+ * Reject functions where some `return` statements return a value and
65
+ * others (explicit bare `return;` or implicit fall-through) do not.
66
+ *
67
+ * @reference https://eslint.org/docs/latest/rules/consistent-return
68
+ */
69
+ "consistent-return"?: TtscLintRuleSetting;
70
+ /**
71
+ * Reject `(req, opt = 1, req2)` and similar parameter lists where a
72
+ * required parameter follows an optional or default-valued one.
73
+ *
74
+ * The call site cannot omit the trailing required parameter, so the
75
+ * optional becomes positionally required too — almost always an
76
+ * accidental ordering.
77
+ *
78
+ * @reference https://eslint.org/docs/latest/rules/default-param-last
79
+ */
80
+ "default-param-last"?: TtscLintRuleSetting;
81
+ /**
82
+ * Prefer dot access (`obj.value`) over bracket access (`obj["value"]`)
83
+ * when the string key is a valid JavaScript identifier.
84
+ *
85
+ * Bracket access remains accepted for reserved words, dynamic keys, or
86
+ * keys containing characters that cannot appear in an identifier.
87
+ *
88
+ * @reference https://eslint.org/docs/latest/rules/dot-notation
89
+ */
90
+ "dot-notation"?: TtscLintRuleSetting;
91
+ /**
92
+ * Require strict equality operators `===` / `!==` over `==` / `!=`.
93
+ *
94
+ * Loose equality performs implicit type coercion that frequently hides
95
+ * bugs.
96
+ *
97
+ * @reference https://eslint.org/docs/latest/rules/eqeqeq
98
+ */
99
+ "eqeqeq"?: TtscLintRuleSetting;
100
+ /**
101
+ * Reject `for` statements whose update clause moves the counter away
102
+ * from the termination condition, such as `for (let i = 0; i < 10;
103
+ * i--)`. Such loops either never run or never terminate.
104
+ *
105
+ * @reference https://eslint.org/docs/latest/rules/for-direction
106
+ */
107
+ "for-direction"?: TtscLintRuleSetting;
108
+ /**
109
+ * Require a `get` accessor's body to return a value on every
110
+ * reachable exit. A getter that falls through returns `undefined`
111
+ * to the caller, which is almost never the intent and turns into a
112
+ * silent bug that only surfaces when the property is finally read.
113
+ *
114
+ * @reference https://eslint.org/docs/latest/rules/getter-return
115
+ */
116
+ "getter-return"?: TtscLintRuleSetting;
117
+ /**
118
+ * Require the `get` and `set` accessors of a single property to be
119
+ * declared adjacent in the class body.
120
+ *
121
+ * When the read and write halves of a property are split apart by
122
+ * unrelated members, a reader scanning the class has to chase the
123
+ * pair across the body — and patches to one half are easy to make
124
+ * without noticing the other.
125
+ *
126
+ * @reference https://eslint.org/docs/latest/rules/grouped-accessor-pairs
127
+ */
128
+ "grouped-accessor-pairs"?: TtscLintRuleSetting;
129
+ /**
130
+ * Require the body of every `for (key in obj)` loop to begin with a
131
+ * guard against inherited keys: `Object.hasOwn(obj, key)` or the
132
+ * older `Object.prototype.hasOwnProperty.call(obj, key)`. The
133
+ * inverted-guard early-skip shape `if (!Object.hasOwn(...))
134
+ * continue;` is also accepted.
135
+ *
136
+ * Without the guard the loop processes every enumerable name on the
137
+ * prototype chain — including monkey-patches someone else attached
138
+ * to `Object.prototype` — so an unguarded body silently leaks work
139
+ * onto inherited entries.
140
+ *
141
+ * @reference https://eslint.org/docs/latest/rules/guard-for-in
142
+ */
143
+ "guard-for-in"?: TtscLintRuleSetting;
144
+ /**
145
+ * Reject identifier names shorter than two characters.
146
+ *
147
+ * @reference https://eslint.org/docs/latest/rules/id-length
148
+ */
149
+ "id-length"?: TtscLintRuleSetting;
150
+ /**
151
+ * Require every `var` / `let` declaration to be initialized at its declaration site.
152
+ *
153
+ * @reference https://eslint.org/docs/latest/rules/init-declarations
154
+ */
155
+ "init-declarations"?: TtscLintRuleSetting;
156
+ /**
157
+ * Reject a source file that declares more than one class.
158
+ *
159
+ * @reference https://eslint.org/docs/latest/rules/max-classes-per-file
160
+ */
161
+ "max-classes-per-file"?: TtscLintRuleSetting;
162
+ /**
163
+ * Reject block-statement nesting deeper than four levels inside a function.
164
+ *
165
+ * @reference https://eslint.org/docs/latest/rules/max-depth
166
+ */
167
+ "max-depth"?: TtscLintRuleSetting;
168
+ /**
169
+ * Reject a source file whose total line count exceeds three hundred.
170
+ *
171
+ * @reference https://eslint.org/docs/latest/rules/max-lines
172
+ */
173
+ "max-lines"?: TtscLintRuleSetting;
174
+ /**
175
+ * Reject a function whose body spans more than fifty lines.
176
+ *
177
+ * @reference https://eslint.org/docs/latest/rules/max-lines-per-function
178
+ */
179
+ "max-lines-per-function"?: TtscLintRuleSetting;
180
+ /**
181
+ * Reject callback nesting deeper than ten inside a single function.
182
+ *
183
+ * @reference https://eslint.org/docs/latest/rules/max-nested-callbacks
184
+ */
185
+ "max-nested-callbacks"?: TtscLintRuleSetting;
186
+ /**
187
+ * Reject function declarations whose parameter list grows beyond
188
+ * three. Long parameter lists are hard to read at the call site
189
+ * because positional arguments lose their names; folding them into
190
+ * an options object recovers the names and lets callers pass a
191
+ * subset.
192
+ *
193
+ * Every function-like declaration is checked: function declarations,
194
+ * function expressions, arrow functions, methods, accessors, and
195
+ * constructors. The threshold is fixed at three to match the ESLint
196
+ * default; rule options are deferred.
197
+ *
198
+ * @reference https://eslint.org/docs/latest/rules/max-params
199
+ */
200
+ "max-params"?: TtscLintRuleSetting;
201
+ /**
202
+ * Reject function bodies whose statement count exceeds ten.
203
+ *
204
+ * @reference https://eslint.org/docs/latest/rules/max-statements
205
+ */
206
+ "max-statements"?: TtscLintRuleSetting;
207
+ /**
208
+ * Reject calls to `alert`, `confirm`, and `prompt`.
209
+ *
210
+ * These browser dialogs block the main thread and are almost always
211
+ * debugging leftovers or placeholders for a proper UI component.
212
+ *
213
+ * @reference https://eslint.org/docs/latest/rules/no-alert
214
+ */
215
+ "no-alert"?: TtscLintRuleSetting;
216
+ /**
217
+ * Reject `Array(...)` and `new Array(...)` constructor calls in favor
218
+ * of array literals.
219
+ *
220
+ * `Array(n)` and `[n]` behave differently for a single numeric
221
+ * argument, and the array literal is uniformly clearer.
222
+ *
223
+ * @reference https://eslint.org/docs/latest/rules/no-array-constructor
224
+ */
225
+ "no-array-constructor"?: TtscLintRuleSetting;
226
+ /**
227
+ * Reject `new Promise(async (resolve, reject) => { ... })`.
228
+ *
229
+ * Promises thrown asynchronously inside the executor are dropped
230
+ * silently because the constructor has already returned the outer
231
+ * Promise. Use a regular function and call `reject` explicitly.
232
+ *
233
+ * @reference https://eslint.org/docs/latest/rules/no-async-promise-executor
234
+ */
235
+ "no-async-promise-executor"?: TtscLintRuleSetting;
236
+ /**
237
+ * Reject `await` expressions evaluated inside a loop body. The loop
238
+ * runs strictly serially because each iteration blocks on the
239
+ * previous one's microtask hop; when the operations are independent
240
+ * the equivalent `Promise.all([…])` is dramatically faster. The rule
241
+ * intentionally exempts `for await … of` because the awaitable
242
+ * iterator is the loop's whole reason for existing.
243
+ *
244
+ * @reference https://eslint.org/docs/latest/rules/no-await-in-loop
245
+ */
246
+ "no-await-in-loop"?: TtscLintRuleSetting;
247
+ /**
248
+ * Reject bitwise operators (`&`, `|`, `^`, `~`, `<<`, `>>`, `>>>`).
249
+ *
250
+ * Bitwise operators are almost always typos for the logical operators
251
+ * (`&&`, `||`); enable when the codebase has no legitimate
252
+ * bit-twiddling.
253
+ *
254
+ * @reference https://eslint.org/docs/latest/rules/no-bitwise
255
+ */
256
+ "no-bitwise"?: TtscLintRuleSetting;
257
+ /**
258
+ * Reject `arguments.caller` and `arguments.callee`, both deprecated
259
+ * properties forbidden in strict mode.
260
+ *
261
+ * They defeat engine optimizations and break under ES modules, where
262
+ * strict mode is implicit.
263
+ *
264
+ * @reference https://eslint.org/docs/latest/rules/no-caller
265
+ */
266
+ "no-caller"?: TtscLintRuleSetting;
267
+ /**
268
+ * Reject lexical declarations (`let`, `const`, `class`, `function`)
269
+ * inside `case` or `default` clauses without their own block, since
270
+ * the declaration shares the whole `switch` scope and leaks into
271
+ * sibling clauses.
272
+ *
273
+ * Wrap the case body in `{ ... }` to introduce a fresh block.
274
+ *
275
+ * @reference https://eslint.org/docs/latest/rules/no-case-declarations
276
+ */
277
+ "no-case-declarations"?: TtscLintRuleSetting;
278
+ /**
279
+ * Reject reassigning a class binding (`class C {}; C = ...`).
280
+ *
281
+ * The declaration name is effectively final; overwriting it silently
282
+ * leaves other call sites pointing at the original class.
283
+ *
284
+ * @reference https://eslint.org/docs/latest/rules/no-class-assign
285
+ */
286
+ "no-class-assign"?: TtscLintRuleSetting;
287
+ /**
288
+ * Reject comparisons against `-0` (`x === -0`, `x < -0`, etc.).
289
+ *
290
+ * `===` treats `+0` and `-0` as equal, so the comparison never
291
+ * distinguishes them; use `Object.is(x, -0)` when the sign of zero
292
+ * actually matters.
293
+ *
294
+ * @reference https://eslint.org/docs/latest/rules/no-compare-neg-zero
295
+ */
296
+ "no-compare-neg-zero"?: TtscLintRuleSetting;
297
+ /**
298
+ * Reject assignment expressions inside conditions, such as `if (x =
299
+ * y)` — almost always a typo for `==` / `===`.
300
+ *
301
+ * @reference https://eslint.org/docs/latest/rules/no-cond-assign
302
+ */
303
+ "no-cond-assign"?: TtscLintRuleSetting;
304
+ /**
305
+ * Reject calls to `console.*`.
306
+ *
307
+ * Typically configured as `"warning"` so leftover logging stays visible
308
+ * without breaking the build.
309
+ *
310
+ * @reference https://eslint.org/docs/latest/rules/no-console
311
+ */
312
+ "no-console"?: TtscLintRuleSetting;
313
+ /**
314
+ * Reject conditions whose value can be determined statically, such
315
+ * as `while (true)` or `if (false)`, in `if`, `while`, `do/while`,
316
+ * `for`, and ternary expressions.
317
+ *
318
+ * The default `checkLoops` configuration still permits intentional
319
+ * infinite loops in a few forms; see upstream for the matrix.
320
+ *
321
+ * @reference https://eslint.org/docs/latest/rules/no-constant-condition
322
+ */
323
+ "no-constant-condition"?: TtscLintRuleSetting;
324
+ /**
325
+ * Reject `continue` statements.
326
+ *
327
+ * Stylistic policy preferring early returns or restructured loops over
328
+ * `continue`.
329
+ *
330
+ * @reference https://eslint.org/docs/latest/rules/no-continue
331
+ */
332
+ "no-continue"?: TtscLintRuleSetting;
333
+ /**
334
+ * Reject `return X;` (with a value) inside a class constructor. The
335
+ * returned value is ignored when the constructor is invoked with
336
+ * `new` unless it happens to be an object; relying on that behavior
337
+ * is always a misunderstanding of the constructor protocol.
338
+ *
339
+ * @reference https://eslint.org/docs/latest/rules/no-constructor-return
340
+ */
341
+ "no-constructor-return"?: TtscLintRuleSetting;
342
+ /**
343
+ * Reject ASCII control characters (`\x00`–`\x1F`) inside regular
344
+ * expression literals and `RegExp` strings.
345
+ *
346
+ * They render invisibly in source and almost always indicate an
347
+ * accidental paste or a missed `\t` / `\n` escape.
348
+ *
349
+ * @reference https://eslint.org/docs/latest/rules/no-control-regex
350
+ */
351
+ "no-control-regex"?: TtscLintRuleSetting;
352
+ /**
353
+ * Reject `debugger` statements.
354
+ *
355
+ * Typically configured as `"error"` so accidental debugger leftovers
356
+ * fail CI.
357
+ *
358
+ * @reference https://eslint.org/docs/latest/rules/no-debugger
359
+ */
360
+ "no-debugger"?: TtscLintRuleSetting;
361
+ /**
362
+ * Reject `delete` applied to plain variable bindings (`delete x`).
363
+ *
364
+ * The operation is forbidden in strict mode (and therefore in ES
365
+ * modules) and never has the intended effect on `let` / `const` /
366
+ * `var` declarations.
367
+ *
368
+ * @reference https://eslint.org/docs/latest/rules/no-delete-var
369
+ */
370
+ "no-delete-var"?: TtscLintRuleSetting;
371
+ /**
372
+ * Reject `function f(a, a)` and similar parameter lists that declare
373
+ * the same name twice.
374
+ *
375
+ * The function cannot bind both arguments and fails in strict mode.
376
+ *
377
+ * @reference https://eslint.org/docs/latest/rules/no-dupe-args
378
+ */
379
+ "no-dupe-args"?: TtscLintRuleSetting;
380
+ /**
381
+ * Reject two declarations of the same member on a single class. The
382
+ * later declaration silently overwrites the earlier one at runtime;
383
+ * the syntax permits it but the result is never what the author
384
+ * intended. A getter and a setter for the same property coexist; an
385
+ * instance member and a static member with the same name coexist.
386
+ *
387
+ * @reference https://eslint.org/docs/latest/rules/no-dupe-class-members
388
+ */
389
+ "no-dupe-class-members"?: TtscLintRuleSetting;
390
+ /**
391
+ * Reject `if (a) {} else if (a) {}` — the second branch is
392
+ * unreachable because the first condition already handled it.
393
+ *
394
+ * @reference https://eslint.org/docs/latest/rules/no-dupe-else-if
395
+ */
396
+ "no-dupe-else-if"?: TtscLintRuleSetting;
397
+ /**
398
+ * Reject `{ a: 1, a: 2 }` — duplicate property keys in an object
399
+ * literal silently overwrite earlier values.
400
+ *
401
+ * @reference https://eslint.org/docs/latest/rules/no-dupe-keys
402
+ */
403
+ "no-dupe-keys"?: TtscLintRuleSetting;
404
+ /**
405
+ * Reject the same `case` label appearing twice in a `switch` —
406
+ * later duplicates are unreachable.
407
+ *
408
+ * @reference https://eslint.org/docs/latest/rules/no-duplicate-case
409
+ */
410
+ "no-duplicate-case"?: TtscLintRuleSetting;
411
+ /**
412
+ * Reject two import declarations that resolve to the same module
413
+ * specifier. The runtime sees one module load either way; the
414
+ * duplicated declaration is purely noise at the head of the file
415
+ * and obscures the dependency graph.
416
+ *
417
+ * @reference https://eslint.org/docs/latest/rules/no-duplicate-imports
418
+ */
419
+ "no-duplicate-imports"?: TtscLintRuleSetting;
420
+ /**
421
+ * Reject an `else` block whose preceding `if` branch already
422
+ * terminates control flow with `return`, `throw`, `break`, or
423
+ * `continue` — flatten the body into the surrounding scope.
424
+ *
425
+ * @reference https://eslint.org/docs/latest/rules/no-else-return
426
+ */
427
+ "no-else-return"?: TtscLintRuleSetting;
428
+ /**
429
+ * Reject empty blocks (`if (x) {}`, `while (x) {}`, `try {} catch
430
+ * (e) {}` etc.) that almost always indicate forgotten code.
431
+ *
432
+ * @reference https://eslint.org/docs/latest/rules/no-empty
433
+ */
434
+ "no-empty"?: TtscLintRuleSetting;
435
+ /**
436
+ * Reject empty regex character classes (`[]`).
437
+ *
438
+ * An empty class never matches anything, so the entire pattern can
439
+ * never succeed; the negated form `[^]` (matches any character) is
440
+ * allowed.
441
+ *
442
+ * @reference https://eslint.org/docs/latest/rules/no-empty-character-class
443
+ */
444
+ "no-empty-character-class"?: TtscLintRuleSetting;
445
+ /**
446
+ * Reject empty function and method bodies (`function f() {}`, `()
447
+ * => {}`).
448
+ *
449
+ * Use `() => undefined` or a leading TODO comment when the empty
450
+ * body is intentional.
451
+ *
452
+ * @reference https://eslint.org/docs/latest/rules/no-empty-function
453
+ */
454
+ "no-empty-function"?: TtscLintRuleSetting;
455
+ /**
456
+ * Reject empty named import or export clauses — `import {} from "x"`,
457
+ * `import name, {} from "x"`, and `export {}` — which bind nothing.
458
+ *
459
+ * The empty-only import shape leaves just the side-effect load and is
460
+ * better written as `import "x"`; the default-plus-empty form should
461
+ * drop the empty clause; and a bare `export {}` either restates
462
+ * module-ness redundantly or marks an otherwise non-module file in
463
+ * a way that has cleaner alternatives. The stricter sibling rule
464
+ * `typescript/no-useless-empty-export` fires only when another
465
+ * module-syntax statement is already present.
466
+ *
467
+ * @reference https://eslint.org/docs/latest/rules/no-empty-named-blocks
468
+ */
469
+ "no-empty-named-blocks"?: TtscLintRuleSetting;
470
+ /**
471
+ * Reject empty destructuring patterns (`const {} = obj`, `function
472
+ * f([]) {}`), which bind nothing and are usually mid-edit typos.
473
+ *
474
+ * @reference https://eslint.org/docs/latest/rules/no-empty-pattern
475
+ */
476
+ "no-empty-pattern"?: TtscLintRuleSetting;
477
+ /**
478
+ * Reject empty `static {}` class initialization blocks.
479
+ *
480
+ * @reference https://eslint.org/docs/latest/rules/no-empty-static-block
481
+ */
482
+ "no-empty-static-block"?: TtscLintRuleSetting;
483
+ /**
484
+ * Reject loose null comparisons (`x == null`).
485
+ *
486
+ * Use `x === null` or the explicit `x === null || x === undefined`.
487
+ *
488
+ * Pairs with `eqeqeq` but kept separate so the loose null shortcut can
489
+ * be allowed under `"smart"`-style `eqeqeq` exceptions.
490
+ *
491
+ * @reference https://eslint.org/docs/latest/rules/no-eq-null
492
+ */
493
+ "no-eq-null"?: TtscLintRuleSetting;
494
+ /**
495
+ * Reject `eval(...)` and indirect `eval` calls — almost always a
496
+ * security or correctness bug.
497
+ *
498
+ * @reference https://eslint.org/docs/latest/rules/no-eval
499
+ */
500
+ "no-eval"?: TtscLintRuleSetting;
501
+ /**
502
+ * Reject reassigning the parameter of a `catch` clause (`catch (e) {
503
+ * e = ... }`), which loses the original error reference.
504
+ *
505
+ * @reference https://eslint.org/docs/latest/rules/no-ex-assign
506
+ */
507
+ "no-ex-assign"?: TtscLintRuleSetting;
508
+ /**
509
+ * Reject assignments to a built-in prototype such as
510
+ * `Array.prototype.foo = bar`. Only `<Builtin>.prototype.<key> = …`
511
+ * is flagged; assigning to `Object.foo = …` (a static property) is
512
+ * left alone.
513
+ *
514
+ * @reference https://eslint.org/docs/latest/rules/no-extend-native
515
+ */
516
+ "no-extend-native"?: TtscLintRuleSetting;
517
+ /**
518
+ * Reject unnecessary `Function.prototype.bind()` calls — for
519
+ * example, binding without arguments or binding an arrow function
520
+ * (which ignores `this`).
521
+ *
522
+ * @reference https://eslint.org/docs/latest/rules/no-extra-bind
523
+ */
524
+ "no-extra-bind"?: TtscLintRuleSetting;
525
+ /**
526
+ * Reject redundant boolean casts such as `!!Boolean(x)`, `if
527
+ * (Boolean(x))`, or `Boolean(!!x)`.
528
+ *
529
+ * @reference https://eslint.org/docs/latest/rules/no-extra-boolean-cast
530
+ */
531
+ "no-extra-boolean-cast"?: TtscLintRuleSetting;
532
+ /**
533
+ * Reject `switch` case fall-through unless preceded by an explicit
534
+ * `// falls through` comment.
535
+ *
536
+ * @reference https://eslint.org/docs/latest/rules/no-fallthrough
537
+ */
538
+ "no-fallthrough"?: TtscLintRuleSetting;
539
+ /**
540
+ * Reject reassignment of function declarations (`function f() {}; f
541
+ * = 0;`).
542
+ *
543
+ * The hoisted binding looks final to most readers; overwriting it
544
+ * makes the original implementation unreachable from other references.
545
+ *
546
+ * @reference https://eslint.org/docs/latest/rules/no-func-assign
547
+ */
548
+ "no-func-assign"?: TtscLintRuleSetting;
549
+ /**
550
+ * Reject common implicit-coercion idioms (`!!x`, `+x`, `"" + x`) in
551
+ * favor of the explicit `Boolean(x)` / `Number(x)` / `String(x)`
552
+ * conversions. The explicit forms are more readable and avoid
553
+ * surprise around primitive edge cases.
554
+ *
555
+ * @reference https://eslint.org/docs/latest/rules/no-implicit-coercion
556
+ */
557
+ "no-implicit-coercion"?: TtscLintRuleSetting;
558
+ /**
559
+ * Reject writes to a binding introduced by an `import` declaration —
560
+ * assignment (`x = …`), compound assignment, or increment/decrement
561
+ * of an imported name, plus property mutations of a namespace import
562
+ * (`ns.foo = …`). Imported bindings are read-only at runtime; mutating
563
+ * them either throws under strict mode or silently desynchronises the
564
+ * module's view of its own exports.
565
+ *
566
+ * @reference https://eslint.org/docs/latest/rules/no-import-assign
567
+ */
568
+ "no-import-assign"?: TtscLintRuleSetting;
569
+ /**
570
+ * Reject `function` and `var` declarations nested in non-function
571
+ * blocks (loops, `if`, etc.) — they hoist in surprising ways.
572
+ *
573
+ * @reference https://eslint.org/docs/latest/rules/no-inner-declarations
574
+ */
575
+ "no-inner-declarations"?: TtscLintRuleSetting;
576
+ /**
577
+ * Reject `this` references outside any function-like, class method, or class-static-block context.
578
+ *
579
+ * @reference https://eslint.org/docs/latest/rules/no-invalid-this
580
+ */
581
+ "no-invalid-this"?: TtscLintRuleSetting;
582
+ /**
583
+ * Reject irregular whitespace characters (zero-width space,
584
+ * non-breaking space, etc.) in source — typically copy-paste artifacts
585
+ * from rich-text editors.
586
+ *
587
+ * @reference https://eslint.org/docs/latest/rules/no-irregular-whitespace
588
+ */
589
+ "no-irregular-whitespace"?: TtscLintRuleSetting;
590
+ /**
591
+ * Reject the legacy `__iterator__` property — a SpiderMonkey-only
592
+ * extension predating ES2015 iterators.
593
+ *
594
+ * Use `Symbol.iterator` or a generator.
595
+ *
596
+ * @reference https://eslint.org/docs/latest/rules/no-iterator
597
+ */
598
+ "no-iterator"?: TtscLintRuleSetting;
599
+ /**
600
+ * Reject labeled statements (`outer: for (...) { break outer; }`).
601
+ *
602
+ * Labels obscure control flow; prefer extracting the inner loop into
603
+ * a function and using `return`, or refactoring with a flag variable.
604
+ *
605
+ * @reference https://eslint.org/docs/latest/rules/no-labels
606
+ */
607
+ "no-labels"?: TtscLintRuleSetting;
608
+ /**
609
+ * Reject standalone `{ ... }` blocks that introduce no lexical
610
+ * scope distinct from the surrounding block.
611
+ *
612
+ * Blocks that actually declare `let`, `const`, `class`, or `function`
613
+ * (in strict mode) are exempt, since those declarations need the
614
+ * inner scope.
615
+ *
616
+ * @reference https://eslint.org/docs/latest/rules/no-lone-blocks
617
+ */
618
+ "no-lone-blocks"?: TtscLintRuleSetting;
619
+ /**
620
+ * Reject `if (cond) { if (...) { ... } }` where the inner `if` is
621
+ * the only statement in an `else` — prefer `else if`.
622
+ *
623
+ * @reference https://eslint.org/docs/latest/rules/no-lonely-if
624
+ */
625
+ "no-lonely-if"?: TtscLintRuleSetting;
626
+ /**
627
+ * Reject function declarations defined inside the body of a loop.
628
+ * Each iteration of the loop allocates a fresh function whose
629
+ * closure captures the surrounding `let`/`var` binding — a class
630
+ * of bugs where every captured function reads the iteration's
631
+ * final value instead of its own.
632
+ *
633
+ * @reference https://eslint.org/docs/latest/rules/no-loop-func
634
+ */
635
+ "no-loop-func"?: TtscLintRuleSetting;
636
+ /**
637
+ * Reject numeric literals whose source text cannot round-trip
638
+ * through `Number` without losing digits, including overflow.
639
+ *
640
+ * @reference https://eslint.org/docs/latest/rules/no-loss-of-precision
641
+ */
642
+ "no-loss-of-precision"?: TtscLintRuleSetting;
643
+ /**
644
+ * Reject inline numeric literals outside `const` initializer position. `0`, `1`, `-1`, array indices, and enum values are exempt.
645
+ *
646
+ * @reference https://eslint.org/docs/latest/rules/no-magic-numbers
647
+ */
648
+ "no-magic-numbers"?: TtscLintRuleSetting;
649
+ /**
650
+ * Reject regex character classes that contain combined Unicode
651
+ * sequences (e.g. surrogate pairs) which most readers will not
652
+ * realize represent multiple code units.
653
+ *
654
+ * @reference https://eslint.org/docs/latest/rules/no-misleading-character-class
655
+ */
656
+ "no-misleading-character-class"?: TtscLintRuleSetting;
657
+ /**
658
+ * Reject mixing operators of different precedence families in the
659
+ * same expression without explicit parentheses around the inner
660
+ * sub-expression. The famous case is `a && b || c`: readers expect
661
+ * left-to-right grouping but the parser sees `(a && b) || c` because
662
+ * `&&` binds tighter than `||`.
663
+ *
664
+ * The conservative baseline only flags the highest-confusion mixes —
665
+ * logical mixed with a different logical (`&&` next to `||` / `??`),
666
+ * and bitwise (`&`, `|`, `^`) next to a comparison or logical.
667
+ * Wrapping the inner sub-expression in parens suppresses the report.
668
+ *
669
+ * @reference https://eslint.org/docs/latest/rules/no-mixed-operators
670
+ */
671
+ "no-mixed-operators"?: TtscLintRuleSetting;
672
+ /**
673
+ * Reject chained assignment such as `a = b = 0`, which obscures
674
+ * intent and surprises readers who expect comparison.
675
+ *
676
+ * @reference https://eslint.org/docs/latest/rules/no-multi-assign
677
+ */
678
+ "no-multi-assign"?: TtscLintRuleSetting;
679
+ /**
680
+ * Reject backslash-newline multiline string literals; use template
681
+ * literals instead.
682
+ *
683
+ * @reference https://eslint.org/docs/latest/rules/no-multi-str
684
+ */
685
+ "no-multi-str"?: TtscLintRuleSetting;
686
+ /**
687
+ * Reject `if (!cond) { ... } else { ... }` — flip the branches so
688
+ * the positive condition reads first.
689
+ *
690
+ * @reference https://eslint.org/docs/latest/rules/no-negated-condition
691
+ */
692
+ "no-negated-condition"?: TtscLintRuleSetting;
693
+ /**
694
+ * Reject ternary expressions nested in other ternaries
695
+ * (`a ? b : c ? d : e`), which are hard to read at a glance.
696
+ *
697
+ * @reference https://eslint.org/docs/latest/rules/no-nested-ternary
698
+ */
699
+ "no-nested-ternary"?: TtscLintRuleSetting;
700
+ /**
701
+ * Reject `new` expressions whose return value is not assigned or
702
+ * used — the object is created only for its constructor side effects.
703
+ *
704
+ * @reference https://eslint.org/docs/latest/rules/no-new
705
+ */
706
+ "no-new"?: TtscLintRuleSetting;
707
+ /**
708
+ * Reject `new Function(...)` and `Function(...)` calls, which
709
+ * effectively evaluate a string and have the same risks as `eval`.
710
+ *
711
+ * @reference https://eslint.org/docs/latest/rules/no-new-func
712
+ */
713
+ "no-new-func"?: TtscLintRuleSetting;
714
+ /**
715
+ * Reject primitive wrapper constructors `new String(...)`, `new
716
+ * Number(...)`, `new Boolean(...)`.
717
+ *
718
+ * The resulting objects compare unequal to their primitive counterparts.
719
+ *
720
+ * @reference https://eslint.org/docs/latest/rules/no-new-wrappers
721
+ */
722
+ "no-new-wrappers"?: TtscLintRuleSetting;
723
+ /**
724
+ * Reject `new Symbol(...)`. `Symbol` is a function but not a
725
+ * constructor; calling it with `new` throws a TypeError at runtime.
726
+ * The upstream rule was renamed `no-new-native-nonconstructor`; the
727
+ * legacy name remains the more readable pointer for this specific
728
+ * Symbol check.
729
+ *
730
+ * @reference https://eslint.org/docs/latest/rules/no-new-symbol
731
+ */
732
+ "no-new-symbol"?: TtscLintRuleSetting;
733
+ /**
734
+ * Reject calling global non-callable objects as functions, such as
735
+ * `Math()` or `JSON()`.
736
+ *
737
+ * @reference https://eslint.org/docs/latest/rules/no-obj-calls
738
+ */
739
+ "no-obj-calls"?: TtscLintRuleSetting;
740
+ /**
741
+ * Reject `new Object()` and `Object()` constructor calls; use an
742
+ * object literal `{}` instead.
743
+ *
744
+ * @reference https://eslint.org/docs/latest/rules/no-object-constructor
745
+ */
746
+ "no-object-constructor"?: TtscLintRuleSetting;
747
+ /**
748
+ * Reject legacy octal literals (`0123`).
749
+ *
750
+ * Use the `0o123` prefix when an octal literal is actually intended.
751
+ *
752
+ * @reference https://eslint.org/docs/latest/rules/no-octal
753
+ */
754
+ "no-octal"?: TtscLintRuleSetting;
755
+ /**
756
+ * Reject octal escape sequences in string literals (`"\251"`,
757
+ * `"\07"`).
758
+ *
759
+ * Deprecated and forbidden in strict mode; use Unicode (`©`) or hex
760
+ * (`\xA9`) escapes.
761
+ *
762
+ * @reference https://eslint.org/docs/latest/rules/no-octal-escape
763
+ */
764
+ "no-octal-escape"?: TtscLintRuleSetting;
765
+ /**
766
+ * Reject reassigning a function parameter inside the body of the
767
+ * function it belongs to. The parameter name stops pointing at the
768
+ * caller's argument after the write. Property mutations
769
+ * (`param.foo = …`) are not flagged.
770
+ *
771
+ * @reference https://eslint.org/docs/latest/rules/no-param-reassign
772
+ */
773
+ "no-param-reassign"?: TtscLintRuleSetting;
774
+ /**
775
+ * Reject `++` and `--` operators.
776
+ *
777
+ * Prefer `+= 1` / `-= 1` to keep statements expression-only and
778
+ * avoid ASI surprises.
779
+ *
780
+ * @reference https://eslint.org/docs/latest/rules/no-plusplus
781
+ */
782
+ "no-plusplus"?: TtscLintRuleSetting;
783
+ /**
784
+ * Reject `return` inside the Promise executor function — the value
785
+ * is ignored.
786
+ *
787
+ * @reference https://eslint.org/docs/latest/rules/no-promise-executor-return
788
+ */
789
+ "no-promise-executor-return"?: TtscLintRuleSetting;
790
+ /**
791
+ * Reject access to `obj.__proto__`; use `Object.getPrototypeOf` /
792
+ * `Object.setPrototypeOf`.
793
+ *
794
+ * @reference https://eslint.org/docs/latest/rules/no-proto
795
+ */
796
+ "no-proto"?: TtscLintRuleSetting;
797
+ /**
798
+ * Reject `obj.hasOwnProperty(key)` and other direct
799
+ * `Object.prototype` builtins on user objects, since the property
800
+ * may be shadowed.
801
+ *
802
+ * Use `Object.prototype.hasOwnProperty.call(obj, key)` or
803
+ * `Object.hasOwn`.
804
+ *
805
+ * @reference https://eslint.org/docs/latest/rules/no-prototype-builtins
806
+ */
807
+ "no-prototype-builtins"?: TtscLintRuleSetting;
808
+ /**
809
+ * Reject declaring the same binding more than once in the same scope
810
+ * (`var x = 1; var x = 2;`, two `function foo()` declarations side by
811
+ * side, or a parameter rebound by a later `var` in the body). The
812
+ * second declaration silently overwrites the first; shadowing the
813
+ * binding in a nested scope is left alone.
814
+ *
815
+ * @reference https://eslint.org/docs/latest/rules/no-redeclare
816
+ */
817
+ "no-redeclare"?: TtscLintRuleSetting;
818
+ /**
819
+ * Reject more than one consecutive literal space in a regex; use
820
+ * `{N}` quantifiers for clarity.
821
+ *
822
+ * @reference https://eslint.org/docs/latest/rules/no-regex-spaces
823
+ */
824
+ "no-regex-spaces"?: TtscLintRuleSetting;
825
+ /**
826
+ * Reject `import` declarations targeting any module specifier in the project denylist.
827
+ *
828
+ * @reference https://eslint.org/docs/latest/rules/no-restricted-imports
829
+ */
830
+ "no-restricted-imports"?: TtscLintRuleSetting;
831
+ /**
832
+ * Reject AST node kinds listed in the project denylist.
833
+ *
834
+ * @reference https://eslint.org/docs/latest/rules/no-restricted-syntax
835
+ */
836
+ "no-restricted-syntax"?: TtscLintRuleSetting;
837
+ /**
838
+ * Reject assignment expressions used as the operand of `return`
839
+ * (`return x = 1`) — almost always a typo for `===`.
840
+ *
841
+ * @reference https://eslint.org/docs/latest/rules/no-return-assign
842
+ */
843
+ "no-return-assign"?: TtscLintRuleSetting;
844
+ /**
845
+ * Reject `javascript:` URLs in string literals — they execute their
846
+ * body as code on browser navigation, and security scanners treat them
847
+ * as an `eval` equivalent.
848
+ *
849
+ * @reference https://eslint.org/docs/latest/rules/no-script-url
850
+ */
851
+ "no-script-url"?: TtscLintRuleSetting;
852
+ /**
853
+ * Reject `x = x` and destructuring forms that copy a value to
854
+ * itself — almost always a typo.
855
+ *
856
+ * @reference https://eslint.org/docs/latest/rules/no-self-assign
857
+ */
858
+ "no-self-assign"?: TtscLintRuleSetting;
859
+ /**
860
+ * Reject comparing a value to itself (`x === x`). Use
861
+ * `Number.isNaN(x)` to test for `NaN`.
862
+ *
863
+ * @reference https://eslint.org/docs/latest/rules/no-self-compare
864
+ */
865
+ "no-self-compare"?: TtscLintRuleSetting;
866
+ /**
867
+ * Reject comma expressions (`a, b`) outside the heads of `for`
868
+ * statements.
869
+ *
870
+ * @reference https://eslint.org/docs/latest/rules/no-sequences
871
+ */
872
+ "no-sequences"?: TtscLintRuleSetting;
873
+ /**
874
+ * Reject explicit `return` from a setter — setters' return values
875
+ * are ignored.
876
+ *
877
+ * @reference https://eslint.org/docs/latest/rules/no-setter-return
878
+ */
879
+ "no-setter-return"?: TtscLintRuleSetting;
880
+ /**
881
+ * Reject a variable declaration that shadows a same-name binding in
882
+ * an enclosing scope.
883
+ *
884
+ * @reference https://eslint.org/docs/latest/rules/no-shadow
885
+ */
886
+ "no-shadow"?: TtscLintRuleSetting;
887
+ /**
888
+ * Reject redeclaring restricted globals (`NaN`, `Infinity`,
889
+ * `undefined`, etc.).
890
+ *
891
+ * @reference https://eslint.org/docs/latest/rules/no-shadow-restricted-names
892
+ */
893
+ "no-shadow-restricted-names"?: TtscLintRuleSetting;
894
+ /**
895
+ * Reject array literals with elision (`[, 1, , 3]`), which read
896
+ * surprisingly and rarely express intent.
897
+ *
898
+ * @reference https://eslint.org/docs/latest/rules/no-sparse-arrays
899
+ */
900
+ "no-sparse-arrays"?: TtscLintRuleSetting;
901
+ /**
902
+ * Reject `${expr}` inside ordinary single- or double-quoted
903
+ * strings — almost always a missing template-literal backtick.
904
+ *
905
+ * @reference https://eslint.org/docs/latest/rules/no-template-curly-in-string
906
+ */
907
+ "no-template-curly-in-string"?: TtscLintRuleSetting;
908
+ /**
909
+ * Reject `this` (or `super.x`) references that precede the first
910
+ * `super()` call in a derived constructor. The runtime throws a
911
+ * ReferenceError on the first such access; catching it at lint time
912
+ * avoids a class of bugs that only surface after the constructor is
913
+ * actually called.
914
+ *
915
+ * @reference https://eslint.org/docs/latest/rules/no-this-before-super
916
+ */
917
+ "no-this-before-super"?: TtscLintRuleSetting;
918
+ /**
919
+ * Reject throwing non-Error operands (`throw "boom"`, `throw 1`).
920
+ *
921
+ * @reference https://eslint.org/docs/latest/rules/no-throw-literal
922
+ */
923
+ "no-throw-literal"?: TtscLintRuleSetting;
924
+ /**
925
+ * Reject initializing a variable to the literal `undefined`
926
+ * (`let x = undefined`) — declaring without an initializer has the
927
+ * same effect.
928
+ *
929
+ * @reference https://eslint.org/docs/latest/rules/no-undef-init
930
+ */
931
+ "no-undef-init"?: TtscLintRuleSetting;
932
+ /**
933
+ * Reject use of the global `undefined` identifier; use the `void 0`
934
+ * expression or omit the value.
935
+ *
936
+ * @reference https://eslint.org/docs/latest/rules/no-undefined
937
+ */
938
+ "no-undefined"?: TtscLintRuleSetting;
939
+ /**
940
+ * Reject `cond ? true : false` and similar ternaries that can be
941
+ * simplified to a boolean coercion or the condition itself.
942
+ *
943
+ * @reference https://eslint.org/docs/latest/rules/no-unneeded-ternary
944
+ */
945
+ "no-unneeded-ternary"?: TtscLintRuleSetting;
946
+ /**
947
+ * Reject statements that follow an unconditional `return`, `throw`,
948
+ * `break`, or `continue` in the same block — control flow has already
949
+ * left the block, so any later statement is dead code.
950
+ *
951
+ * The conservative baseline scans the immediate statement list of a
952
+ * block (or the top-level source / module body) only; hoistable
953
+ * function declarations following the terminator are exempt because
954
+ * they are hoisted above the unreachable point.
955
+ *
956
+ * @reference https://eslint.org/docs/latest/rules/no-unreachable
957
+ */
958
+ "no-unreachable"?: TtscLintRuleSetting;
959
+ /**
960
+ * Reject `return` and `throw` inside a `finally` block, which
961
+ * override any earlier `return`/`throw` from the corresponding
962
+ * `try`/`catch`.
963
+ *
964
+ * @reference https://eslint.org/docs/latest/rules/no-unsafe-finally
965
+ */
966
+ "no-unsafe-finally"?: TtscLintRuleSetting;
967
+ /**
968
+ * Reject `!key in obj` and `!a instanceof B` where the `!` binds
969
+ * tighter than the relational operator and silently coerces the
970
+ * left operand to a boolean.
971
+ *
972
+ * Wrap in parens (`!(key in obj)`) when the negation is genuinely
973
+ * intended.
974
+ *
975
+ * @reference https://eslint.org/docs/latest/rules/no-unsafe-negation
976
+ */
977
+ "no-unsafe-negation"?: TtscLintRuleSetting;
978
+ /**
979
+ * Reject member access or call expressions that chain off an
980
+ * optional chain without continuing the chain. `(obj?.foo).bar`
981
+ * throws a TypeError if obj is null/undefined; the chain must
982
+ * continue with `?.` to remain safe.
983
+ *
984
+ * @reference https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining
985
+ */
986
+ "no-unsafe-optional-chaining"?: TtscLintRuleSetting;
987
+ /**
988
+ * Reject expression statements with no observable effect, like a
989
+ * bare `x;` or `'use strict' && f();`.
990
+ *
991
+ * @reference https://eslint.org/docs/latest/rules/no-unused-expressions
992
+ */
993
+ "no-unused-expressions"?: TtscLintRuleSetting;
994
+ /**
995
+ * Reject labels that no `break` or `continue` statement references.
996
+ *
997
+ * Usually the targeted statement was renamed or removed but the label
998
+ * was left behind.
999
+ *
1000
+ * @reference https://eslint.org/docs/latest/rules/no-unused-labels
1001
+ */
1002
+ "no-unused-labels"?: TtscLintRuleSetting;
1003
+ /**
1004
+ * Reject an assignment whose value is immediately overwritten by the
1005
+ * very next statement without an intervening read of the same
1006
+ * identifier. The conservative baseline only fires on two
1007
+ * syntactically adjacent `x = <expr>;` statements where the
1008
+ * left-hand sides are the same bare identifier and the second
1009
+ * statement's right-hand side does not reference `x` itself — almost
1010
+ * always a leftover from refactoring.
1011
+ *
1012
+ * @reference https://eslint.org/docs/latest/rules/no-useless-assignment
1013
+ */
1014
+ "no-useless-assignment"?: TtscLintRuleSetting;
1015
+ /**
1016
+ * Reject unnecessary `.call()` / `.apply()` calls (such as
1017
+ * `f.call(undefined, x)`).
1018
+ *
1019
+ * @reference https://eslint.org/docs/latest/rules/no-useless-call
1020
+ */
1021
+ "no-useless-call"?: TtscLintRuleSetting;
1022
+ /**
1023
+ * Reject `catch (e) { throw e }` patterns that only rethrow the
1024
+ * caught error without adding context or handling.
1025
+ *
1026
+ * @reference https://eslint.org/docs/latest/rules/no-useless-catch
1027
+ */
1028
+ "no-useless-catch"?: TtscLintRuleSetting;
1029
+ /**
1030
+ * Reject computed property keys whose expression is a literal
1031
+ * identifier (`{ ["foo"]: 1 }`).
1032
+ *
1033
+ * @reference https://eslint.org/docs/latest/rules/no-useless-computed-key
1034
+ */
1035
+ "no-useless-computed-key"?: TtscLintRuleSetting;
1036
+ /**
1037
+ * Reject `"a" + "b"` and similar concatenations where every operand
1038
+ * is a literal string.
1039
+ *
1040
+ * @reference https://eslint.org/docs/latest/rules/no-useless-concat
1041
+ */
1042
+ "no-useless-concat"?: TtscLintRuleSetting;
1043
+ /**
1044
+ * Reject empty constructor bodies (`class X { constructor() {} }`)
1045
+ * that add nothing over the implicit constructor.
1046
+ *
1047
+ * @reference https://eslint.org/docs/latest/rules/no-useless-constructor
1048
+ */
1049
+ "no-useless-constructor"?: TtscLintRuleSetting;
1050
+ /**
1051
+ * Reject unnecessary escape sequences in strings and regex
1052
+ * literals, such as `"\."` or `/\,/`. Autofixable.
1053
+ *
1054
+ * @reference https://eslint.org/docs/latest/rules/no-useless-escape
1055
+ */
1056
+ "no-useless-escape"?: TtscLintRuleSetting;
1057
+ /**
1058
+ * Reject `{ x: x }` destructuring renames that bind back to the
1059
+ * same name. Autofixable.
1060
+ *
1061
+ * @reference https://eslint.org/docs/latest/rules/no-useless-rename
1062
+ */
1063
+ "no-useless-rename"?: TtscLintRuleSetting;
1064
+ /**
1065
+ * Reject a bare `return;` whose only effect is to end a function
1066
+ * body that would have returned anyway. The conservative baseline
1067
+ * only fires on the last statement of a function-like's immediate
1068
+ * body — earlier `return;` inside a branch or loop may still be
1069
+ * load-bearing.
1070
+ *
1071
+ * @reference https://eslint.org/docs/latest/rules/no-useless-return
1072
+ */
1073
+ "no-useless-return"?: TtscLintRuleSetting;
1074
+ /**
1075
+ * Reject `var` declarations.
1076
+ *
1077
+ * Use `let` for mutable bindings and `const` for immutable ones.
1078
+ * Autofixable to `let`.
1079
+ *
1080
+ * @reference https://eslint.org/docs/latest/rules/no-var
1081
+ */
1082
+ "no-var"?: TtscLintRuleSetting;
1083
+ /**
1084
+ * Reject `with (...)` statements.
1085
+ *
1086
+ * `with` is forbidden in strict mode (and therefore in modules),
1087
+ * defeats lexical scoping, and blocks engine optimization.
1088
+ *
1089
+ * @reference https://eslint.org/docs/latest/rules/no-with
1090
+ */
1091
+ "no-with"?: TtscLintRuleSetting;
1092
+ /**
1093
+ * Reject `{ foo: foo }` and similar object-literal shorthand
1094
+ * candidates in favor of `{ foo }`. Autofixable.
1095
+ *
1096
+ * @reference https://eslint.org/docs/latest/rules/object-shorthand
1097
+ */
1098
+ "object-shorthand"?: TtscLintRuleSetting;
1099
+ /**
1100
+ * Prefer compound assignment (`x += y`) over the long form
1101
+ * (`x = x + y`) where the two are equivalent.
1102
+ *
1103
+ * @reference https://eslint.org/docs/latest/rules/operator-assignment
1104
+ */
1105
+ "operator-assignment"?: TtscLintRuleSetting;
1106
+ /**
1107
+ * Reject `function() { ... }` expressions passed as callback arguments — prefer the arrow form.
1108
+ *
1109
+ * @reference https://eslint.org/docs/latest/rules/prefer-arrow-callback
1110
+ */
1111
+ "prefer-arrow-callback"?: TtscLintRuleSetting;
1112
+ /**
1113
+ * Require `const` for variables that are never reassigned after
1114
+ * declaration. Autofixable for single-declaration `let`s.
1115
+ *
1116
+ * @reference https://eslint.org/docs/latest/rules/prefer-const
1117
+ */
1118
+ "prefer-const"?: TtscLintRuleSetting;
1119
+ /**
1120
+ * Reject single-property and single-index variable declarations
1121
+ * (`const a = obj.a`, `const x = arr[0]`) that destructuring would
1122
+ * replace verbatim.
1123
+ *
1124
+ * @reference https://eslint.org/docs/latest/rules/prefer-destructuring
1125
+ */
1126
+ "prefer-destructuring"?: TtscLintRuleSetting;
1127
+ /**
1128
+ * Prefer the `**` operator over `Math.pow(base, exp)`.
1129
+ *
1130
+ * @reference https://eslint.org/docs/latest/rules/prefer-exponentiation-operator
1131
+ */
1132
+ "prefer-exponentiation-operator"?: TtscLintRuleSetting;
1133
+ /**
1134
+ * Prefer `for..of` over a traditional `for (let i = 0; i <
1135
+ * arr.length; i++)` loop when the index is never used inside the
1136
+ * body.
1137
+ *
1138
+ * @reference https://eslint.org/docs/latest/rules/prefer-for-of
1139
+ */
1140
+ "prefer-for-of"?: TtscLintRuleSetting;
1141
+ /**
1142
+ * Prefer `Object.hasOwn(obj, key)` over
1143
+ * `Object.prototype.hasOwnProperty.call(obj, key)`. The new helper
1144
+ * is shorter, less error-prone, and matches the form linters
1145
+ * elsewhere recommend.
1146
+ *
1147
+ * @reference https://eslint.org/docs/latest/rules/prefer-object-has-own
1148
+ */
1149
+ "prefer-object-has-own"?: TtscLintRuleSetting;
1150
+ /**
1151
+ * Prefer object-spread `{ ...a, ...b }` over `Object.assign({}, a, b)`.
1152
+ * Only fires when the first argument is an empty object literal —
1153
+ * mutating `Object.assign(target, …)` calls are left alone because
1154
+ * the spread form does not preserve their observable side effects.
1155
+ *
1156
+ * @reference https://eslint.org/docs/latest/rules/prefer-object-spread
1157
+ */
1158
+ "prefer-object-spread"?: TtscLintRuleSetting;
1159
+ /**
1160
+ * Reject regex literals with unnamed capturing groups `(...)` — prefer named groups `(?<name>...)`.
1161
+ *
1162
+ * @reference https://eslint.org/docs/latest/rules/prefer-named-capture-group
1163
+ */
1164
+ "prefer-named-capture-group"?: TtscLintRuleSetting;
1165
+ /**
1166
+ * Prefer ES2015+ numeric literal forms (`0b…`, `0o…`, `0x…`) over
1167
+ * `parseInt(string, 2 | 8 | 16)`. The literal form is shorter, type-
1168
+ * safe at lint time, and not subject to runtime radix mismatches.
1169
+ *
1170
+ * @reference https://eslint.org/docs/latest/rules/prefer-numeric-literals
1171
+ */
1172
+ "prefer-numeric-literals"?: TtscLintRuleSetting;
1173
+ /**
1174
+ * Reject reading from `arguments` in a non-arrow function body —
1175
+ * prefer the ES2015 rest-parameter form `(...args)`, which declares
1176
+ * the variadic contract on the signature and yields a real array.
1177
+ *
1178
+ * @reference https://eslint.org/docs/latest/rules/prefer-rest-params
1179
+ */
1180
+ "prefer-rest-params"?: TtscLintRuleSetting;
1181
+ /**
1182
+ * Prefer spread arguments `f(...args)` over `f.apply(null, args)`.
1183
+ *
1184
+ * Only flags `apply` calls whose `this` argument is provably the
1185
+ * same receiver (or `null` / `undefined`); calls that genuinely
1186
+ * rebind `this` are left alone.
1187
+ *
1188
+ * @reference https://eslint.org/docs/latest/rules/prefer-spread
1189
+ */
1190
+ "prefer-spread"?: TtscLintRuleSetting;
1191
+ /**
1192
+ * Prefer template literals over string concatenation when any
1193
+ * operand is non-literal.
1194
+ *
1195
+ * @reference https://eslint.org/docs/latest/rules/prefer-template
1196
+ */
1197
+ "prefer-template"?: TtscLintRuleSetting;
1198
+ /**
1199
+ * Require an explicit radix argument for `parseInt(str, radix)`.
1200
+ *
1201
+ * Without it, `"0123"` parses as decimal or octal depending on the
1202
+ * engine.
1203
+ *
1204
+ * @reference https://eslint.org/docs/latest/rules/radix
1205
+ */
1206
+ "radix"?: TtscLintRuleSetting;
1207
+ /**
1208
+ * Require generator functions to contain at least one `yield`. A
1209
+ * `yield`-less generator is almost always a typo.
1210
+ *
1211
+ * @reference https://eslint.org/docs/latest/rules/require-yield
1212
+ */
1213
+ "require-yield"?: TtscLintRuleSetting;
1214
+ /**
1215
+ * Reject import specifiers within a single `import` declaration that aren't alphabetically sorted.
1216
+ *
1217
+ * @reference https://eslint.org/docs/latest/rules/sort-imports
1218
+ */
1219
+ "sort-imports"?: TtscLintRuleSetting;
1220
+ /**
1221
+ * Reject object-literal property keys that aren't alphabetically sorted.
1222
+ *
1223
+ * @reference https://eslint.org/docs/latest/rules/sort-keys
1224
+ */
1225
+ "sort-keys"?: TtscLintRuleSetting;
1226
+ /**
1227
+ * Require `Number.isNaN` / `isNaN` for `NaN` checks; restrict
1228
+ * `typeof` comparisons to the documented strings.
1229
+ *
1230
+ * @reference https://eslint.org/docs/latest/rules/use-isnan
1231
+ */
1232
+ "use-isnan"?: TtscLintRuleSetting;
1233
+ /**
1234
+ * Restrict the right-hand operand of `typeof` to the documented
1235
+ * strings (`"number"`, `"object"`, ...) so `typeof x === "undefiend"`
1236
+ * typos are caught.
1237
+ *
1238
+ * @reference https://eslint.org/docs/latest/rules/valid-typeof
1239
+ */
1240
+ "valid-typeof"?: TtscLintRuleSetting;
1241
+ /**
1242
+ * Require `var` declarations to be hoisted to the top of their
1243
+ * scope by hand, mirroring how the engine treats them.
1244
+ *
1245
+ * Has no effect when `no-var` forbids `var` altogether.
1246
+ *
1247
+ * @reference https://eslint.org/docs/latest/rules/vars-on-top
1248
+ */
1249
+ "vars-on-top"?: TtscLintRuleSetting;
1250
+ /**
1251
+ * Reject Yoda-style comparisons (`if (42 === x)`); use
1252
+ * `if (x === 42)` so the variable comes first.
1253
+ *
1254
+ * @reference https://eslint.org/docs/latest/rules/yoda
1255
+ */
1256
+ "yoda"?: TtscLintRuleSetting;
1257
+ }