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