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