@ttsc/lint 0.13.1 → 0.14.0-dev.20250530.1

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