@ttsc/lint 0.13.1 → 0.14.0-dev.20260528.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,997 @@
1
+ import type { TtscLintRuleSetting } from "../TtscLintRuleSetting";
2
+ /**
3
+ * Modernization and style rules from `eslint-plugin-unicorn`.
4
+ *
5
+ * Span array iteration, string and regex idioms, Node.js APIs, error handling,
6
+ * module syntax, DOM APIs, and code shape. Rewrite legacy patterns into modern
7
+ * counterparts, forbid known anti-patterns, and pin a consistent style for
8
+ * things ESLint core and `typescript/*` leave underspecified.
9
+ *
10
+ * Pure-AST; no checker dependencies.
11
+ *
12
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn
13
+ */
14
+ export interface ITtscLintUnicornRules {
15
+ /**
16
+ * Rewrite regex literals into shorter, consistent, and safer form
17
+ * (character-class shorthands, redundant ranges).
18
+ *
19
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md
20
+ */
21
+ "unicorn/better-regex"?: TtscLintRuleSetting;
22
+ /**
23
+ * Enforce a canonical parameter name (`error`) in `catch` clauses.
24
+ *
25
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/catch-error-name.md
26
+ */
27
+ "unicorn/catch-error-name"?: TtscLintRuleSetting;
28
+ /**
29
+ * Enforce consistent assertion style when using `node:assert`.
30
+ *
31
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-assert.md
32
+ */
33
+ "unicorn/consistent-assert"?: TtscLintRuleSetting;
34
+ /**
35
+ * Prefer passing a `Date` directly to the `Date` constructor when cloning,
36
+ * not `+date` or `date.getTime()`.
37
+ *
38
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-date-clone.md
39
+ */
40
+ "unicorn/consistent-date-clone"?: TtscLintRuleSetting;
41
+ /**
42
+ * Once a property is destructured from an object, require subsequent reads to
43
+ * use the destructured binding.
44
+ *
45
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-destructuring.md
46
+ */
47
+ "unicorn/consistent-destructuring"?: TtscLintRuleSetting;
48
+ /**
49
+ * Require both branches of a ternary spread inside an array literal to be
50
+ * array-typed.
51
+ *
52
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-empty-array-spread.md
53
+ */
54
+ "unicorn/consistent-empty-array-spread"?: TtscLintRuleSetting;
55
+ /**
56
+ * Enforce a consistent comparison form (`< 0` vs `=== -1`, `>= 0` vs `!==
57
+ * -1`) for `indexOf` / `findIndex` existence checks.
58
+ *
59
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-existence-index-check.md
60
+ */
61
+ "unicorn/consistent-existence-index-check"?: TtscLintRuleSetting;
62
+ /**
63
+ * Hoist function declarations to the highest scope that does not capture any
64
+ * outer variables.
65
+ *
66
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-function-scoping.md
67
+ */
68
+ "unicorn/consistent-function-scoping"?: TtscLintRuleSetting;
69
+ /**
70
+ * Enforce a consistent style (always `\${` or always `$\{`) when escaping
71
+ * `${` in template literals.
72
+ *
73
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-template-literal-escape.md
74
+ */
75
+ "unicorn/consistent-template-literal-escape"?: TtscLintRuleSetting;
76
+ /**
77
+ * Require user-defined `Error` subclasses to set `name`, call
78
+ * `super(message)`, and assign their stack correctly.
79
+ *
80
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/custom-error-definition.md
81
+ */
82
+ "unicorn/custom-error-definition"?: TtscLintRuleSetting;
83
+ /**
84
+ * Reject whitespace inside empty `{}` braces.
85
+ *
86
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/empty-brace-spaces.md
87
+ */
88
+ "unicorn/empty-brace-spaces"?: TtscLintRuleSetting;
89
+ /**
90
+ * Require a non-empty `message` argument when constructing a built-in
91
+ * `Error`.
92
+ *
93
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md
94
+ */
95
+ "unicorn/error-message"?: TtscLintRuleSetting;
96
+ /**
97
+ * Require consistent case for escape sequences (`\xA9` over `\xa9`, `µ` over
98
+ * `µ`).
99
+ *
100
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/escape-case.md
101
+ */
102
+ "unicorn/escape-case"?: TtscLintRuleSetting;
103
+ /**
104
+ * Require every `TODO`/`FIXME`/`XXX` comment to declare an expiration date or
105
+ * package version.
106
+ *
107
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/expiring-todo-comments.md
108
+ */
109
+ "unicorn/expiring-todo-comments"?: TtscLintRuleSetting;
110
+ /**
111
+ * Require explicit comparison of `.length` / `.size` instead of relying on
112
+ * truthy coercion.
113
+ *
114
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/explicit-length-check.md
115
+ */
116
+ "unicorn/explicit-length-check"?: TtscLintRuleSetting;
117
+ /**
118
+ * Enforce a single case style (kebab / camel / snake / pascal) for source
119
+ * filenames.
120
+ *
121
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
122
+ */
123
+ "unicorn/filename-case"?: TtscLintRuleSetting;
124
+ /**
125
+ * Restrict each module's allowed import styles (named only, default only,
126
+ * namespace only).
127
+ *
128
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/import-style.md
129
+ */
130
+ "unicorn/import-style"?: TtscLintRuleSetting;
131
+ /**
132
+ * Reject references to outer-scope variables inside functions marked as
133
+ * isolated (e.g., the body of a web worker).
134
+ *
135
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/isolated-functions.md
136
+ */
137
+ "unicorn/isolated-functions"?: TtscLintRuleSetting;
138
+ /**
139
+ * Require `new` when calling builtin constructors like `Error`, `Map`, `Set`,
140
+ * `Date` — and forbid `new` on primitive wrappers like `String`, `Number`,
141
+ * `Boolean`.
142
+ *
143
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md
144
+ */
145
+ "unicorn/new-for-builtins"?: TtscLintRuleSetting;
146
+ /**
147
+ * Require every `eslint-disable*` directive to name the rules it disables.
148
+ *
149
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-abusive-eslint-disable.md
150
+ */
151
+ "unicorn/no-abusive-eslint-disable"?: TtscLintRuleSetting;
152
+ /**
153
+ * Reject recursive reads on `this.<prop>` inside the getter / setter for
154
+ * `<prop>`.
155
+ *
156
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-accessor-recursion.md
157
+ */
158
+ "unicorn/no-accessor-recursion"?: TtscLintRuleSetting;
159
+ /**
160
+ * Require a name on every default-exported function, class, or object.
161
+ *
162
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-anonymous-default-export.md
163
+ */
164
+ "unicorn/no-anonymous-default-export"?: TtscLintRuleSetting;
165
+ /**
166
+ * Reject passing a function reference directly as the callback to `map` /
167
+ * `filter` / `forEach` / etc., which silently leaks extra index/array
168
+ * arguments to the callee.
169
+ *
170
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-callback-reference.md
171
+ */
172
+ "unicorn/no-array-callback-reference"?: TtscLintRuleSetting;
173
+ /**
174
+ * Prefer `for...of` over `Array.prototype.forEach`.
175
+ *
176
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-for-each.md
177
+ */
178
+ "unicorn/no-array-for-each"?: TtscLintRuleSetting;
179
+ /**
180
+ * Reject the second `thisArg` argument to array methods; use an explicit
181
+ * closure instead.
182
+ *
183
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-method-this-argument.md
184
+ */
185
+ "unicorn/no-array-method-this-argument"?: TtscLintRuleSetting;
186
+ /**
187
+ * Reject `Array#reduce` / `Array#reduceRight` in favor of explicit loops or
188
+ * other helpers.
189
+ *
190
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reduce.md
191
+ */
192
+ "unicorn/no-array-reduce"?: TtscLintRuleSetting;
193
+ /**
194
+ * Prefer `Array#toReversed` over the mutating `Array#reverse`.
195
+ *
196
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reverse.md
197
+ */
198
+ "unicorn/no-array-reverse"?: TtscLintRuleSetting;
199
+ /**
200
+ * Prefer `Array#toSorted` over the mutating `Array#sort`.
201
+ *
202
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-sort.md
203
+ */
204
+ "unicorn/no-array-sort"?: TtscLintRuleSetting;
205
+ /**
206
+ * Reject member access on an `await` expression without parens; require
207
+ * `(await x).y`.
208
+ *
209
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-await-expression-member.md
210
+ */
211
+ "unicorn/no-await-expression-member"?: TtscLintRuleSetting;
212
+ /**
213
+ * Reject `await` inside arrays passed to `Promise.all` / `Promise.allSettled`
214
+ * / `Promise.race` / `Promise.any` — the awaits serialize the calls.
215
+ *
216
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-await-in-promise-methods.md
217
+ */
218
+ "unicorn/no-await-in-promise-methods"?: TtscLintRuleSetting;
219
+ /**
220
+ * Reject leading or trailing spaces in arguments to `console.log` and friends
221
+ * — `console` already inserts spaces between args.
222
+ *
223
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-console-spaces.md
224
+ */
225
+ "unicorn/no-console-spaces"?: TtscLintRuleSetting;
226
+ /**
227
+ * Reject direct reads or assignments to `document.cookie`; use the Cookie
228
+ * Store API or a wrapper.
229
+ *
230
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-document-cookie.md
231
+ */
232
+ "unicorn/no-document-cookie"?: TtscLintRuleSetting;
233
+ /**
234
+ * Reject source files whose only content is whitespace and/or comments.
235
+ *
236
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-empty-file.md
237
+ */
238
+ "unicorn/no-empty-file"?: TtscLintRuleSetting;
239
+ /**
240
+ * Prefer `for...of` over index-based `for` loops over arrays.
241
+ *
242
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md
243
+ */
244
+ "unicorn/no-for-loop"?: TtscLintRuleSetting;
245
+ /**
246
+ * Prefer Unicode escape (`©`) over hexadecimal escape (`\xA9`).
247
+ *
248
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-hex-escape.md
249
+ */
250
+ "unicorn/no-hex-escape"?: TtscLintRuleSetting;
251
+ /**
252
+ * Reject mutating a value on the same expression that produces it
253
+ * (`[...x].push(y)`); separate the construction and the mutation.
254
+ *
255
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-immediate-mutation.md
256
+ */
257
+ "unicorn/no-immediate-mutation"?: TtscLintRuleSetting;
258
+ /**
259
+ * Reject `instanceof Array`, `instanceof Error`, `instanceof Map`, etc. —
260
+ * they fail across realms and for subclasses.
261
+ *
262
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-builtins.md
263
+ */
264
+ "unicorn/no-instanceof-builtins"?: TtscLintRuleSetting;
265
+ /**
266
+ * Reject GET / HEAD `fetch()` calls that also set a request `body`, which
267
+ * throws at runtime.
268
+ *
269
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-fetch-options.md
270
+ */
271
+ "unicorn/no-invalid-fetch-options"?: TtscLintRuleSetting;
272
+ /**
273
+ * Reject `removeEventListener` calls whose handler argument is a fresh
274
+ * function reference and therefore matches no registered listener.
275
+ *
276
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-remove-event-listener.md
277
+ */
278
+ "unicorn/no-invalid-remove-event-listener"?: TtscLintRuleSetting;
279
+ /**
280
+ * Reject identifiers that start with a reserved word (`newFoo`, `classBar`).
281
+ *
282
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-keyword-prefix.md
283
+ */
284
+ "unicorn/no-keyword-prefix"?: TtscLintRuleSetting;
285
+ /**
286
+ * Reject `if` as the only statement inside an `else` block; use `else if`
287
+ * instead.
288
+ *
289
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-lonely-if.md
290
+ */
291
+ "unicorn/no-lonely-if"?: TtscLintRuleSetting;
292
+ /**
293
+ * Reject magic-number depth arguments to `Array#flat`; require `Infinity` or
294
+ * a named constant.
295
+ *
296
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-magic-array-flat-depth.md
297
+ */
298
+ "unicorn/no-magic-array-flat-depth"?: TtscLintRuleSetting;
299
+ /**
300
+ * Reject re-importing or re-exporting a default binding under a name that
301
+ * differs from the upstream binding.
302
+ *
303
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-named-default.md
304
+ */
305
+ "unicorn/no-named-default"?: TtscLintRuleSetting;
306
+ /**
307
+ * Reject negated conditions in `if`/`else` and ternaries when the positive
308
+ * form is shorter.
309
+ *
310
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negated-condition.md
311
+ */
312
+ "unicorn/no-negated-condition"?: TtscLintRuleSetting;
313
+ /**
314
+ * Reject `!a === b`; require `a !== b` or `!(a === b)`.
315
+ *
316
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negation-in-equality-check.md
317
+ */
318
+ "unicorn/no-negation-in-equality-check"?: TtscLintRuleSetting;
319
+ /**
320
+ * Reject ternaries nested inside other ternaries.
321
+ *
322
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-nested-ternary.md
323
+ */
324
+ "unicorn/no-nested-ternary"?: TtscLintRuleSetting;
325
+ /**
326
+ * Reject the `new Array(...)` constructor; use array literals or `Array.from`
327
+ * / `Array.of`.
328
+ *
329
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-array.md
330
+ */
331
+ "unicorn/no-new-array"?: TtscLintRuleSetting;
332
+ /**
333
+ * Reject the deprecated `new Buffer()` constructor; use `Buffer.from` or
334
+ * `Buffer.alloc`.
335
+ *
336
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-buffer.md
337
+ */
338
+ "unicorn/no-new-buffer"?: TtscLintRuleSetting;
339
+ /**
340
+ * Reject the `null` literal in favor of `undefined`.
341
+ *
342
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-null.md
343
+ */
344
+ "unicorn/no-null"?: TtscLintRuleSetting;
345
+ /**
346
+ * Reject inline object literals as default values for function parameters.
347
+ *
348
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-object-as-default-parameter.md
349
+ */
350
+ "unicorn/no-object-as-default-parameter"?: TtscLintRuleSetting;
351
+ /**
352
+ * Reject `process.exit()`; throw or return a non-zero status instead.
353
+ *
354
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-process-exit.md
355
+ */
356
+ "unicorn/no-process-exit"?: TtscLintRuleSetting;
357
+ /**
358
+ * Reject `Promise.all` / `Promise.race` / etc. called with a single-element
359
+ * array; the wrapper is redundant.
360
+ *
361
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-single-promise-in-promise-methods.md
362
+ */
363
+ "unicorn/no-single-promise-in-promise-methods"?: TtscLintRuleSetting;
364
+ /**
365
+ * Reject classes whose every member is `static`; use a plain module-level
366
+ * namespace instead.
367
+ *
368
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-static-only-class.md
369
+ */
370
+ "unicorn/no-static-only-class"?: TtscLintRuleSetting;
371
+ /**
372
+ * Reject defining a property named `then` on objects, modules, or classes —
373
+ * `await` and Promise resolution accidentally invoke it.
374
+ *
375
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-thenable.md
376
+ */
377
+ "unicorn/no-thenable"?: TtscLintRuleSetting;
378
+ /**
379
+ * Reject `const self = this` and similar aliases; capture via arrow functions
380
+ * instead.
381
+ *
382
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-this-assignment.md
383
+ */
384
+ "unicorn/no-this-assignment"?: TtscLintRuleSetting;
385
+ /**
386
+ * Reject `typeof x === "undefined"`; compare against `undefined` directly.
387
+ *
388
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-typeof-undefined.md
389
+ */
390
+ "unicorn/no-typeof-undefined"?: TtscLintRuleSetting;
391
+ /**
392
+ * Reject `1` as the explicit depth argument of `Array#flat`; the default is
393
+ * already `1`.
394
+ *
395
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-array-flat-depth.md
396
+ */
397
+ "unicorn/no-unnecessary-array-flat-depth"?: TtscLintRuleSetting;
398
+ /**
399
+ * Reject `.length` / `Infinity` as the deleteCount argument to `splice` /
400
+ * `toSpliced`; omit it to delete to the end.
401
+ *
402
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-array-splice-count.md
403
+ */
404
+ "unicorn/no-unnecessary-array-splice-count"?: TtscLintRuleSetting;
405
+ /**
406
+ * Reject `await` on non-thenable expressions.
407
+ *
408
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-await.md
409
+ */
410
+ "unicorn/no-unnecessary-await"?: TtscLintRuleSetting;
411
+ /**
412
+ * Reject polyfill imports for APIs already available in the project's
413
+ * targeted Node / browser baseline.
414
+ *
415
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-polyfills.md
416
+ */
417
+ "unicorn/no-unnecessary-polyfills"?: TtscLintRuleSetting;
418
+ /**
419
+ * Reject `.length` / `Infinity` as the end argument to `slice`; omit it to
420
+ * slice to the end.
421
+ *
422
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-slice-end.md
423
+ */
424
+ "unicorn/no-unnecessary-slice-end"?: TtscLintRuleSetting;
425
+ /**
426
+ * Reject destructuring patterns with long hole runs (`[,,,,a]`); use a named
427
+ * index instead.
428
+ *
429
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-array-destructuring.md
430
+ */
431
+ "unicorn/no-unreadable-array-destructuring"?: TtscLintRuleSetting;
432
+ /**
433
+ * Reject IIFEs whose nesting (multiple parens, arrow IIFE arguments) is hard
434
+ * to read.
435
+ *
436
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md
437
+ */
438
+ "unicorn/no-unreadable-iife"?: TtscLintRuleSetting;
439
+ /**
440
+ * Reject object properties that are never read after definition.
441
+ *
442
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unused-properties.md
443
+ */
444
+ "unicorn/no-unused-properties"?: TtscLintRuleSetting;
445
+ /**
446
+ * Reject useless initializer arguments (`new Set()`, `new Map([])`, `new
447
+ * Set(undefined)`) on collection constructors.
448
+ *
449
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-collection-argument.md
450
+ */
451
+ "unicorn/no-useless-collection-argument"?: TtscLintRuleSetting;
452
+ /**
453
+ * Reject `Error.captureStackTrace(this, constructor)` when the surrounding
454
+ * subclass relies on the default `Error` capture.
455
+ *
456
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-error-capture-stack-trace.md
457
+ */
458
+ "unicorn/no-useless-error-capture-stack-trace"?: TtscLintRuleSetting;
459
+ /**
460
+ * Reject `...(x ?? {})` and similar fallbacks when spreading; the spread of
461
+ * `null` / `undefined` is already a no-op.
462
+ *
463
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-fallback-in-spread.md
464
+ */
465
+ "unicorn/no-useless-fallback-in-spread"?: TtscLintRuleSetting;
466
+ /**
467
+ * Reject `[...iterator]` / `Array.from(iterator)` when the iterator can be
468
+ * consumed directly (e.g., inside `for...of`).
469
+ *
470
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-iterator-to-array.md
471
+ */
472
+ "unicorn/no-useless-iterator-to-array"?: TtscLintRuleSetting;
473
+ /**
474
+ * Reject `arr.length` checks that the iteration method itself already
475
+ * handles.
476
+ *
477
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-length-check.md
478
+ */
479
+ "unicorn/no-useless-length-check"?: TtscLintRuleSetting;
480
+ /**
481
+ * Reject `return Promise.resolve(x)` / `return Promise.reject(e)` inside
482
+ * `async` functions — `return x` and `throw e` work identically.
483
+ *
484
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-promise-resolve-reject.md
485
+ */
486
+ "unicorn/no-useless-promise-resolve-reject"?: TtscLintRuleSetting;
487
+ /**
488
+ * Reject spreading a single iterable into a new collection of the same kind
489
+ * (`[...arr]`, `{...obj}`) when the original would suffice.
490
+ *
491
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-spread.md
492
+ */
493
+ "unicorn/no-useless-spread"?: TtscLintRuleSetting;
494
+ /**
495
+ * Reject `case` clauses with an empty body that immediately precede a
496
+ * `default` whose body executes for them.
497
+ *
498
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-switch-case.md
499
+ */
500
+ "unicorn/no-useless-switch-case"?: TtscLintRuleSetting;
501
+ /**
502
+ * Reject explicit `undefined` returns, default initializers, and arguments
503
+ * where the omission has the same meaning.
504
+ *
505
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-undefined.md
506
+ */
507
+ "unicorn/no-useless-undefined"?: TtscLintRuleSetting;
508
+ /**
509
+ * Reject `1.0` / `1.` / `.5e0` in favor of `1`, `1`, and `0.5`.
510
+ *
511
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-zero-fractions.md
512
+ */
513
+ "unicorn/no-zero-fractions"?: TtscLintRuleSetting;
514
+ /**
515
+ * Enforce one consistent case for the prefix and digits of hex / binary /
516
+ * octal literals (`0xFF` over `0xff`).
517
+ *
518
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/number-literal-case.md
519
+ */
520
+ "unicorn/number-literal-case"?: TtscLintRuleSetting;
521
+ /**
522
+ * Enforce `_` separator grouping (every 3 digits for decimal, every 4 for
523
+ * hex) in numeric literals.
524
+ *
525
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/numeric-separators-style.md
526
+ */
527
+ "unicorn/numeric-separators-style"?: TtscLintRuleSetting;
528
+ /**
529
+ * Prefer `addEventListener` / `removeEventListener` over assigning to `on*`
530
+ * properties.
531
+ *
532
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md
533
+ */
534
+ "unicorn/prefer-add-event-listener"?: TtscLintRuleSetting;
535
+ /**
536
+ * Prefer `Array#find` / `Array#findLast` over `filter(...)[0]` /
537
+ * `filter(...).at(-1)`.
538
+ *
539
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-find.md
540
+ */
541
+ "unicorn/prefer-array-find"?: TtscLintRuleSetting;
542
+ /**
543
+ * Prefer `Array#flat` over legacy flattening idioms (`[].concat(...arrs)`,
544
+ * `reduce` with `concat`).
545
+ *
546
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat.md
547
+ */
548
+ "unicorn/prefer-array-flat"?: TtscLintRuleSetting;
549
+ /**
550
+ * Prefer `Array#flatMap` over `map(...).flat()`.
551
+ *
552
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat-map.md
553
+ */
554
+ "unicorn/prefer-array-flat-map"?: TtscLintRuleSetting;
555
+ /**
556
+ * Prefer `indexOf` / `lastIndexOf` over `findIndex` / `findLastIndex` when
557
+ * matching by `===`.
558
+ *
559
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-index-of.md
560
+ */
561
+ "unicorn/prefer-array-index-of"?: TtscLintRuleSetting;
562
+ /**
563
+ * Prefer `Array#some` over `filter(...).length > 0`, `find(...) !==
564
+ * undefined`, and similar shapes.
565
+ *
566
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-some.md
567
+ */
568
+ "unicorn/prefer-array-some"?: TtscLintRuleSetting;
569
+ /**
570
+ * Prefer `Array#at` / `String#at` over index arithmetic and `charAt`.
571
+ *
572
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-at.md
573
+ */
574
+ "unicorn/prefer-at"?: TtscLintRuleSetting;
575
+ /**
576
+ * Prefer `1n` over `BigInt(1)` and `BigInt("1")`.
577
+ *
578
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-bigint-literals.md
579
+ */
580
+ "unicorn/prefer-bigint-literals"?: TtscLintRuleSetting;
581
+ /**
582
+ * Prefer `Blob#arrayBuffer()` / `Blob#text()` over
583
+ * `FileReader#readAsArrayBuffer` / `readAsText`.
584
+ *
585
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-blob-reading-methods.md
586
+ */
587
+ "unicorn/prefer-blob-reading-methods"?: TtscLintRuleSetting;
588
+ /**
589
+ * Prefer class field declarations over constructor assignments to `this.field
590
+ * = value`.
591
+ *
592
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-class-fields.md
593
+ */
594
+ "unicorn/prefer-class-fields"?: TtscLintRuleSetting;
595
+ /**
596
+ * Prefer `Element#classList.toggle(name, condition)` over manual `add` /
597
+ * `remove` branches.
598
+ *
599
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-classlist-toggle.md
600
+ */
601
+ "unicorn/prefer-classlist-toggle"?: TtscLintRuleSetting;
602
+ /**
603
+ * Prefer `String#codePointAt` / `String.fromCodePoint` over `charCodeAt` /
604
+ * `fromCharCode`.
605
+ *
606
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-code-point.md
607
+ */
608
+ "unicorn/prefer-code-point"?: TtscLintRuleSetting;
609
+ /**
610
+ * Prefer `Date.now()` over `new Date().getTime()` / `+new Date()`.
611
+ *
612
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-date-now.md
613
+ */
614
+ "unicorn/prefer-date-now"?: TtscLintRuleSetting;
615
+ /**
616
+ * Prefer default parameter syntax over `x = x ?? default` reassignments
617
+ * inside the function body.
618
+ *
619
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-default-parameters.md
620
+ */
621
+ "unicorn/prefer-default-parameters"?: TtscLintRuleSetting;
622
+ /**
623
+ * Prefer `Node#append` over `Node#appendChild`.
624
+ *
625
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-append.md
626
+ */
627
+ "unicorn/prefer-dom-node-append"?: TtscLintRuleSetting;
628
+ /**
629
+ * Prefer `Element#dataset` over `getAttribute` / `setAttribute` for `data-*`
630
+ * attributes.
631
+ *
632
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-dataset.md
633
+ */
634
+ "unicorn/prefer-dom-node-dataset"?: TtscLintRuleSetting;
635
+ /**
636
+ * Prefer `ChildNode#remove` over `parent.removeChild(child)`.
637
+ *
638
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-remove.md
639
+ */
640
+ "unicorn/prefer-dom-node-remove"?: TtscLintRuleSetting;
641
+ /**
642
+ * Prefer `Node#textContent` over `HTMLElement#innerText`.
643
+ *
644
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-text-content.md
645
+ */
646
+ "unicorn/prefer-dom-node-text-content"?: TtscLintRuleSetting;
647
+ /**
648
+ * Prefer `EventTarget` over Node's `EventEmitter` when the code is shared
649
+ * between Node and the browser.
650
+ *
651
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-event-target.md
652
+ */
653
+ "unicorn/prefer-event-target"?: TtscLintRuleSetting;
654
+ /**
655
+ * Prefer `export ... from` over importing-then-re-exporting in two
656
+ * statements.
657
+ *
658
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-export-from.md
659
+ */
660
+ "unicorn/prefer-export-from"?: TtscLintRuleSetting;
661
+ /**
662
+ * Prefer `globalThis` over `window`, `self`, and `global`.
663
+ *
664
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-global-this.md
665
+ */
666
+ "unicorn/prefer-global-this"?: TtscLintRuleSetting;
667
+ /**
668
+ * Prefer `import.meta.dirname` / `import.meta.filename` over `fileURLToPath`
669
+ * workarounds.
670
+ *
671
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-import-meta-properties.md
672
+ */
673
+ "unicorn/prefer-import-meta-properties"?: TtscLintRuleSetting;
674
+ /**
675
+ * Prefer `String#includes` / `Array#includes` over `indexOf(...) !== -1` and
676
+ * `some(x => x === target)`.
677
+ *
678
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-includes.md
679
+ */
680
+ "unicorn/prefer-includes"?: TtscLintRuleSetting;
681
+ /**
682
+ * Prefer passing a `Buffer` directly to `JSON.parse` (Node 21+) instead of
683
+ * decoding to a string first.
684
+ *
685
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-json-parse-buffer.md
686
+ */
687
+ "unicorn/prefer-json-parse-buffer"?: TtscLintRuleSetting;
688
+ /**
689
+ * Prefer `KeyboardEvent#key` over the deprecated `KeyboardEvent#keyCode` /
690
+ * `charCode` / `which`.
691
+ *
692
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-keyboard-event-key.md
693
+ */
694
+ "unicorn/prefer-keyboard-event-key"?: TtscLintRuleSetting;
695
+ /**
696
+ * Prefer `a || b` / `a ?? b` over the equivalent ternary `a ? a : b`.
697
+ *
698
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-logical-operator-over-ternary.md
699
+ */
700
+ "unicorn/prefer-logical-operator-over-ternary"?: TtscLintRuleSetting;
701
+ /**
702
+ * Prefer `Math.min` / `Math.max` over ternaries computing the same value.
703
+ *
704
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-min-max.md
705
+ */
706
+ "unicorn/prefer-math-min-max"?: TtscLintRuleSetting;
707
+ /**
708
+ * Prefer `Math.trunc` over `~~x` / `x | 0` for integer truncation.
709
+ *
710
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-trunc.md
711
+ */
712
+ "unicorn/prefer-math-trunc"?: TtscLintRuleSetting;
713
+ /**
714
+ * Prefer `before` / `after` / `replaceWith` over `insertBefore` /
715
+ * `replaceChild` / `insertAdjacentText`.
716
+ *
717
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-dom-apis.md
718
+ */
719
+ "unicorn/prefer-modern-dom-apis"?: TtscLintRuleSetting;
720
+ /**
721
+ * Prefer `Math.log10` / `Math.hypot` / `Math.log2` / `Math.cbrt` over their
722
+ * legacy approximations.
723
+ *
724
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-math-apis.md
725
+ */
726
+ "unicorn/prefer-modern-math-apis"?: TtscLintRuleSetting;
727
+ /**
728
+ * Prefer ES modules (`import` / `export`) over CommonJS (`require` /
729
+ * `module.exports` / `__dirname` / `__filename`).
730
+ *
731
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-module.md
732
+ */
733
+ "unicorn/prefer-module"?: TtscLintRuleSetting;
734
+ /**
735
+ * Prefer the bare `String` / `Number` / `Boolean` / `BigInt` functions over
736
+ * `x => String(x)` arrow wrappers.
737
+ *
738
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-native-coercion-functions.md
739
+ */
740
+ "unicorn/prefer-native-coercion-functions"?: TtscLintRuleSetting;
741
+ /**
742
+ * Prefer negative-index lookups (`arr.at(-1)`, `arr.slice(-2)`) over
743
+ * `arr.length - 1` / `arr.length - 2` arithmetic.
744
+ *
745
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-negative-index.md
746
+ */
747
+ "unicorn/prefer-negative-index"?: TtscLintRuleSetting;
748
+ /**
749
+ * Prefer `node:fs` / `node:path` / etc. over the bare Node builtin specifier.
750
+ *
751
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
752
+ */
753
+ "unicorn/prefer-node-protocol"?: TtscLintRuleSetting;
754
+ /**
755
+ * Prefer `Number.isNaN` / `Number.parseInt` / `Number.NaN` over their global
756
+ * counterparts.
757
+ *
758
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-number-properties.md
759
+ */
760
+ "unicorn/prefer-number-properties"?: TtscLintRuleSetting;
761
+ /**
762
+ * Prefer `Object.fromEntries` over `reduce`-into-object patterns.
763
+ *
764
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-from-entries.md
765
+ */
766
+ "unicorn/prefer-object-from-entries"?: TtscLintRuleSetting;
767
+ /**
768
+ * Prefer `catch { ... }` over `catch (e) { ... }` when `e` is unused.
769
+ *
770
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-optional-catch-binding.md
771
+ */
772
+ "unicorn/prefer-optional-catch-binding"?: TtscLintRuleSetting;
773
+ /**
774
+ * Prefer borrowing prototype methods (`Array.prototype.slice.call`) over
775
+ * `[].slice.call` empty-instance lookups.
776
+ *
777
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-prototype-methods.md
778
+ */
779
+ "unicorn/prefer-prototype-methods"?: TtscLintRuleSetting;
780
+ /**
781
+ * Prefer `Document#querySelector` over `getElementById`,
782
+ * `getElementsByClassName`, and `getElementsByTagName`.
783
+ *
784
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-query-selector.md
785
+ */
786
+ "unicorn/prefer-query-selector"?: TtscLintRuleSetting;
787
+ /**
788
+ * Prefer `Reflect.apply(fn, thisArg, args)` over
789
+ * `Function.prototype.apply.call(fn, thisArg, args)`.
790
+ *
791
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-reflect-apply.md
792
+ */
793
+ "unicorn/prefer-reflect-apply"?: TtscLintRuleSetting;
794
+ /**
795
+ * Prefer `RegExp#test` over `String#match` / `RegExp#exec` when only a
796
+ * boolean is needed.
797
+ *
798
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-regexp-test.md
799
+ */
800
+ "unicorn/prefer-regexp-test"?: TtscLintRuleSetting;
801
+ /**
802
+ * Prefer `Response.json(value)` over `new Response( JSON.stringify(value), {
803
+ * headers: {"content-type": "application/json"} })`.
804
+ *
805
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-response-static-json.md
806
+ */
807
+ "unicorn/prefer-response-static-json"?: TtscLintRuleSetting;
808
+ /**
809
+ * Prefer `Set#has` over `Array#includes` for repeated membership lookups
810
+ * against a constant collection.
811
+ *
812
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-has.md
813
+ */
814
+ "unicorn/prefer-set-has"?: TtscLintRuleSetting;
815
+ /**
816
+ * Prefer `Set#size` over `[...set].length` and `Array.from(set).length`.
817
+ *
818
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-size.md
819
+ */
820
+ "unicorn/prefer-set-size"?: TtscLintRuleSetting;
821
+ /**
822
+ * Prefer the simpler operand on the left of `&&` / `||` so the short-circuit
823
+ * reads in evaluation order.
824
+ *
825
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-simple-condition-first.md
826
+ */
827
+ "unicorn/prefer-simple-condition-first"?: TtscLintRuleSetting;
828
+ /**
829
+ * Prefer a single `push` / `unshift` / `classList.add` / `addEventListener`
830
+ * with multiple arguments over consecutive single-argument calls.
831
+ *
832
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-single-call.md
833
+ */
834
+ "unicorn/prefer-single-call"?: TtscLintRuleSetting;
835
+ /**
836
+ * Prefer spread (`[...arr]`, `[...str]`) over `Array.from`,
837
+ * `Array.prototype.slice.call`, `concat([])`, and `split('')`.
838
+ *
839
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-spread.md
840
+ */
841
+ "unicorn/prefer-spread"?: TtscLintRuleSetting;
842
+ /**
843
+ * Prefer `String.raw` for path literals and other strings that would
844
+ * otherwise need backslash escapes.
845
+ *
846
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-raw.md
847
+ */
848
+ "unicorn/prefer-string-raw"?: TtscLintRuleSetting;
849
+ /**
850
+ * Prefer `String#replaceAll(literal, replacement)` over `replace(/literal/g,
851
+ * replacement)`.
852
+ *
853
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md
854
+ */
855
+ "unicorn/prefer-string-replace-all"?: TtscLintRuleSetting;
856
+ /**
857
+ * Prefer `String#slice` over the deprecated `substr` / `substring`.
858
+ *
859
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-slice.md
860
+ */
861
+ "unicorn/prefer-string-slice"?: TtscLintRuleSetting;
862
+ /**
863
+ * Prefer `String#startsWith` / `String#endsWith` over equivalent
864
+ * `RegExp#test` and slice-then-compare idioms.
865
+ *
866
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-starts-ends-with.md
867
+ */
868
+ "unicorn/prefer-string-starts-ends-with"?: TtscLintRuleSetting;
869
+ /**
870
+ * Prefer `String#trimStart` / `String#trimEnd` over the deprecated `trimLeft`
871
+ * / `trimRight`.
872
+ *
873
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-trim-start-end.md
874
+ */
875
+ "unicorn/prefer-string-trim-start-end"?: TtscLintRuleSetting;
876
+ /**
877
+ * Prefer `structuredClone(x)` over `JSON.parse(JSON.stringify(x))` for deep
878
+ * cloning.
879
+ *
880
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-structured-clone.md
881
+ */
882
+ "unicorn/prefer-structured-clone"?: TtscLintRuleSetting;
883
+ /**
884
+ * Prefer `switch` over chains of three or more `else if` clauses comparing
885
+ * the same discriminant.
886
+ *
887
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-switch.md
888
+ */
889
+ "unicorn/prefer-switch"?: TtscLintRuleSetting;
890
+ /**
891
+ * Prefer a ternary over `if` / `else` whose two branches differ only in the
892
+ * right-hand side of a common assignment, `return`, or `throw`.
893
+ *
894
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-ternary.md
895
+ */
896
+ "unicorn/prefer-ternary"?: TtscLintRuleSetting;
897
+ /**
898
+ * Prefer top-level `await` over `.then` / IIFE wrappers in ES modules.
899
+ *
900
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-top-level-await.md
901
+ */
902
+ "unicorn/prefer-top-level-await"?: TtscLintRuleSetting;
903
+ /**
904
+ * Require throwing `TypeError` (not a bare `Error`) when the surrounding `if`
905
+ * is a runtime type check.
906
+ *
907
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md
908
+ */
909
+ "unicorn/prefer-type-error"?: TtscLintRuleSetting;
910
+ /**
911
+ * Reject common identifier abbreviations (`btn`, `arr`, `idx`) and replace
912
+ * them with their long forms.
913
+ *
914
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prevent-abbreviations.md
915
+ */
916
+ "unicorn/prevent-abbreviations"?: TtscLintRuleSetting;
917
+ /**
918
+ * Enforce a single style (always leading `./` vs. never) for relative URLs
919
+ * passed to `new URL`.
920
+ *
921
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/relative-url-style.md
922
+ */
923
+ "unicorn/relative-url-style"?: TtscLintRuleSetting;
924
+ /**
925
+ * Require an explicit separator argument to `Array#join` instead of relying
926
+ * on the default `","`.
927
+ *
928
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-array-join-separator.md
929
+ */
930
+ "unicorn/require-array-join-separator"?: TtscLintRuleSetting;
931
+ /**
932
+ * Require non-empty `with` / `assert` options on `import` / `export`
933
+ * statements that use them at all.
934
+ *
935
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-module-attributes.md
936
+ */
937
+ "unicorn/require-module-attributes"?: TtscLintRuleSetting;
938
+ /**
939
+ * Require a non-empty specifier list on every `import` / `export` statement.
940
+ *
941
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-module-specifiers.md
942
+ */
943
+ "unicorn/require-module-specifiers"?: TtscLintRuleSetting;
944
+ /**
945
+ * Require an explicit digits argument to `Number#toFixed`.
946
+ *
947
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-number-to-fixed-digits-argument.md
948
+ */
949
+ "unicorn/require-number-to-fixed-digits-argument"?: TtscLintRuleSetting;
950
+ /**
951
+ * Require an explicit `targetOrigin` argument to `window.postMessage`.
952
+ *
953
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-post-message-target-origin.md
954
+ */
955
+ "unicorn/require-post-message-target-origin"?: TtscLintRuleSetting;
956
+ /**
957
+ * Enforce or replace configured string-content patterns (e.g., curly quotes
958
+ * for straight ones).
959
+ *
960
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/string-content.md
961
+ */
962
+ "unicorn/string-content"?: TtscLintRuleSetting;
963
+ /**
964
+ * Enforce a consistent presence/absence of `{}` braces around `case` clauses
965
+ * inside `switch`.
966
+ *
967
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-braces.md
968
+ */
969
+ "unicorn/switch-case-braces"?: TtscLintRuleSetting;
970
+ /**
971
+ * Enforce a consistent position for `break` (or `return` / `throw`) inside
972
+ * `case` clauses.
973
+ *
974
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-break-position.md
975
+ */
976
+ "unicorn/switch-case-break-position"?: TtscLintRuleSetting;
977
+ /**
978
+ * Re-indent the body of tagged template literals (`html`, `gql`, `sql`) to
979
+ * the indentation of the opening backtick.
980
+ *
981
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/template-indent.md
982
+ */
983
+ "unicorn/template-indent"?: TtscLintRuleSetting;
984
+ /**
985
+ * Enforce a canonical case for text-encoding identifiers — `"utf-8"` (not
986
+ * `"UTF-8"` / `"utf8"`).
987
+ *
988
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md
989
+ */
990
+ "unicorn/text-encoding-identifier-case"?: TtscLintRuleSetting;
991
+ /**
992
+ * Require `throw new Error(...)` over `throw Error(...)`.
993
+ *
994
+ * @reference https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md
995
+ */
996
+ "unicorn/throw-new-error"?: TtscLintRuleSetting;
997
+ }