@ttsc/lint 0.13.0 → 0.14.0-dev.20260528
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +948 -69
- package/lib/defaultFormat.d.ts +9 -6
- package/lib/defaultFormat.js +9 -6
- package/lib/defaultFormat.js.map +1 -1
- package/lib/index.d.ts +46 -0
- package/lib/index.js +60 -37
- package/lib/index.js.map +1 -1
- package/lib/structures/ITtscLintConfig.d.ts +12 -6
- package/lib/structures/{ITtscLintFormatConfig.d.ts → ITtscLintFormat.d.ts} +2 -2
- package/lib/structures/{TtscLintRuleMap.js → ITtscLintFormat.js} +1 -1
- package/lib/structures/ITtscLintFormat.js.map +1 -0
- package/lib/structures/TtscLintRuleSetting.d.ts +49 -0
- package/lib/structures/{TtscLintRuleOptions.js → TtscLintRuleSetting.js} +1 -1
- package/lib/structures/TtscLintRuleSetting.js.map +1 -0
- package/lib/structures/index.d.ts +3 -4
- package/lib/structures/index.js +3 -4
- package/lib/structures/index.js.map +1 -1
- package/lib/structures/rules/ITtscLintBoundariesRuleOptions.d.ts +104 -0
- package/lib/structures/rules/ITtscLintBoundariesRuleOptions.js +14 -0
- package/lib/structures/rules/ITtscLintBoundariesRuleOptions.js.map +1 -0
- package/lib/structures/rules/ITtscLintBoundariesRules.d.ts +79 -0
- package/lib/structures/rules/ITtscLintBoundariesRules.js +3 -0
- package/lib/structures/rules/ITtscLintBoundariesRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintContributorRules.d.ts +17 -0
- package/lib/structures/rules/ITtscLintContributorRules.js +3 -0
- package/lib/structures/rules/ITtscLintContributorRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintCoreRules.d.ts +1257 -0
- package/lib/structures/{ITtscLintFormatConfig.js → rules/ITtscLintCoreRules.js} +1 -1
- package/lib/structures/rules/ITtscLintCoreRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintCypressRuleOptions.d.ts +17 -0
- package/lib/structures/rules/ITtscLintCypressRuleOptions.js +10 -0
- package/lib/structures/rules/ITtscLintCypressRuleOptions.js.map +1 -0
- package/lib/structures/rules/ITtscLintCypressRules.d.ts +129 -0
- package/lib/structures/rules/ITtscLintCypressRules.js +3 -0
- package/lib/structures/rules/ITtscLintCypressRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintFunctionalRuleOptions.d.ts +157 -0
- package/lib/structures/rules/ITtscLintFunctionalRuleOptions.js +13 -0
- package/lib/structures/rules/ITtscLintFunctionalRuleOptions.js.map +1 -0
- package/lib/structures/rules/ITtscLintFunctionalRules.d.ts +167 -0
- package/lib/structures/rules/ITtscLintFunctionalRules.js +3 -0
- package/lib/structures/rules/ITtscLintFunctionalRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintJestRules.d.ts +201 -0
- package/lib/structures/rules/ITtscLintJestRules.js +3 -0
- package/lib/structures/rules/ITtscLintJestRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintJsdocRules.d.ts +140 -0
- package/lib/structures/rules/ITtscLintJsdocRules.js +3 -0
- package/lib/structures/rules/ITtscLintJsdocRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintJsxA11yRules.d.ts +302 -0
- package/lib/structures/rules/ITtscLintJsxA11yRules.js +3 -0
- package/lib/structures/rules/ITtscLintJsxA11yRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintNextjsRules.d.ts +185 -0
- package/lib/structures/rules/ITtscLintNextjsRules.js +3 -0
- package/lib/structures/rules/ITtscLintNextjsRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintPlaywrightRules.d.ts +330 -0
- package/lib/structures/rules/ITtscLintPlaywrightRules.js +3 -0
- package/lib/structures/rules/ITtscLintPlaywrightRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintPromiseRules.d.ts +188 -0
- package/lib/structures/rules/ITtscLintPromiseRules.js +3 -0
- package/lib/structures/rules/ITtscLintPromiseRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintReactPerfRuleOptions.d.ts +18 -0
- package/lib/structures/rules/ITtscLintReactPerfRuleOptions.js +8 -0
- package/lib/structures/rules/ITtscLintReactPerfRuleOptions.js.map +1 -0
- package/lib/structures/rules/ITtscLintReactPerfRules.d.ts +51 -0
- package/lib/structures/rules/ITtscLintReactPerfRules.js +3 -0
- package/lib/structures/rules/ITtscLintReactPerfRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintReactRuleOptions.d.ts +39 -0
- package/lib/structures/rules/ITtscLintReactRuleOptions.js +12 -0
- package/lib/structures/rules/ITtscLintReactRuleOptions.js.map +1 -0
- package/lib/structures/rules/ITtscLintReactRules.d.ts +289 -0
- package/lib/structures/rules/ITtscLintReactRules.js +3 -0
- package/lib/structures/rules/ITtscLintReactRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintRegexpRules.d.ts +190 -0
- package/lib/structures/rules/ITtscLintRegexpRules.js +3 -0
- package/lib/structures/rules/ITtscLintRegexpRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintRuleOptionsMap.d.ts +66 -0
- package/lib/structures/rules/ITtscLintRuleOptionsMap.js +3 -0
- package/lib/structures/rules/ITtscLintRuleOptionsMap.js.map +1 -0
- package/lib/structures/rules/ITtscLintRules.d.ts +55 -0
- package/lib/structures/{TtscLintRule.js → rules/ITtscLintRules.js} +1 -1
- package/lib/structures/rules/ITtscLintRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintSecurityRules.d.ts +148 -0
- package/lib/structures/rules/ITtscLintSecurityRules.js +3 -0
- package/lib/structures/rules/ITtscLintSecurityRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintSolidRules.d.ts +181 -0
- package/lib/structures/rules/ITtscLintSolidRules.js +3 -0
- package/lib/structures/rules/ITtscLintSolidRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintStorybookRuleOptions.d.ts +21 -0
- package/lib/structures/rules/ITtscLintStorybookRuleOptions.js +9 -0
- package/lib/structures/rules/ITtscLintStorybookRuleOptions.js.map +1 -0
- package/lib/structures/rules/ITtscLintStorybookRules.d.ts +174 -0
- package/lib/structures/rules/ITtscLintStorybookRules.js +3 -0
- package/lib/structures/rules/ITtscLintStorybookRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintTanstackQueryRules.d.ts +94 -0
- package/lib/structures/rules/ITtscLintTanstackQueryRules.js +3 -0
- package/lib/structures/rules/ITtscLintTanstackQueryRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintTestingLibraryRuleOptions.d.ts +22 -0
- package/lib/structures/rules/ITtscLintTestingLibraryRuleOptions.js +10 -0
- package/lib/structures/rules/ITtscLintTestingLibraryRuleOptions.js.map +1 -0
- package/lib/structures/rules/ITtscLintTestingLibraryRules.d.ts +310 -0
- package/lib/structures/rules/ITtscLintTestingLibraryRules.js +3 -0
- package/lib/structures/rules/ITtscLintTestingLibraryRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintTypeScriptRules.d.ts +1132 -0
- package/lib/structures/rules/ITtscLintTypeScriptRules.js +3 -0
- package/lib/structures/rules/ITtscLintTypeScriptRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintUnicornRules.d.ts +997 -0
- package/lib/structures/rules/ITtscLintUnicornRules.js +3 -0
- package/lib/structures/rules/ITtscLintUnicornRules.js.map +1 -0
- package/lib/structures/rules/ITtscLintVitestRules.d.ts +141 -0
- package/lib/structures/rules/ITtscLintVitestRules.js +3 -0
- package/lib/structures/rules/ITtscLintVitestRules.js.map +1 -0
- package/lib/structures/rules/index.d.ts +31 -0
- package/lib/structures/rules/index.js +48 -0
- package/lib/structures/rules/index.js.map +1 -0
- package/linthost/ast_helpers.go +30 -5
- package/linthost/compile.go +33 -2
- package/linthost/config.go +48 -17
- package/linthost/config_format.go +9 -9
- package/linthost/directives.go +67 -25
- package/linthost/dispatch.go +14 -3
- package/linthost/engine.go +160 -40
- package/linthost/fix.go +2 -2
- package/linthost/flags_gen.go +17 -15
- package/linthost/host.go +40 -3
- package/linthost/lsp.go +747 -0
- package/linthost/print_dispatch.go +2 -2
- package/linthost/print_nodes_function.go +2 -2
- package/linthost/print_nodes_object.go +1 -1
- package/linthost/rule_names.go +14 -0
- package/linthost/rules_arrays.go +2 -2
- package/linthost/rules_boundaries.go +532 -0
- package/linthost/rules_camelcase.go +133 -0
- package/linthost/rules_complexity.go +94 -0
- package/linthost/rules_consistent_return.go +130 -0
- package/linthost/rules_console.go +1 -1
- package/linthost/rules_core_extra.go +739 -0
- package/linthost/rules_curly.go +70 -0
- package/linthost/rules_cypress.go +608 -0
- package/linthost/rules_debugger.go +2 -2
- package/linthost/rules_default_case.go +39 -0
- package/linthost/rules_default_case_last.go +46 -0
- package/linthost/rules_dupes.go +3 -3
- package/linthost/rules_empty.go +3 -3
- package/linthost/rules_escape.go +44 -24
- package/linthost/rules_eval.go +2 -2
- package/linthost/rules_finally.go +2 -2
- package/linthost/rules_format_jsdoc.go +1 -1
- package/linthost/rules_format_print_width.go +9 -9
- package/linthost/rules_format_quotes.go +1 -1
- package/linthost/rules_format_semi.go +1 -1
- package/linthost/rules_format_sort_imports.go +1 -1
- package/linthost/rules_format_trailing_comma.go +1 -1
- package/linthost/rules_functional.go +967 -0
- package/linthost/rules_gap.go +24 -45
- package/linthost/rules_grouped_accessor_pairs.go +87 -0
- package/linthost/rules_guard_for_in.go +198 -0
- package/linthost/rules_id_length.go +77 -0
- package/linthost/rules_imports.go +70 -2
- package/linthost/rules_init_declarations.go +53 -0
- package/linthost/rules_jest.go +618 -0
- package/linthost/rules_jsdoc.go +502 -0
- package/linthost/rules_jsx_a11y.go +1264 -0
- package/linthost/rules_logic.go +12 -12
- package/linthost/rules_loops.go +1 -1
- package/linthost/rules_max_classes_per_file.go +58 -0
- package/linthost/rules_max_depth.go +83 -0
- package/linthost/rules_max_lines.go +101 -0
- package/linthost/rules_max_lines_per_function.go +57 -0
- package/linthost/rules_max_nested_callbacks.go +61 -0
- package/linthost/rules_max_params.go +49 -0
- package/linthost/rules_max_statements.go +59 -0
- package/linthost/rules_misc.go +1 -1
- package/linthost/rules_nextjs.go +697 -0
- package/linthost/rules_no_else_return.go +75 -0
- package/linthost/rules_no_empty_named_blocks.go +91 -0
- package/linthost/rules_no_extend_native.go +51 -0
- package/linthost/rules_no_import_assign.go +140 -0
- package/linthost/rules_no_invalid_this.go +52 -0
- package/linthost/rules_no_loop_func.go +85 -0
- package/linthost/rules_no_magic_numbers.go +123 -0
- package/linthost/rules_no_mixed_operators.go +80 -0
- package/linthost/rules_no_param_reassign.go +98 -0
- package/linthost/rules_no_redeclare.go +270 -0
- package/linthost/rules_no_restricted_imports.go +105 -0
- package/linthost/rules_no_restricted_syntax.go +49 -0
- package/linthost/rules_no_shadow.go +147 -0
- package/linthost/rules_no_unreachable.go +77 -0
- package/linthost/rules_no_useless_assignment.go +120 -0
- package/linthost/rules_no_useless_constructor.go +245 -0
- package/linthost/rules_no_useless_return.go +51 -0
- package/linthost/rules_params.go +1 -1
- package/linthost/rules_playwright.go +788 -0
- package/linthost/rules_prefer_arrow_callback.go +124 -0
- package/linthost/rules_prefer_destructuring.go +98 -0
- package/linthost/rules_prefer_named_capture_group.go +129 -0
- package/linthost/rules_prefer_rest_params.go +94 -0
- package/linthost/rules_problems.go +41 -30
- package/linthost/rules_promise.go +1128 -73
- package/linthost/rules_protos.go +2 -2
- package/linthost/rules_react.go +773 -0
- package/linthost/rules_react_extras.go +227 -0
- package/linthost/rules_react_hooks.go +848 -0
- package/linthost/rules_react_perf.go +293 -0
- package/linthost/rules_react_refresh.go +583 -0
- package/linthost/rules_regexp.go +410 -0
- package/linthost/rules_security.go +830 -0
- package/linthost/rules_self.go +2 -2
- package/linthost/rules_solid.go +1073 -0
- package/linthost/rules_sort_imports.go +69 -0
- package/linthost/rules_sort_keys.go +134 -0
- package/linthost/rules_storybook.go +1176 -0
- package/linthost/rules_strings.go +4 -4
- package/linthost/rules_suggestions.go +38 -38
- package/linthost/rules_tanstack_query.go +844 -0
- package/linthost/rules_testing_library.go +1204 -0
- package/linthost/rules_throw.go +1 -1
- package/linthost/rules_ts.go +19 -19
- package/linthost/rules_ts_async.go +399 -0
- package/linthost/rules_ts_class_literal_property_style.go +115 -0
- package/linthost/rules_ts_consistent_type_exports.go +256 -0
- package/linthost/rules_ts_explicit_function_return_type.go +67 -0
- package/linthost/rules_ts_extra.go +155 -36
- package/linthost/rules_ts_no_base_to_string.go +218 -0
- package/linthost/rules_ts_no_confusing_void.go +72 -0
- package/linthost/rules_ts_no_deprecated.go +195 -0
- package/linthost/rules_ts_no_for_in_array.go +84 -0
- package/linthost/rules_ts_no_magic_numbers.go +124 -0
- package/linthost/rules_ts_no_meaningless_void_operator.go +84 -0
- package/linthost/rules_ts_no_misused_spread.go +104 -0
- package/linthost/rules_ts_no_redundant_type_constituents.go +113 -0
- package/linthost/rules_ts_no_restricted_types.go +62 -0
- package/linthost/rules_ts_no_unnecessary_boolean_literal_compare.go +129 -0
- package/linthost/rules_ts_no_unnecessary_condition.go +250 -0
- package/linthost/rules_ts_no_unnecessary_qualifier.go +118 -0
- package/linthost/rules_ts_no_unnecessary_template_expression.go +178 -0
- package/linthost/rules_ts_no_unnecessary_type_arguments.go +234 -0
- package/linthost/rules_ts_no_unnecessary_type_assertion.go +157 -0
- package/linthost/rules_ts_no_unsafe_argument.go +82 -0
- package/linthost/rules_ts_no_unsafe_assignment.go +102 -0
- package/linthost/rules_ts_no_unsafe_call.go +82 -0
- package/linthost/rules_ts_no_unsafe_enum_comparison.go +235 -0
- package/linthost/rules_ts_no_unsafe_member_access.go +58 -0
- package/linthost/rules_ts_no_unsafe_return.go +126 -0
- package/linthost/rules_ts_no_unsafe_unary_minus.go +81 -0
- package/linthost/rules_ts_no_useless_constructor.go +52 -0
- package/linthost/rules_ts_non_nullable_type_assertion_style.go +108 -0
- package/linthost/rules_ts_parameter_properties.go +38 -0
- package/linthost/rules_ts_prefer_find.go +178 -0
- package/linthost/rules_ts_prefer_includes.go +255 -0
- package/linthost/rules_ts_prefer_nullish_coalescing.go +104 -0
- package/linthost/rules_ts_prefer_optional_chain.go +228 -0
- package/linthost/rules_ts_prefer_promise_reject_errors.go +176 -0
- package/linthost/rules_ts_prefer_readonly.go +73 -0
- package/linthost/rules_ts_prefer_reduce_type_parameter.go +116 -0
- package/linthost/rules_ts_prefer_regexp_exec.go +122 -0
- package/linthost/rules_ts_prefer_return_this_type.go +135 -0
- package/linthost/rules_ts_prefer_string_starts_ends_with.go +360 -0
- package/linthost/rules_ts_promise_function_async.go +77 -0
- package/linthost/rules_ts_related_getter_setter_pairs.go +113 -0
- package/linthost/rules_ts_require_array_sort_compare.go +96 -0
- package/linthost/rules_ts_restrict_plus_operands.go +127 -0
- package/linthost/rules_ts_restrict_template_expressions.go +95 -0
- package/linthost/rules_ts_simple.go +387 -0
- package/linthost/rules_ts_sort_type_constituents.go +144 -0
- package/linthost/rules_ts_strict_boolean_expressions.go +157 -0
- package/linthost/rules_ts_switch_exhaustiveness_check.go +147 -0
- package/linthost/rules_ts_unbound_method.go +126 -0
- package/linthost/rules_tsdoc.go +136 -0
- package/linthost/rules_unicorn_better_regex.go +27 -0
- package/linthost/rules_unicorn_catch_error_name.go +46 -0
- package/linthost/rules_unicorn_consistent_assert.go +47 -0
- package/linthost/rules_unicorn_consistent_date_clone.go +54 -0
- package/linthost/rules_unicorn_consistent_destructuring.go +25 -0
- package/linthost/rules_unicorn_consistent_empty_array_spread.go +62 -0
- package/linthost/rules_unicorn_consistent_existence_index_check.go +80 -0
- package/linthost/rules_unicorn_consistent_function_scoping.go +25 -0
- package/linthost/rules_unicorn_consistent_template_literal_escape.go +25 -0
- package/linthost/rules_unicorn_custom_error_definition.go +138 -0
- package/linthost/rules_unicorn_empty_brace_spaces.go +73 -0
- package/linthost/rules_unicorn_error_message.go +64 -0
- package/linthost/rules_unicorn_escape_case.go +51 -0
- package/linthost/rules_unicorn_expiring_todo_comments.go +78 -0
- package/linthost/rules_unicorn_explicit_length_check.go +88 -0
- package/linthost/rules_unicorn_filename_case.go +29 -0
- package/linthost/rules_unicorn_import_style.go +28 -0
- package/linthost/rules_unicorn_isolated_functions.go +29 -0
- package/linthost/rules_unicorn_new_for_builtins.go +87 -0
- package/linthost/rules_unicorn_no_abusive_eslint_disable.go +63 -0
- package/linthost/rules_unicorn_no_accessor_recursion.go +115 -0
- package/linthost/rules_unicorn_no_anonymous_default_export.go +74 -0
- package/linthost/rules_unicorn_no_array_callback_reference.go +65 -0
- package/linthost/rules_unicorn_no_array_for_each.go +40 -0
- package/linthost/rules_unicorn_no_array_method_this_argument.go +61 -0
- package/linthost/rules_unicorn_no_array_reduce.go +41 -0
- package/linthost/rules_unicorn_no_array_reverse.go +44 -0
- package/linthost/rules_unicorn_no_array_sort.go +43 -0
- package/linthost/rules_unicorn_no_await_expression_member.go +40 -0
- package/linthost/rules_unicorn_no_await_in_promise_methods.go +69 -0
- package/linthost/rules_unicorn_no_console_spaces.go +61 -0
- package/linthost/rules_unicorn_no_document_cookie.go +41 -0
- package/linthost/rules_unicorn_no_empty_file.go +44 -0
- package/linthost/rules_unicorn_no_for_loop.go +102 -0
- package/linthost/rules_unicorn_no_hex_escape.go +42 -0
- package/linthost/rules_unicorn_no_immediate_mutation.go +90 -0
- package/linthost/rules_unicorn_no_instanceof_builtins.go +66 -0
- package/linthost/rules_unicorn_no_invalid_fetch_options.go +79 -0
- package/linthost/rules_unicorn_no_invalid_remove_event_listener.go +51 -0
- package/linthost/rules_unicorn_no_keyword_prefix.go +101 -0
- package/linthost/rules_unicorn_no_lonely_if.go +44 -0
- package/linthost/rules_unicorn_no_magic_array_flat_depth.go +51 -0
- package/linthost/rules_unicorn_no_named_default.go +54 -0
- package/linthost/rules_unicorn_no_negated_condition.go +85 -0
- package/linthost/rules_unicorn_no_negation_in_equality_check.go +50 -0
- package/linthost/rules_unicorn_no_nested_ternary.go +43 -0
- package/linthost/rules_unicorn_no_new_array.go +30 -0
- package/linthost/rules_unicorn_no_new_buffer.go +31 -0
- package/linthost/rules_unicorn_no_null.go +24 -0
- package/linthost/rules_unicorn_no_object_as_default_parameter.go +48 -0
- package/linthost/rules_unicorn_no_process_exit.go +43 -0
- package/linthost/rules_unicorn_no_single_promise_in_promise_methods.go +59 -0
- package/linthost/rules_unicorn_no_static_only_class.go +56 -0
- package/linthost/rules_unicorn_no_thenable.go +74 -0
- package/linthost/rules_unicorn_no_this_assignment.go +35 -0
- package/linthost/rules_unicorn_no_typeof_undefined.go +58 -0
- package/linthost/rules_unicorn_no_unnecessary_array_flat_depth.go +49 -0
- package/linthost/rules_unicorn_no_unnecessary_array_splice_count.go +70 -0
- package/linthost/rules_unicorn_no_unnecessary_await.go +51 -0
- package/linthost/rules_unicorn_no_unnecessary_polyfills.go +32 -0
- package/linthost/rules_unicorn_no_unnecessary_slice_end.go +48 -0
- package/linthost/rules_unicorn_no_unreadable_array_destructuring.go +115 -0
- package/linthost/rules_unicorn_no_unreadable_iife.go +50 -0
- package/linthost/rules_unicorn_no_unused_properties.go +30 -0
- package/linthost/rules_unicorn_no_useless_collection_argument.go +63 -0
- package/linthost/rules_unicorn_no_useless_error_capture_stack_trace.go +46 -0
- package/linthost/rules_unicorn_no_useless_fallback_in_spread.go +81 -0
- package/linthost/rules_unicorn_no_useless_iterator_to_array.go +72 -0
- package/linthost/rules_unicorn_no_useless_length_check.go +144 -0
- package/linthost/rules_unicorn_no_useless_promise_resolve_reject.go +81 -0
- package/linthost/rules_unicorn_no_useless_spread.go +67 -0
- package/linthost/rules_unicorn_no_useless_switch_case.go +55 -0
- package/linthost/rules_unicorn_no_useless_undefined.go +55 -0
- package/linthost/rules_unicorn_no_zero_fractions.go +52 -0
- package/linthost/rules_unicorn_number_literal_case.go +69 -0
- package/linthost/rules_unicorn_numeric_separators_style.go +75 -0
- package/linthost/rules_unicorn_prefer_add_event_listener.go +66 -0
- package/linthost/rules_unicorn_prefer_array_find.go +51 -0
- package/linthost/rules_unicorn_prefer_array_flat.go +52 -0
- package/linthost/rules_unicorn_prefer_array_flat_map.go +63 -0
- package/linthost/rules_unicorn_prefer_array_index_of.go +147 -0
- package/linthost/rules_unicorn_prefer_array_some.go +67 -0
- package/linthost/rules_unicorn_prefer_at.go +77 -0
- package/linthost/rules_unicorn_prefer_bigint_literals.go +77 -0
- package/linthost/rules_unicorn_prefer_blob_reading_methods.go +44 -0
- package/linthost/rules_unicorn_prefer_class_fields.go +93 -0
- package/linthost/rules_unicorn_prefer_classlist_toggle.go +120 -0
- package/linthost/rules_unicorn_prefer_code_point.go +49 -0
- package/linthost/rules_unicorn_prefer_date_now.go +78 -0
- package/linthost/rules_unicorn_prefer_default_parameters.go +144 -0
- package/linthost/rules_unicorn_prefer_dom_node_append.go +40 -0
- package/linthost/rules_unicorn_prefer_dom_node_dataset.go +55 -0
- package/linthost/rules_unicorn_prefer_dom_node_remove.go +41 -0
- package/linthost/rules_unicorn_prefer_dom_node_text_content.go +37 -0
- package/linthost/rules_unicorn_prefer_event_target.go +36 -0
- package/linthost/rules_unicorn_prefer_export_from.go +129 -0
- package/linthost/rules_unicorn_prefer_global_this.go +127 -0
- package/linthost/rules_unicorn_prefer_import_meta_properties.go +66 -0
- package/linthost/rules_unicorn_prefer_includes.go +149 -0
- package/linthost/rules_unicorn_prefer_json_parse_buffer.go +65 -0
- package/linthost/rules_unicorn_prefer_keyboard_event_key.go +38 -0
- package/linthost/rules_unicorn_prefer_logical_operator_over_ternary.go +48 -0
- package/linthost/rules_unicorn_prefer_math_min_max.go +60 -0
- package/linthost/rules_unicorn_prefer_math_trunc.go +62 -0
- package/linthost/rules_unicorn_prefer_modern_dom_apis.go +47 -0
- package/linthost/rules_unicorn_prefer_modern_math_apis.go +70 -0
- package/linthost/rules_unicorn_prefer_module.go +50 -0
- package/linthost/rules_unicorn_prefer_native_coercion_functions.go +114 -0
- package/linthost/rules_unicorn_prefer_negative_index.go +74 -0
- package/linthost/rules_unicorn_prefer_node_protocol.go +122 -0
- package/linthost/rules_unicorn_prefer_number_properties.go +88 -0
- package/linthost/rules_unicorn_prefer_object_from_entries.go +55 -0
- package/linthost/rules_unicorn_prefer_optional_catch_binding.go +62 -0
- package/linthost/rules_unicorn_prefer_prototype_methods.go +54 -0
- package/linthost/rules_unicorn_prefer_query_selector.go +56 -0
- package/linthost/rules_unicorn_prefer_reflect_apply.go +36 -0
- package/linthost/rules_unicorn_prefer_regexp_test_rule.go +80 -0
- package/linthost/rules_unicorn_prefer_response_static_json.go +53 -0
- package/linthost/rules_unicorn_prefer_set_has.go +42 -0
- package/linthost/rules_unicorn_prefer_set_size.go +48 -0
- package/linthost/rules_unicorn_prefer_simple_condition_first.go +34 -0
- package/linthost/rules_unicorn_prefer_single_call.go +96 -0
- package/linthost/rules_unicorn_prefer_spread.go +51 -0
- package/linthost/rules_unicorn_prefer_string_raw.go +43 -0
- package/linthost/rules_unicorn_prefer_string_replace_all.go +95 -0
- package/linthost/rules_unicorn_prefer_string_slice.go +43 -0
- package/linthost/rules_unicorn_prefer_string_starts_ends_with.go +148 -0
- package/linthost/rules_unicorn_prefer_string_trim_start_end.go +48 -0
- package/linthost/rules_unicorn_prefer_structured_clone.go +71 -0
- package/linthost/rules_unicorn_prefer_switch.go +103 -0
- package/linthost/rules_unicorn_prefer_ternary.go +71 -0
- package/linthost/rules_unicorn_prefer_top_level_await.go +72 -0
- package/linthost/rules_unicorn_prefer_type_error.go +127 -0
- package/linthost/rules_unicorn_prevent_abbreviations.go +127 -0
- package/linthost/rules_unicorn_relative_url_style.go +49 -0
- package/linthost/rules_unicorn_require_array_join_separator.go +45 -0
- package/linthost/rules_unicorn_require_module_attributes.go +54 -0
- package/linthost/rules_unicorn_require_module_specifiers.go +55 -0
- package/linthost/rules_unicorn_require_number_to_fixed_digits_argument.go +43 -0
- package/linthost/rules_unicorn_require_post_message_target_origin.go +44 -0
- package/linthost/rules_unicorn_string_content.go +27 -0
- package/linthost/rules_unicorn_switch_case_braces.go +42 -0
- package/linthost/rules_unicorn_switch_case_break_position.go +31 -0
- package/linthost/rules_unicorn_template_indent.go +28 -0
- package/linthost/rules_unicorn_text_encoding_identifier_case.go +72 -0
- package/linthost/rules_unicorn_throw_new_error.go +61 -0
- package/linthost/rules_var.go +10 -4
- package/linthost/rules_vitest.go +568 -0
- package/package.json +3 -3
- package/plugin/main.go +49 -3
- package/rule/astutil/astutil.go +10 -3
- package/rule/rule.go +12 -10
- package/src/defaultFormat.ts +11 -8
- package/src/index.ts +65 -43
- package/src/structures/ITtscLintConfig.ts +12 -6
- package/src/structures/{ITtscLintFormatConfig.ts → ITtscLintFormat.ts} +2 -2
- package/src/structures/TtscLintRuleSetting.ts +55 -0
- package/src/structures/index.ts +3 -4
- package/src/structures/rules/ITtscLintBoundariesRuleOptions.ts +128 -0
- package/src/structures/rules/ITtscLintBoundariesRules.ts +95 -0
- package/src/structures/rules/ITtscLintContributorRules.ts +21 -0
- package/src/structures/rules/ITtscLintCoreRules.ts +1406 -0
- package/src/structures/rules/ITtscLintCypressRuleOptions.ts +18 -0
- package/src/structures/rules/ITtscLintCypressRules.ts +145 -0
- package/src/structures/rules/ITtscLintFunctionalRuleOptions.ts +213 -0
- package/src/structures/rules/ITtscLintFunctionalRules.ts +202 -0
- package/src/structures/rules/ITtscLintJestRules.ts +220 -0
- package/src/structures/rules/ITtscLintJsdocRules.ts +153 -0
- package/src/structures/rules/ITtscLintJsxA11yRules.ts +339 -0
- package/src/structures/rules/ITtscLintNextjsRules.ts +206 -0
- package/src/structures/rules/ITtscLintPlaywrightRules.ts +361 -0
- package/src/structures/rules/ITtscLintPromiseRules.ts +205 -0
- package/src/structures/rules/ITtscLintReactPerfRuleOptions.ts +19 -0
- package/src/structures/rules/ITtscLintReactPerfRules.ts +55 -0
- package/src/structures/rules/ITtscLintReactRuleOptions.ts +43 -0
- package/src/structures/rules/ITtscLintReactRules.ts +321 -0
- package/src/structures/rules/ITtscLintRegexpRules.ts +212 -0
- package/src/structures/rules/ITtscLintRuleOptionsMap.ts +89 -0
- package/src/structures/rules/ITtscLintRules.ts +77 -0
- package/src/structures/rules/ITtscLintSecurityRules.ts +162 -0
- package/src/structures/rules/ITtscLintSolidRules.ts +202 -0
- package/src/structures/rules/ITtscLintStorybookRuleOptions.ts +23 -0
- package/src/structures/rules/ITtscLintStorybookRules.ts +193 -0
- package/src/structures/rules/ITtscLintTanstackQueryRules.ts +102 -0
- package/src/structures/rules/ITtscLintTestingLibraryRuleOptions.ts +24 -0
- package/src/structures/rules/ITtscLintTestingLibraryRules.ts +342 -0
- package/src/structures/rules/ITtscLintTypeScriptRules.ts +1230 -0
- package/src/structures/rules/ITtscLintUnicornRules.ts +1143 -0
- package/src/structures/rules/ITtscLintVitestRules.ts +154 -0
- package/src/structures/rules/index.ts +31 -0
- package/lib/structures/ITtscLintFormatConfig.js.map +0 -1
- package/lib/structures/TtscLintRule.d.ts +0 -17
- package/lib/structures/TtscLintRule.js.map +0 -1
- package/lib/structures/TtscLintRuleMap.d.ts +0 -46
- package/lib/structures/TtscLintRuleMap.js.map +0 -1
- package/lib/structures/TtscLintRuleOptions.d.ts +0 -137
- package/lib/structures/TtscLintRuleOptions.js.map +0 -1
- package/src/structures/TtscLintRule.ts +0 -160
- package/src/structures/TtscLintRuleMap.ts +0 -55
- package/src/structures/TtscLintRuleOptions.ts +0 -151
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
A linter and formatter. Co-protagonist of the [`ttsc`](https://ttsc.dev) toolchain — paired with `ttsc`, it replaces `eslint` and `prettier`.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
720+ rules across 21 families. Lint violations surface as `error TSxxxxx` from a single compile pass; the formatter applies via `ttsc format`.
|
|
15
15
|
|
|
16
16
|
## Demonstration
|
|
17
17
|
|
|
@@ -71,7 +71,7 @@ export default {
|
|
|
71
71
|
rules: {
|
|
72
72
|
"no-var": "error",
|
|
73
73
|
"prefer-const": "error",
|
|
74
|
-
"no-explicit-any": "warning",
|
|
74
|
+
"typescript/no-explicit-any": "warning",
|
|
75
75
|
"no-console": "off",
|
|
76
76
|
},
|
|
77
77
|
} satisfies ITtscLintConfig;
|
|
@@ -86,9 +86,7 @@ npx ttsx src/index.ts
|
|
|
86
86
|
|
|
87
87
|
Errors fail the command; warnings print without affecting the exit code. Under `ttsx`, errors stop the program before your entrypoint runs.
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
`ttsc fix` applies every autofix the enabled rules offer — lint and format together — writes results back to disk, then re-runs type-check + lint. `ttsc format` runs the `format/*` subset through the same dataflow.
|
|
89
|
+
`ttsc fix` applies every autofix the enabled rules offer — lint and format together — writes results back to disk, then re-runs type-check + lint. `ttsc format` runs the format rule set through the same dataflow.
|
|
92
90
|
|
|
93
91
|
```bash
|
|
94
92
|
npx ttsc fix
|
|
@@ -97,19 +95,14 @@ npx ttsc format
|
|
|
97
95
|
|
|
98
96
|
`ttsc fix` is a one-shot project pass and rejects `--watch`, single-file mode, and `--emit`. Fixes are written to disk before the recheck runs, so source stays modified even when the command exits non-zero on remaining errors. Recommended flow: run `ttsc fix` locally, commit, then have CI run `ttsc --noEmit` to gate on zero remaining errors.
|
|
99
97
|
|
|
100
|
-
##
|
|
101
|
-
|
|
102
|
-
Two top-level keys in `lint.config.ts`:
|
|
103
|
-
|
|
104
|
-
- `format` is a Prettier-style block that drives the `format/*` autofixes. Format diagnostics are warnings and do not define compile failure policy.
|
|
105
|
-
- `rules` sets severity per lint rule. `"error"` fails the build; `"warning"` prints without affecting the exit code; `"off"` disables the rule.
|
|
98
|
+
## Format
|
|
106
99
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
The `format` block in `lint.config.ts` configures the formatter. Keys mirror `.prettierrc`:
|
|
100
|
+
Configure the formatter through the `format` block in `lint.config.ts`. Keys mirror `.prettierrc`; the presence of the block — even empty `format: {}` — enables the always-on format rules at Prettier defaults so `ttsc format` rewrites your source to match.
|
|
110
101
|
|
|
111
102
|
```ts
|
|
112
103
|
// lint.config.ts
|
|
104
|
+
import type { ITtscLintConfig } from "@ttsc/lint";
|
|
105
|
+
|
|
113
106
|
export default {
|
|
114
107
|
format: {
|
|
115
108
|
printWidth: 100,
|
|
@@ -122,33 +115,34 @@ export default {
|
|
|
122
115
|
} satisfies ITtscLintConfig;
|
|
123
116
|
```
|
|
124
117
|
|
|
125
|
-
|
|
118
|
+
`ttsc check` does **not** fail on formatting by default — it surfaces format diagnostics only when you opt in with `format.severity`. `ttsc format` runs the active format rules across the project and writes results to disk regardless of `severity`.
|
|
126
119
|
|
|
127
|
-
Each `format` key
|
|
120
|
+
Each `format` config key activates one rule:
|
|
128
121
|
|
|
129
|
-
|
|
|
122
|
+
| Config key | Rule | Effect |
|
|
130
123
|
| --- | --- | --- |
|
|
131
|
-
|
|
|
132
|
-
| `
|
|
133
|
-
| `
|
|
134
|
-
| `format/trailing-comma` |
|
|
135
|
-
| `
|
|
136
|
-
| `
|
|
137
|
-
| `
|
|
124
|
+
| `severity` (default `"off"`) | applies to every format rule | Sets the check-time diagnostic level. Does not gate `ttsc format` — that runs all active rules. |
|
|
125
|
+
| `semi` | `format/semi` | Insert trailing semicolons on ASI-terminated statements. |
|
|
126
|
+
| `singleQuote` | `format/quotes` | Convert quoted strings to the preferred quote style. |
|
|
127
|
+
| `trailingComma` | `format/trailing-comma` | Add trailing commas to multi-line lists. |
|
|
128
|
+
| `printWidth`, `tabWidth`, `useTabs`, `endOfLine` | `format/print-width` | Column-aware line reflow. Object/array literals, call/new arguments, and named import/export clauses break across lines when their flat form overflows the budget. |
|
|
129
|
+
| `importOrder` (opt-in) | `format/sort-imports` | Group external/relative imports and alphabetize each group + its specifiers. |
|
|
130
|
+
| `jsdoc` (opt-in) | `format/jsdoc` | Normalize JSDoc blocks toward [prettier-plugin-jsdoc](https://github.com/hosseinmd/prettier-plugin-jsdoc). |
|
|
138
131
|
|
|
139
|
-
`format/sort-imports` and `format/jsdoc` are **opt-in
|
|
132
|
+
`format/sort-imports` and `format/jsdoc` are **opt-in** — they only activate when you set `importOrder` or `jsdoc`. Every other format rule turns on automatically as soon as the `format` block is present.
|
|
140
133
|
|
|
141
|
-
To
|
|
134
|
+
To override a single format rule, drop a sibling `rules` entry — `rules` wins on conflict:
|
|
142
135
|
|
|
143
136
|
```ts
|
|
144
137
|
export default {
|
|
145
138
|
format: { severity: "warning", semi: true },
|
|
146
|
-
rules: { "format/semi": "off" },
|
|
139
|
+
rules: { "format/semi": "off" }, // overrides format.semi for this one rule
|
|
147
140
|
} satisfies ITtscLintConfig;
|
|
148
141
|
```
|
|
149
|
-
### Rules
|
|
150
142
|
|
|
151
|
-
Rules
|
|
143
|
+
## Rules
|
|
144
|
+
|
|
145
|
+
Lint rules are off until you enable them in `lint.config.ts`. Severity values: `"error"` fails the build, `"warning"` prints without affecting the exit code, `"off"` disables the rule.
|
|
152
146
|
|
|
153
147
|
```ts
|
|
154
148
|
// lint.config.ts
|
|
@@ -157,119 +151,175 @@ export default {
|
|
|
157
151
|
"no-var": "error",
|
|
158
152
|
"eqeqeq": "error",
|
|
159
153
|
"prefer-template": "warning",
|
|
160
|
-
"no-non-null-assertion": "off",
|
|
154
|
+
"typescript/no-non-null-assertion": "off",
|
|
161
155
|
},
|
|
162
156
|
} satisfies ITtscLintConfig;
|
|
163
157
|
```
|
|
164
158
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
159
|
+
Rule IDs use ESLint-style kebab-case and slash namespaces — `no-var`, `react/jsx-key`, `testing-library/prefer-screen-queries`. The exported `ITtscLintRules` type is the intersection of family-specific interfaces such as `ITtscLintCoreRules`, `ITtscLintTypeScriptRules`, `ITtscLintReactRules`, and `ITtscLintVitestRules`, so users can type a whole config or a narrower family-shaped object.
|
|
160
|
+
|
|
161
|
+
Each rule below links to its TypeScript fixture under [`tests/test-lint/src/cases/`](https://github.com/samchon/ttsc/tree/master/tests/test-lint/src/cases).
|
|
162
|
+
|
|
163
|
+
<!--
|
|
164
|
+
AGENT INSTRUCTIONS — adding a new rule family or a new rule.
|
|
165
|
+
|
|
166
|
+
Family section shape (one `### <Family display name>` heading per family, alphabetical
|
|
167
|
+
by display name):
|
|
168
|
+
|
|
169
|
+
### <Family display name>
|
|
170
|
+
|
|
171
|
+
<One-sentence summary of what this family covers — the "what".>
|
|
172
|
+
|
|
173
|
+
<One short paragraph elaborating — the "why" / scope notes / known limits.>
|
|
174
|
+
|
|
175
|
+
Source: [`<upstream-package>`](https://github.com/<org>/<repo>), [optional second source](https://…).
|
|
176
|
+
|
|
177
|
+
- [`<rule-id>`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/<fixture-name>.ts): <short description ending in a period>.
|
|
178
|
+
|
|
179
|
+
Rules:
|
|
180
|
+
|
|
181
|
+
- Bullet shape is `- [\`<rule-id>\`](url): description.` — colon as separator, lowercase
|
|
182
|
+
description, ending in a period. No em-dash separator. Bullets sort alphabetically
|
|
183
|
+
by rule id within the family.
|
|
184
|
+
- The fixture path is `tests/test-lint/src/cases/<rule-id>.ts` for core rules,
|
|
185
|
+
`tests/test-lint/src/cases/<family>-<rule-id>.ts(x)` for namespaced families
|
|
186
|
+
(`.tsx` only when the snippet uses JSX). Create the fixture before linking.
|
|
187
|
+
- Do NOT put license parentheticals on the `Source:` line (e.g. ` (MIT)`,
|
|
188
|
+
` (BSD-3-Clause)`). Reader can click the link and see for themselves.
|
|
189
|
+
- Do NOT mention Go test files. Every bullet links to a `tests/test-lint/src/cases/`
|
|
190
|
+
fixture; if a fixture does not exist yet, create one before adding the bullet.
|
|
191
|
+
- Update both this README **and** `website/src/content/docs/lint/rules/<family>.mdx`
|
|
192
|
+
in the same change. The mdx file uses em-dash bullets (`- \`<rule-id>\` — <desc>.`)
|
|
193
|
+
rather than the README colon form, but the rule list itself must stay in sync.
|
|
194
|
+
- After landing the bullet, append the upstream plugin link to the `## References`
|
|
195
|
+
section below and update its `### Claim ownership` paragraph if a new family
|
|
196
|
+
joined the family list.
|
|
197
|
+
-->
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
### ESLint core
|
|
201
|
+
|
|
202
|
+
Generic ESLint-compatible rules that apply to both JavaScript and TypeScript source. Every rule listed here corresponds 1-to-1 with an ESLint core rule of the same kebab-case id, so projects migrating from ESLint can paste their rule severities into `lint.config.ts` without renaming anything. TypeScript-only rules and `@typescript-eslint` extensions live under `typescript/*` in [TypeScript](#typescript) — `@ttsc/lint` does not accept legacy bare names or `@typescript-eslint/*` aliases for those.
|
|
203
|
+
|
|
204
|
+
Source: [ESLint core rules](https://eslint.org/docs/latest/rules/).
|
|
205
|
+
|
|
206
|
+
- [`camelcase`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/camelcase.ts): reject identifier declarations that aren't camelCase or PascalCase — snake_case bindings are flagged.
|
|
207
|
+
- [`complexity`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/complexity.ts): reject function bodies whose cyclomatic complexity exceeds twenty (default ESLint threshold).
|
|
208
|
+
- [`consistent-return`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/consistent-return.ts): reject functions where some `return` statements return a value and others fall through without one.
|
|
209
|
+
- [`curly`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/curly.ts): require block statements for every `if`, `else`, `while`, `for`, and `do` body — reject the single-statement shorthand.
|
|
210
|
+
- [`default-case`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/default-case.ts): require `switch` statements to include a `default` clause.
|
|
211
|
+
- [`default-case-last`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/default-case-last.ts): require the `default` clause of a `switch` statement to appear last.
|
|
176
212
|
- [`default-param-last`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/default-param-last.ts): keeps parameters with default values at the end of the list.
|
|
177
213
|
- [`dot-notation`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/dot-notation.ts): prefers dot property access when a string-literal key is a valid identifier.
|
|
178
214
|
- [`eqeqeq`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/eqeqeq.ts): requires strict equality operators.
|
|
179
215
|
- [`for-direction`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/for-direction.ts): catches loop counters updated in the wrong direction.
|
|
216
|
+
- [`getter-return`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/getter-return.ts): require a `get` accessor's body to return a value on every reachable exit.
|
|
217
|
+
- [`grouped-accessor-pairs`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/grouped-accessor-pairs.ts): require the `get` and `set` accessors of a property to be declared adjacent in the class body.
|
|
218
|
+
- [`guard-for-in`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/guard-for-in.ts): require `for...in` bodies to guard against inherited keys with `Object.hasOwn` or `Object.prototype.hasOwnProperty.call`.
|
|
219
|
+
- [`id-length`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/id-length.ts): reject identifier names shorter than two characters.
|
|
220
|
+
- [`init-declarations`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/init-declarations.ts): require every `var` / `let` declaration to be initialized at its declaration site.
|
|
221
|
+
- [`max-classes-per-file`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/max-classes-per-file.ts): reject a source file that declares more than one class.
|
|
222
|
+
- [`max-depth`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/max-depth.ts): reject block-statement nesting deeper than four levels inside a function.
|
|
223
|
+
- [`max-lines`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/max-lines.ts): reject a source file whose total line count exceeds three hundred.
|
|
224
|
+
- [`max-lines-per-function`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/max-lines-per-function.ts): reject a function whose body spans more than fifty lines.
|
|
225
|
+
- [`max-nested-callbacks`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/max-nested-callbacks.ts): reject callback nesting deeper than ten inside a single function.
|
|
226
|
+
- [`max-params`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/max-params.ts): reject function declarations with more than three parameters.
|
|
227
|
+
- [`max-statements`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/max-statements.ts): reject function bodies whose statement count exceeds ten.
|
|
180
228
|
- [`no-alert`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-alert.ts): rejects `alert`, `confirm`, and `prompt`.
|
|
181
229
|
- [`no-array-constructor`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-array-constructor.ts): rejects `Array` constructor calls.
|
|
182
|
-
- [`no-array-delete`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-array-delete.ts): rejects `delete` on array elements.
|
|
183
230
|
- [`no-async-promise-executor`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-async-promise-executor.ts): rejects async Promise executors.
|
|
231
|
+
- [`no-await-in-loop`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-await-in-loop.ts): reject `await` expressions evaluated inside a loop body.
|
|
184
232
|
- [`no-bitwise`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-bitwise.ts): rejects bitwise operators.
|
|
185
233
|
- [`no-caller`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-caller.ts): rejects `arguments.caller` and `arguments.callee`.
|
|
186
234
|
- [`no-case-declarations`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-case-declarations.ts): rejects lexical declarations directly inside `case` clauses.
|
|
187
235
|
- [`no-class-assign`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-class-assign.ts): rejects reassignment of class declarations.
|
|
188
236
|
- [`no-compare-neg-zero`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-compare-neg-zero.ts): rejects comparisons against `-0`.
|
|
189
237
|
- [`no-cond-assign`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-cond-assign.ts): rejects assignments inside conditions.
|
|
190
|
-
- [`no-confusing-non-null-assertion`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-confusing-non-null-assertion.ts): rejects confusing non-null assertions next to equality checks.
|
|
191
238
|
- [`no-console`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-console.ts): rejects `console` calls.
|
|
192
239
|
- [`no-constant-condition`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-constant-condition.ts): rejects constant conditions.
|
|
240
|
+
- [`no-constructor-return`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-constructor-return.ts): reject `return X;` (with a value) inside a class constructor.
|
|
193
241
|
- [`no-continue`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-continue.ts): rejects `continue` statements.
|
|
194
242
|
- [`no-control-regex`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-control-regex.ts): rejects control characters in regular expressions.
|
|
195
243
|
- [`no-debugger`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-debugger.ts): rejects `debugger` statements.
|
|
196
244
|
- [`no-delete-var`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-delete-var.ts): rejects deleting variables.
|
|
197
245
|
- [`no-dupe-args`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-dupe-args.ts): rejects duplicate function parameters.
|
|
246
|
+
- [`no-dupe-class-members`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-dupe-class-members.ts): reject two declarations of the same member on a single class.
|
|
198
247
|
- [`no-dupe-else-if`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-dupe-else-if.ts): rejects repeated `else if` conditions.
|
|
199
248
|
- [`no-dupe-keys`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-dupe-keys.ts): rejects duplicate object keys.
|
|
200
249
|
- [`no-duplicate-case`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-duplicate-case.ts): rejects duplicate `switch` case labels.
|
|
201
|
-
- [`no-duplicate-
|
|
202
|
-
- [`no-
|
|
250
|
+
- [`no-duplicate-imports`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-duplicate-imports.ts): reject two import declarations that resolve to the same module specifier.
|
|
251
|
+
- [`no-else-return`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-else-return.ts): reject an `else` block whose preceding `if` branch already terminates with `return`, `throw`, `break`, or `continue`.
|
|
203
252
|
- [`no-empty`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-empty.ts): rejects empty blocks.
|
|
204
253
|
- [`no-empty-character-class`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-empty-character-class.ts): rejects empty regex character classes.
|
|
205
254
|
- [`no-empty-function`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-empty-function.ts): rejects empty functions.
|
|
206
|
-
- [`no-empty-
|
|
207
|
-
- [`no-empty-object-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-empty-object-type.ts): rejects empty object type literals.
|
|
255
|
+
- [`no-empty-named-blocks`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-empty-named-blocks.ts): rejects empty named import/export clauses (`import {} from "x"`, `export {}`).
|
|
208
256
|
- [`no-empty-pattern`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-empty-pattern.ts): rejects empty destructuring patterns.
|
|
209
257
|
- [`no-empty-static-block`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-empty-static-block.ts): rejects empty class static blocks.
|
|
210
258
|
- [`no-eq-null`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-eq-null.ts): rejects loose null comparisons.
|
|
211
259
|
- [`no-eval`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-eval.ts): rejects `eval`.
|
|
212
260
|
- [`no-ex-assign`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-ex-assign.ts): rejects reassignment of caught exceptions.
|
|
213
|
-
- [`no-
|
|
261
|
+
- [`no-extend-native`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-extend-native.ts): reject assignments to a built-in prototype such as `Array.prototype.foo = bar`.
|
|
214
262
|
- [`no-extra-bind`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-extra-bind.ts): rejects unnecessary `.bind()` calls.
|
|
215
263
|
- [`no-extra-boolean-cast`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-extra-boolean-cast.ts): rejects redundant boolean casts.
|
|
216
|
-
- [`no-extra-non-null-assertion`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-extra-non-null-assertion.ts): rejects repeated non-null assertions.
|
|
217
264
|
- [`no-fallthrough`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-fallthrough.ts): rejects unmarked `switch` fallthrough.
|
|
218
265
|
- [`no-func-assign`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-func-assign.ts): rejects reassignment of function declarations.
|
|
219
|
-
- [`no-
|
|
220
|
-
- [`no-
|
|
266
|
+
- [`no-implicit-coercion`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-implicit-coercion.ts): reject common implicit-coercion idioms (`!!x`, `+x`, `"" + x`) in favor of the explicit `Boolean(x)` / `Number(x)` / `String(x)` conversions.
|
|
267
|
+
- [`no-import-assign`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-import-assign.ts): rejects writes to imported bindings (including `ns.x = ...` for namespace imports).
|
|
221
268
|
- [`no-inner-declarations`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-inner-declarations.ts): rejects function declarations nested in blocks.
|
|
269
|
+
- [`no-invalid-this`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-invalid-this.ts): reject `this` references outside any function-like, class method, or class-static-block context.
|
|
222
270
|
- [`no-irregular-whitespace`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-irregular-whitespace.ts): rejects irregular whitespace.
|
|
223
271
|
- [`no-iterator`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-iterator.ts): rejects `__iterator__`.
|
|
224
272
|
- [`no-labels`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-labels.ts): rejects labels.
|
|
225
273
|
- [`no-lone-blocks`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-lone-blocks.ts): rejects unnecessary standalone blocks.
|
|
226
274
|
- [`no-lonely-if`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-lonely-if.ts): rejects `if` as the only statement in an `else`.
|
|
275
|
+
- [`no-loop-func`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-loop-func.ts): reject function declarations defined inside the body of a loop.
|
|
227
276
|
- [`no-loss-of-precision`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-loss-of-precision.ts): rejects number literals that lose precision.
|
|
277
|
+
- [`no-magic-numbers`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-magic-numbers.ts): reject inline numeric literals outside `const` initializer position. `0`, `1`, `-1`, array indices, and enum values are exempt.
|
|
228
278
|
- [`no-misleading-character-class`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-misleading-character-class.ts): rejects misleading regex character classes.
|
|
229
|
-
- [`no-
|
|
230
|
-
- [`no-mixed-enums`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-mixed-enums.ts): rejects enums that mix numeric and string members.
|
|
279
|
+
- [`no-mixed-operators`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-mixed-operators.ts): reject mixing operators of different precedence families in the same expression without explicit parentheses around the inner sub-expression.
|
|
231
280
|
- [`no-multi-assign`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-multi-assign.ts): rejects chained assignments.
|
|
232
281
|
- [`no-multi-str`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-multi-str.ts): rejects multiline string escapes.
|
|
233
|
-
- [`no-namespace`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-namespace.ts): rejects non-ambient namespaces.
|
|
234
282
|
- [`no-negated-condition`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-negated-condition.ts): rejects negated conditions with an `else`.
|
|
235
283
|
- [`no-nested-ternary`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-nested-ternary.ts): rejects nested ternary expressions.
|
|
236
284
|
- [`no-new`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-new.ts): rejects `new` expressions used only for side effects.
|
|
237
285
|
- [`no-new-func`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-new-func.ts): rejects `Function` constructors.
|
|
286
|
+
- [`no-new-symbol`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-new-symbol.ts): reject `new Symbol(...)`.
|
|
238
287
|
- [`no-new-wrappers`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-new-wrappers.ts): rejects primitive wrapper constructors.
|
|
239
|
-
- [`no-non-null-asserted-nullish-coalescing`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-non-null-asserted-nullish-coalescing.ts): rejects non-null assertions next to `??`.
|
|
240
|
-
- [`no-non-null-asserted-optional-chain`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-non-null-asserted-optional-chain.ts): rejects non-null assertions on optional chains.
|
|
241
|
-
- [`no-non-null-assertion`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-non-null-assertion.ts): rejects postfix non-null assertions.
|
|
242
288
|
- [`no-obj-calls`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-obj-calls.ts): rejects calling global objects as functions.
|
|
243
289
|
- [`no-object-constructor`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-object-constructor.ts): rejects `new Object()`.
|
|
244
290
|
- [`no-octal`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-octal.ts): rejects legacy octal literals.
|
|
245
291
|
- [`no-octal-escape`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-octal-escape.ts): rejects octal escape sequences.
|
|
292
|
+
- [`no-param-reassign`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-param-reassign.ts): reject reassigning a function parameter inside the body of the function it belongs to.
|
|
246
293
|
- [`no-plusplus`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-plusplus.ts): rejects `++` and `--`.
|
|
247
294
|
- [`no-promise-executor-return`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-promise-executor-return.ts): rejects returned values from Promise executors.
|
|
248
295
|
- [`no-proto`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-proto.ts): rejects `__proto__`.
|
|
249
296
|
- [`no-prototype-builtins`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-prototype-builtins.ts): rejects direct `Object.prototype` method calls.
|
|
297
|
+
- [`no-redeclare`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-redeclare.ts): rejects redeclaring a binding in the same scope.
|
|
250
298
|
- [`no-regex-spaces`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-regex-spaces.ts): rejects repeated literal spaces in regexes.
|
|
251
|
-
- [`no-
|
|
299
|
+
- [`no-restricted-imports`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-restricted-imports.ts): reject `import` declarations targeting any module specifier in the project denylist.
|
|
300
|
+
- [`no-restricted-syntax`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-restricted-syntax.ts): reject AST node kinds listed in the project denylist.
|
|
252
301
|
- [`no-return-assign`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-return-assign.ts): rejects assignments in `return`.
|
|
253
302
|
- [`no-script-url`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-script-url.ts): rejects `javascript:` URLs.
|
|
254
303
|
- [`no-self-assign`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-self-assign.ts): rejects assignments to the same value.
|
|
255
304
|
- [`no-self-compare`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-self-compare.ts): rejects comparing a value to itself.
|
|
256
305
|
- [`no-sequences`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-sequences.ts): rejects comma expressions.
|
|
257
306
|
- [`no-setter-return`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-setter-return.ts): rejects returned values from setters.
|
|
307
|
+
- [`no-shadow`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-shadow.ts): reject a nested-scope binding that shadows a same-name binding from an outer scope.
|
|
258
308
|
- [`no-shadow-restricted-names`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-shadow-restricted-names.ts): rejects shadowing restricted globals.
|
|
259
309
|
- [`no-sparse-arrays`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-sparse-arrays.ts): rejects sparse arrays.
|
|
260
310
|
- [`no-template-curly-in-string`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-template-curly-in-string.ts): rejects `${...}` text inside normal strings.
|
|
261
|
-
- [`no-this-
|
|
311
|
+
- [`no-this-before-super`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-this-before-super.ts): reject `this` (or `super.x`) references that precede the first `super()` call in a derived constructor.
|
|
262
312
|
- [`no-throw-literal`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-throw-literal.ts): rejects throwing literals.
|
|
263
313
|
- [`no-undef-init`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-undef-init.ts): rejects initializing to `undefined`.
|
|
264
314
|
- [`no-undefined`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-undefined.ts): rejects the global `undefined` identifier.
|
|
265
|
-
- [`no-unnecessary-type-constraint`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-unnecessary-type-constraint.ts): rejects redundant `extends any` and `extends unknown` constraints.
|
|
266
315
|
- [`no-unneeded-ternary`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-unneeded-ternary.ts): rejects redundant ternary expressions.
|
|
267
|
-
- [`no-
|
|
316
|
+
- [`no-unreachable`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-unreachable.ts): reject statements that follow an unconditional `return`, `throw`, `break`, or `continue` in the same block — control flow has already left the block, so any later statement is dead code.
|
|
268
317
|
- [`no-unsafe-finally`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-unsafe-finally.ts): rejects control flow from `finally`.
|
|
269
|
-
- [`no-unsafe-function-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-unsafe-function-type.ts): rejects the unsafe `Function` type.
|
|
270
318
|
- [`no-unsafe-negation`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-unsafe-negation.ts): rejects unsafe negation before relational checks.
|
|
319
|
+
- [`no-unsafe-optional-chaining`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-unsafe-optional-chaining.ts): reject member access or call expressions that chain off an optional chain without continuing the chain.
|
|
271
320
|
- [`no-unused-expressions`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-unused-expressions.ts): rejects expression statements with no effect.
|
|
272
321
|
- [`no-unused-labels`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-unused-labels.ts): rejects labels that no `break` or `continue` targets.
|
|
322
|
+
- [`no-useless-assignment`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-useless-assignment.ts): reject an assignment whose value is immediately overwritten by the very next statement without an intervening read of the same identifier.
|
|
273
323
|
- [`no-useless-call`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-useless-call.ts): rejects unnecessary `.call()` and `.apply()`.
|
|
274
324
|
- [`no-useless-catch`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-useless-catch.ts): rejects catch blocks that only rethrow.
|
|
275
325
|
- [`no-useless-computed-key`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-useless-computed-key.ts): rejects unnecessary computed property keys.
|
|
@@ -277,29 +327,800 @@ The rule corpus is tested in `tests/test-lint/src/cases/*.ts`, which is the best
|
|
|
277
327
|
- [`no-useless-constructor`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-useless-constructor.ts): rejects empty constructors with no parameters.
|
|
278
328
|
- [`no-useless-escape`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-useless-escape.ts): rejects backslash escapes that have no effect inside strings or regexes.
|
|
279
329
|
- [`no-useless-rename`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-useless-rename.ts): rejects import/export/destructure renames to the same name.
|
|
330
|
+
- [`no-useless-return`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-useless-return.ts): reject a bare `return;` whose only effect is to end a function body that would have returned anyway.
|
|
280
331
|
- [`no-var`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-var.ts): rejects `var`.
|
|
281
332
|
- [`no-with`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-with.ts): rejects `with` statements.
|
|
282
|
-
- [`no-wrapper-object-types`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-wrapper-object-types.ts): rejects boxed object type names such as `String` and `Boolean`.
|
|
283
333
|
- [`object-shorthand`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/object-shorthand.ts): requires object property shorthand where possible.
|
|
284
334
|
- [`operator-assignment`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/operator-assignment.ts): prefers compound assignment operators.
|
|
285
|
-
- [`prefer-
|
|
335
|
+
- [`prefer-arrow-callback`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-arrow-callback.ts): reject `function() { ... }` expressions passed as callback arguments — prefer the arrow form.
|
|
286
336
|
- [`prefer-const`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-const.ts): prefers `const` for `let` bindings that are never reassigned.
|
|
287
|
-
- [`prefer-
|
|
337
|
+
- [`prefer-destructuring`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-destructuring.ts): reject single-property and single-index variable declarations (`const a = obj.a`, `const x = arr[0]`) that destructuring would replace verbatim.
|
|
288
338
|
- [`prefer-exponentiation-operator`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-exponentiation-operator.ts): prefers `**` over `Math.pow`.
|
|
289
339
|
- [`prefer-for-of`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-for-of.ts): prefers `for...of` for simple array iteration.
|
|
290
|
-
- [`prefer-
|
|
291
|
-
- [`prefer-
|
|
292
|
-
- [`prefer-
|
|
340
|
+
- [`prefer-named-capture-group`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-named-capture-group.ts): reject regex literals with unnamed capturing groups `(...)` — prefer named groups `(?<name>...)`.
|
|
341
|
+
- [`prefer-numeric-literals`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-numeric-literals.ts): prefer ES2015+ numeric literal forms (`0b…`, `0o…`, `0x…`) over `parseInt(string, 2 | 8 | 16)`.
|
|
342
|
+
- [`prefer-object-has-own`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-object-has-own.ts): prefer `Object.hasOwn(obj, key)` over `Object.prototype.hasOwnProperty.call(obj, key)`.
|
|
343
|
+
- [`prefer-object-spread`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-object-spread.ts): prefer object-spread `{ ...a, ...b }` over `Object.assign({}, a, b)`.
|
|
344
|
+
- [`prefer-rest-params`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-rest-params.ts): reject reading from `arguments` in a non-arrow function body — prefer the ES2015 rest-parameter form `(...args)`.
|
|
293
345
|
- [`prefer-spread`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-spread.ts): prefers spread arguments over `.apply`.
|
|
294
346
|
- [`prefer-template`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-template.ts): prefers template literals over string concatenation.
|
|
295
347
|
- [`radix`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/radix.ts): requires a radix argument for `parseInt`.
|
|
296
348
|
- [`require-yield`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/require-yield.ts): requires generator functions to contain `yield`.
|
|
297
|
-
- [`
|
|
349
|
+
- [`sort-imports`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/sort-imports.ts): reject import specifiers within a single `import` declaration that aren't alphabetically sorted.
|
|
350
|
+
- [`sort-keys`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/sort-keys.ts): reject object-literal property keys that aren't alphabetically sorted.
|
|
298
351
|
- [`use-isnan`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/use-isnan.ts): requires `Number.isNaN`/`isNaN` for `NaN` checks.
|
|
299
352
|
- [`valid-typeof`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/valid-typeof.ts): restricts `typeof` comparisons to valid strings.
|
|
300
353
|
- [`vars-on-top`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/vars-on-top.ts): requires `var` declarations at the top of their scope.
|
|
301
354
|
- [`yoda`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/yoda.ts): rejects literal-first comparisons.
|
|
302
355
|
|
|
356
|
+
### TypeScript
|
|
357
|
+
|
|
358
|
+
TypeScript-only rules and `@typescript-eslint` plugin equivalents, exposed under the `typescript/*` namespace. Each rule either requires TypeScript syntax (interface, `enum`, `namespace`, `as`, `!`, `import type`, type parameters, declaration merging, parameter properties, triple-slash references) or originates from `@typescript-eslint` as a TS-aware extension that has no counterpart in plain ESLint.
|
|
359
|
+
|
|
360
|
+
Source: [`typescript-eslint`](https://github.com/typescript-eslint/typescript-eslint).
|
|
361
|
+
|
|
362
|
+
- [`typescript/adjacent-overload-signatures`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/adjacent-overload-signatures.ts): keeps overload declarations for the same member adjacent.
|
|
363
|
+
- [`typescript/array-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/array-type.ts): prefers `T[]` and `readonly T[]` over array helper types.
|
|
364
|
+
- [`typescript/await-thenable`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/await-thenable.ts): rejects `await` on a value that is neither a Promise nor a thenable (type-aware).
|
|
365
|
+
- [`typescript/ban-ts-comment`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/ban-ts-comment.ts): rejects TypeScript suppression comments such as `@ts-ignore`.
|
|
366
|
+
- [`typescript/ban-tslint-comment`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/ban-tslint-comment.ts): rejects obsolete `tslint:` comments.
|
|
367
|
+
- [`typescript/class-literal-property-style`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-class-literal-property-style.ts): prefer a `static readonly` field over a `get` accessor whose body is a single `return <literal>;`.
|
|
368
|
+
- [`typescript/consistent-generic-constructors`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-consistent-generic-constructors.ts): reject the redundant pattern where a variable is annotated with a generic type AND the same generic arguments are repeated on the constructor: `const m: Map<K, V> = new Map<K, V>()`.
|
|
369
|
+
- [`typescript/consistent-indexed-object-style`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/consistent-indexed-object-style.ts): prefers `Record` for single index-signature object types.
|
|
370
|
+
- [`typescript/consistent-type-assertions`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/consistent-type-assertions.ts): prefers `as` type assertions over angle-bracket assertions.
|
|
371
|
+
- [`typescript/consistent-type-definitions`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/consistent-type-definitions.ts): prefers interfaces for object-shaped type definitions.
|
|
372
|
+
- [`typescript/consistent-type-exports`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-consistent-type-exports.ts): require type-only re-exports to use `export type { ... }` instead of mixing them with value-level re-exports.
|
|
373
|
+
- [`typescript/consistent-type-imports`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/consistent-type-imports/violation.ts): uses `import type` when imported names are type-only.
|
|
374
|
+
- [`typescript/explicit-function-return-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-explicit-function-return-type.ts): require every exported function and method declaration to carry an explicit return-type annotation.
|
|
375
|
+
- [`typescript/explicit-member-accessibility`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-explicit-member-accessibility.ts): require an explicit accessibility modifier (`public`, `private`, or `protected`) on every class member declaration.
|
|
376
|
+
- [`typescript/method-signature-style`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/method-signature-style.ts): prefers function-property signatures over method shorthand signatures.
|
|
377
|
+
- [`typescript/no-array-delete`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-array-delete.ts): rejects `delete` on array elements.
|
|
378
|
+
- [`typescript/no-array-for-each`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-array-for-each.ts): prefer `for ... of` over `Array.prototype.forEach()`.
|
|
379
|
+
- [`typescript/no-base-to-string`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-base-to-string.ts): rejects string coercion of values whose `toString` resolves to the default `Object.prototype.toString` (type-aware).
|
|
380
|
+
- [`typescript/no-confusing-non-null-assertion`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-confusing-non-null-assertion.ts): rejects confusing non-null assertions next to equality checks.
|
|
381
|
+
- [`typescript/no-confusing-void-expression`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-confusing-void-expression.ts): reject `void X` expressions used in any position where the surrounding context expects a value — initializer, call argument, `return` operand, conditional, binary, or ternary subexpression.
|
|
382
|
+
- [`typescript/no-deprecated`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-deprecated.ts): reject references to declarations annotated `@deprecated` in their JSDoc, with the deprecation comment surfaced at the reference site (type-aware).
|
|
383
|
+
- [`typescript/no-duplicate-enum-values`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-duplicate-enum-values.ts): rejects duplicate enum member values.
|
|
384
|
+
- [`typescript/no-dynamic-delete`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-dynamic-delete.ts): rejects `delete` on dynamically computed property keys.
|
|
385
|
+
- [`typescript/no-empty-interface`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-empty-interface.ts): rejects empty interfaces.
|
|
386
|
+
- [`typescript/no-empty-object-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-empty-object-type.ts): rejects empty object type literals.
|
|
387
|
+
- [`typescript/no-explicit-any`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-explicit-any.ts): rejects explicit `any`.
|
|
388
|
+
- [`typescript/no-extra-non-null-assertion`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-extra-non-null-assertion.ts): rejects repeated non-null assertions.
|
|
389
|
+
- [`typescript/no-extraneous-class`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-extraneous-class.ts): reject classes that exist purely as a namespace for static members or that are entirely empty.
|
|
390
|
+
- [`typescript/no-floating-promises`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-floating-promises.ts): reject Promise-typed expressions whose result is discarded — most often a bare `getPromise();` expression statement.
|
|
391
|
+
- [`typescript/no-for-in-array`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-for-in-array.ts): reject `for (const k in arr)` where `arr` is statically typed as an array or tuple.
|
|
392
|
+
- [`typescript/no-import-type-side-effects`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-import-type-side-effects/violation.ts): hoists inline `type` modifiers into a single `import type` declaration.
|
|
393
|
+
- [`typescript/no-inferrable-types`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-inferrable-types.ts): rejects type annotations TypeScript can infer.
|
|
394
|
+
- [`typescript/no-invalid-void-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-invalid-void-type.ts): reject `void` used as anything other than a function return type.
|
|
395
|
+
- [`typescript/no-magic-numbers`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-magic-numbers.ts): typeScript-aware extension of `no-magic-numbers` that additionally ignores enum member values.
|
|
396
|
+
- [`typescript/no-meaningless-void-operator`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-meaningless-void-operator.ts): reject `void X` where `X` is already statically typed `void` — the operator adds nothing because the operand already evaluates to `undefined` (type-aware).
|
|
397
|
+
- [`typescript/no-misused-new`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-misused-new.ts): rejects constructor-like signatures in interfaces.
|
|
398
|
+
- [`typescript/no-misused-promises`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-misused-promises.ts): reject Promise values supplied where a non-Promise was expected.
|
|
399
|
+
- [`typescript/no-misused-spread`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-misused-spread.ts): reject spread expressions whose operand is syntactically wrong for the surrounding context.
|
|
400
|
+
- [`typescript/no-mixed-enums`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-mixed-enums.ts): rejects enums that mix numeric and string members.
|
|
401
|
+
- [`typescript/no-namespace`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-namespace.ts): rejects non-ambient namespaces.
|
|
402
|
+
- [`typescript/no-non-null-asserted-nullish-coalescing`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-non-null-asserted-nullish-coalescing.ts): rejects non-null assertions next to `??`.
|
|
403
|
+
- [`typescript/no-non-null-asserted-optional-chain`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-non-null-asserted-optional-chain.ts): rejects non-null assertions on optional chains.
|
|
404
|
+
- [`typescript/no-non-null-assertion`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-non-null-assertion.ts): rejects postfix non-null assertions.
|
|
405
|
+
- [`typescript/no-redundant-type-constituents`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-redundant-type-constituents.ts): reject union and intersection type constituents that the type system absorbs anyway — `string | any` collapses to `any`, `T & never` collapses to `never`, `T & unknown` collapses to `T`, and repeated constituents add nothing.
|
|
406
|
+
- [`typescript/no-require-imports`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-require-imports.ts): rejects CommonJS `require` imports.
|
|
407
|
+
- [`typescript/no-restricted-types`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-restricted-types.ts): reject specific type-reference names that are almost always a mistake — by default the global wrapper types `Object`, `Function`, `Number`, `String`, and `Boolean`.
|
|
408
|
+
- [`typescript/no-this-alias`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-this-alias.ts): rejects aliasing `this` to locals.
|
|
409
|
+
- [`typescript/no-unnecessary-boolean-literal-compare`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-unnecessary-boolean-literal-compare.ts): reject direct comparison of a boolean-typed value with `true` / `false` literals — `x === true` is just `x`, `x !== false` is just `x`.
|
|
410
|
+
- [`typescript/no-unnecessary-condition`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-unnecessary-condition.ts): reject conditions whose static type proves the runtime truthiness is fixed — `if ({})`, `if (null)`, `while ("")`, `0 && f()` (type-aware).
|
|
411
|
+
- [`typescript/no-unnecessary-parameter-property-assignment`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-unnecessary-parameter-property-assignment.ts): rejects constructor assignments already handled by parameter properties.
|
|
412
|
+
- [`typescript/no-unnecessary-qualifier`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-unnecessary-qualifier.ts): reject namespace/enum qualifiers that the surrounding scope makes unnecessary (type-aware).
|
|
413
|
+
- [`typescript/no-unnecessary-template-expression`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-unnecessary-template-expression.ts): reject template literals that collapse to a regular string — `` `${"abc"}` ``, `` `${name}` `` around a string-typed value, or a plain `` `abc` `` with no escaped backticks (type-aware).
|
|
414
|
+
- [`typescript/no-unnecessary-type-arguments`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-unnecessary-type-arguments.ts): reject `Foo<DefaultT>` calls where the supplied generic argument is the same as the parameter's default — the argument adds nothing (type-aware).
|
|
415
|
+
- [`typescript/no-unnecessary-type-assertion`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-unnecessary-type-assertion.ts): reject `x as T`, `<T>x`, and `x!` assertions whose target type is the same as `x`'s already-known static type — the assertion adds nothing (type-aware).
|
|
416
|
+
- [`typescript/no-unnecessary-type-constraint`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-unnecessary-type-constraint.ts): rejects redundant `extends any` and `extends unknown` constraints.
|
|
417
|
+
- [`typescript/no-unsafe-argument`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-unsafe-argument.ts): reject passing an `any`-typed value to a parameter whose declared type is concrete (type-aware).
|
|
418
|
+
- [`typescript/no-unsafe-assignment`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-unsafe-assignment.ts): reject assigning an `any`-typed value to a variable, parameter, or property whose declared type is concrete (type-aware).
|
|
419
|
+
- [`typescript/no-unsafe-call`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-unsafe-call.ts): reject calling a value whose static type is `any` (type-aware).
|
|
420
|
+
- [`typescript/no-unsafe-declaration-merging`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-unsafe-declaration-merging.ts): rejects unsafe class/interface declaration merging.
|
|
421
|
+
- [`typescript/no-unsafe-enum-comparison`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-unsafe-enum-comparison.ts): reject `==` / `===` / `!=` / `!==` comparisons between an enum-typed value and a plain `number` or `string` of the same widened primitive — the comparison silently accepts unrelated enums and raw literals that happen to share the underlying primitive (type-aware).
|
|
422
|
+
- [`typescript/no-unsafe-function-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-unsafe-function-type.ts): rejects the unsafe `Function` type.
|
|
423
|
+
- [`typescript/no-unsafe-member-access`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-unsafe-member-access.ts): reject member access on a value whose static type is `any` (type-aware).
|
|
424
|
+
- [`typescript/no-unsafe-return`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-unsafe-return.ts): reject a `return` expression whose static type is `any` from a function whose declared return type is a concrete (non-`any` / non-`unknown` / non-`void`) shape — the `any` leaks past the type boundary and disables every downstream check on the returned value (type-aware).
|
|
425
|
+
- [`typescript/no-unsafe-unary-minus`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-unsafe-unary-minus.ts): reject the unary `-` operator applied to an operand whose static type is not number-like or bigint-like — `-x` silently coerces strings, objects, and other shapes via `Number(x)` and almost always indicates a bug (type-aware).
|
|
426
|
+
- [`typescript/no-useless-constructor`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-no-useless-constructor.ts): typeScript-aware extension of `no-useless-constructor` that tolerates a constructor existing solely to expose parameter properties.
|
|
427
|
+
- [`typescript/no-useless-empty-export`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-useless-empty-export.ts): rejects redundant empty `export {}` declarations in module files.
|
|
428
|
+
- [`typescript/no-wrapper-object-types`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/no-wrapper-object-types.ts): rejects boxed object type names such as `String` and `Boolean`.
|
|
429
|
+
- [`typescript/non-nullable-type-assertion-style`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/non-nullable-type-assertion-style.ts): reject `x as Foo` assertions whose target type is the non-nullable version of `x`'s static type — replace with the shorter `x!` non-null assertion.
|
|
430
|
+
- [`typescript/only-throw-error`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/only-throw-error.ts): reject `throw X` where `X` is statically known not to derive from `Error` — string literals, numbers, plain object literals, and the like.
|
|
431
|
+
- [`typescript/parameter-properties`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-parameter-properties.ts): reject TypeScript parameter-property constructors (`constructor(public foo: T)`) — prefer plain field declarations so the class shape is visible from the member list instead of buried inside the constructor parameter list.
|
|
432
|
+
- [`typescript/prefer-as-const`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-as-const.ts): prefers `as const` for literal assertions.
|
|
433
|
+
- [`typescript/prefer-enum-initializers`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-enum-initializers.ts): requires explicit enum member initializers.
|
|
434
|
+
- [`typescript/prefer-find`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-prefer-find.ts): prefer `array.find(predicate)` over `array.filter(predicate)[0]` / `.shift()` when only the first match is needed.
|
|
435
|
+
- [`typescript/prefer-function-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-function-type.ts): prefers function type aliases over single-call interfaces.
|
|
436
|
+
- [`typescript/prefer-includes`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-prefer-includes.ts): prefer `array.includes(x)` over `array.indexOf(x) !== -1` (and the matching `=== -1`, `>= 0`, `< 0`, `> -1` shapes) on array, tuple, and string receivers (type-aware).
|
|
437
|
+
- [`typescript/prefer-literal-enum-member`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-literal-enum-member.ts): prefers literal enum member initializers over computed expressions.
|
|
438
|
+
- [`typescript/prefer-namespace-keyword`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/prefer-namespace-keyword.ts): prefers `namespace` over TypeScript's legacy `module` keyword.
|
|
439
|
+
- [`typescript/prefer-nullish-coalescing`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-prefer-nullish-coalescing.ts): prefer `??` over `||` (and `??=` over `||=`, and `??` over the ternary `x ? x : y`) when the intent is to default `null` / `undefined`.
|
|
440
|
+
- [`typescript/prefer-optional-chain`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-prefer-optional-chain.ts): prefer an optional chain (`a?.b?.c`) over chained boolean guards such as `a && a.b && a.b.c` or `a != null && a.b`.
|
|
441
|
+
- [`typescript/prefer-promise-reject-errors`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-prefer-promise-reject-errors.ts): reject `Promise.reject(value)` where `value` is statically known not to derive from `Error` — type-aware analog of `only-throw-error` for the rejection side of the promise contract.
|
|
442
|
+
- [`typescript/prefer-readonly`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-prefer-readonly.ts): reject private class fields that could carry `readonly`.
|
|
443
|
+
- [`typescript/prefer-reduce-type-parameter`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-prefer-reduce-type-parameter.ts): prefer `arr.reduce<T>(..., initial)` over `arr.reduce(..., initial as T)` so the accumulator type is set on the call site instead of widened away inside the assertion (type-aware).
|
|
444
|
+
- [`typescript/prefer-regexp-exec`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-prefer-regexp-exec.ts): prefer `regex.exec(str)` over `str.match(regex)` when the regex carries the `g` flag — `.match` returns only the matched substrings and discards capture groups.
|
|
445
|
+
- [`typescript/prefer-return-this-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-prefer-return-this-type.ts): prefer the explicit `this` return type for chainable methods so fluent subclasses preserve their concrete `this` instead of widening to the base.
|
|
446
|
+
- [`typescript/prefer-string-starts-ends-with`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-prefer-string-starts-ends-with.ts): prefer `str.startsWith(p)` / `str.endsWith(p)` over `str.indexOf(p) === 0`, `str.indexOf(p, str.length - p.length) !== -1`, `str.lastIndexOf(p) === str.length - p.length`, and the anchored-regex `/^p/.test(str)` / `/p$/.test(str)` idioms (type-aware).
|
|
447
|
+
- [`typescript/promise-function-async`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-promise-function-async.ts): require functions whose return type is `Promise<T>` to be declared with the `async` keyword so synchronous throws surface as a rejected Promise (type-aware).
|
|
448
|
+
- [`typescript/related-getter-setter-pairs`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-related-getter-setter-pairs.ts): reject a `get` accessor whose declared return type does not match the parameter type of its companion `set` accessor on the same class — readers should not observe a type the writer cannot accept (type-aware).
|
|
449
|
+
- [`typescript/require-array-sort-compare`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-require-array-sort-compare.ts): require `arr.sort()` and `arr.toSorted()` calls to pass an explicit `compareFunction`.
|
|
450
|
+
- [`typescript/require-await`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/require-await.ts): reject `async` functions whose body contains no `await` expression.
|
|
451
|
+
- [`typescript/restrict-plus-operands`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-restrict-plus-operands.ts): rejects `+` expressions whose operands are not both `number`, both `string`, or both `bigint` (type-aware).
|
|
452
|
+
- [`typescript/restrict-template-expressions`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-restrict-template-expressions.ts): reject template-literal interpolations whose expression carries a type that does not stringify cleanly — `${obj}` prints `"[object Object]"`, `${null}` prints `"null"`, and so on.
|
|
453
|
+
- [`typescript/return-await`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/return-await.ts): reject `return promise` inside `try`, `catch`, or `finally`; require `return await promise`.
|
|
454
|
+
- [`typescript/sort-type-constituents`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-sort-type-constituents.ts): sort the members of union (`A | B | C`) and intersection (`A & B & C`) types into a canonical order so reorderings don't show up as diffs.
|
|
455
|
+
- [`typescript/strict-boolean-expressions`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-strict-boolean-expressions.ts): rejects non-boolean values used in a boolean context such as `if`, `&&`, `||`, or `!` (type-aware).
|
|
456
|
+
- [`typescript/switch-exhaustiveness-check`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-switch-exhaustiveness-check.ts): requires every member of a union or `enum` discriminant to be covered by a `case`, or a `default` clause to be present (type-aware).
|
|
457
|
+
- [`typescript/triple-slash-reference`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/triple-slash-reference/violation.ts): rejects triple-slash reference directives.
|
|
458
|
+
- [`typescript/unbound-method`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/typescript-unbound-method.ts): reject referencing a class instance method as a value instead of calling it (`obj.method` passed as a callback, aliased to a variable, or stored on another object).
|
|
459
|
+
- [`typescript/use-unknown-in-catch-callback-variable`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/use-unknown-in-catch-callback-variable.ts): require the callback parameter of `.catch(...)` and the second argument of `.then(...)` to be typed `unknown`.
|
|
460
|
+
|
|
461
|
+
### React
|
|
462
|
+
|
|
463
|
+
React TSX rules — Hooks correctness, JSX safety, the React Compiler subset, and Fast Refresh export shape. Bundles rules from three upstream plugins under one `react/*` namespace, matching Oxlint's layout. Performance-only rules live in [React performance](#react-performance) because they are opt-in toggles rather than correctness checks.
|
|
464
|
+
|
|
465
|
+
Source: [`eslint-plugin-react`](https://github.com/jsx-eslint/eslint-plugin-react), [`eslint-plugin-react-hooks`](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks), [`eslint-plugin-react-refresh`](https://github.com/ArnaudBarre/eslint-plugin-react-refresh).
|
|
466
|
+
|
|
467
|
+
- [`react/button-has-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-button-has-type.tsx): requires explicit valid `type` values on JSX `button` elements.
|
|
468
|
+
- [`react/component-hook-factories`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-component-hook-factories.tsx): rejects nested component or Hook factories that call Hooks.
|
|
469
|
+
- [`react/display-name`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-display-name.tsx): require components wrapped in `React.memo(...)` or `React.forwardRef(...)` to be named — either by passing a named function, assigning the call to a named binding, or setting an explicit `displayName`.
|
|
470
|
+
- [`react/exhaustive-deps`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-exhaustive-deps.tsx): reports high-confidence missing identifier dependencies in `useEffect`, `useLayoutEffect`, `useInsertionEffect`, `useMemo`, and `useCallback`.
|
|
471
|
+
- [`react/iframe-missing-sandbox`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-iframe-missing-sandbox.tsx): requires JSX `iframe` elements to include a sandbox attribute.
|
|
472
|
+
- [`react/immutability`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-immutability.tsx): rejects local prop mutation inside components and Hooks.
|
|
473
|
+
- [`react/jsx-key`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-jsx-key.tsx): requires `key` props for JSX elements produced by arrays or `.map()`.
|
|
474
|
+
- [`react/jsx-no-duplicate-props`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-jsx-no-duplicate-props.tsx): rejects duplicate JSX prop names on the same element.
|
|
475
|
+
- [`react/jsx-no-script-url`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-jsx-no-script-url.tsx): rejects `javascript:` URLs in JSX URL-like props.
|
|
476
|
+
- [`react/jsx-no-target-blank`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-jsx-no-target-blank.tsx): reject `<a target="_blank">` (or any JSX element with `target="_blank"`) that does not also carry `rel="noreferrer"` (or `rel="noopener noreferrer"`).
|
|
477
|
+
- [`react/jsx-no-undef`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-jsx-no-undef.tsx): reject JSX elements whose tag is an uppercase identifier with no value-level declaration anywhere in the source file.
|
|
478
|
+
- [`react/jsx-no-useless-fragment`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-jsx-no-useless-fragment.tsx): reject JSX fragments that wrap exactly one element child or have no meaningful content — the child (or nothing) can be returned directly.
|
|
479
|
+
- [`react/no-array-index-key`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-no-array-index-key.tsx): rejects array map index parameters as JSX keys.
|
|
480
|
+
- [`react/no-children-prop`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-no-children-prop.tsx): rejects passing children through a JSX `children` prop.
|
|
481
|
+
- [`react/no-danger`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-no-danger.tsx): rejects `dangerouslySetInnerHTML`.
|
|
482
|
+
- [`react/no-danger-with-children`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-no-danger-with-children.tsx): rejects combining `dangerouslySetInnerHTML` with children.
|
|
483
|
+
- [`react/no-direct-mutation-state`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-no-direct-mutation-state.tsx): rejects direct writes to `this.state` outside constructor initialization.
|
|
484
|
+
- [`react/no-find-dom-node`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-no-find-dom-node.tsx): rejects `findDOMNode` calls.
|
|
485
|
+
- [`react/no-is-mounted`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-no-is-mounted.tsx): rejects `isMounted` calls.
|
|
486
|
+
- [`react/no-string-refs`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-no-string-refs.tsx): rejects string JSX refs.
|
|
487
|
+
- [`react/no-unescaped-entities`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-no-unescaped-entities.tsx): rejects unescaped `>`, `"`, `'`, and `}` in JSX text.
|
|
488
|
+
- [`react/only-export-components`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-only-export-components.tsx): keeps React Fast Refresh component modules from exporting non-components.
|
|
489
|
+
- [`react/refs`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-refs.tsx): rejects reading or writing `ref.current` during render.
|
|
490
|
+
- [`react/rules-of-hooks`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-rules-of-hooks.tsx): rejects Hooks called outside components or custom Hooks, in nested callbacks, or in conditional/loop control flow.
|
|
491
|
+
- [`react/set-state-in-effect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-set-state-in-effect.tsx): rejects synchronous setter calls inside `useEffect`.
|
|
492
|
+
- [`react/set-state-in-render`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-set-state-in-render.tsx): rejects `useState` / `useReducer` setters called during render.
|
|
493
|
+
- [`react/style-prop-object`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-style-prop-object.tsx): rejects string literal JSX `style` prop values.
|
|
494
|
+
- [`react/use-memo`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-use-memo.tsx): rejects block-bodied `useMemo` callbacks that do not return a value.
|
|
495
|
+
- [`react/void-dom-elements-no-children`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-void-dom-elements-no-children.tsx): rejects children and HTML injection props on void DOM elements.
|
|
496
|
+
|
|
497
|
+
### React performance
|
|
498
|
+
|
|
499
|
+
Detects freshly-allocated reference values (arrays, objects, functions, JSX elements) passed as JSX props. A new reference invalidates `React.memo` / `useMemo` shallow checks on every render. Useful for performance-critical render paths; usually unnecessary for top-level pages. Diagnostics only fire on `.tsx` source files — JSX heuristics rely on the file extension, so `.ts` files are skipped even when they contain JSX-like syntax.
|
|
500
|
+
|
|
501
|
+
Source: [`eslint-plugin-react-perf`](https://github.com/cvazac/eslint-plugin-react-perf).
|
|
502
|
+
|
|
503
|
+
- [`react-perf/jsx-no-jsx-as-prop`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-perf-jsx-no-jsx-as-prop.tsx): rejects freshly-created JSX elements or fragments passed as JSX props.
|
|
504
|
+
- [`react-perf/jsx-no-new-array-as-prop`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-perf-jsx-no-new-array-as-prop.tsx): rejects freshly-created arrays passed as JSX props.
|
|
505
|
+
- [`react-perf/jsx-no-new-function-as-prop`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-perf-jsx-no-new-function-as-prop.tsx): rejects freshly-created functions passed as JSX props.
|
|
506
|
+
- [`react-perf/jsx-no-new-object-as-prop`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-perf-jsx-no-new-object-as-prop.tsx): rejects freshly-created objects passed as JSX props.
|
|
507
|
+
|
|
508
|
+
### JSX accessibility
|
|
509
|
+
|
|
510
|
+
JSX accessibility rules applied to TSX (and JSX-in-TS) sources. Checks the static structure of JSX elements against WAI-ARIA authoring guidance — interactive controls should be focusable, labels should reference a control, ARIA properties should match the element role, and so on. Runtime accessibility issues require live audits; this family catches the statically-decidable subset. Component alias settings, router-specific anchor settings, and autofixes are deferred.
|
|
511
|
+
|
|
512
|
+
Source: [`eslint-plugin-jsx-a11y`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y).
|
|
513
|
+
|
|
514
|
+
- [`jsx-a11y/alt-text`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-alt-text.tsx): requires image-like JSX elements to expose alt text or an ARIA label.
|
|
515
|
+
- [`jsx-a11y/anchor-ambiguous-text`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-anchor-ambiguous-text.tsx): rejects `<a>` elements whose visible text is a phrase that carries no information out of context.
|
|
516
|
+
- [`jsx-a11y/anchor-has-content`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-anchor-has-content.tsx): rejects empty JSX anchors with no accessible content.
|
|
517
|
+
- [`jsx-a11y/anchor-is-valid`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-anchor-is-valid.tsx): rejects anchors with missing, `#`-only, empty, or `javascript:` `href` values.
|
|
518
|
+
- [`jsx-a11y/aria-activedescendant-has-tabindex`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-aria-activedescendant-has-tabindex.tsx): requires `tabIndex` on any element carrying `aria-activedescendant` that is not focusable by default.
|
|
519
|
+
- [`jsx-a11y/aria-props`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-aria-props.tsx): rejects `aria-*` JSX attribute names that are not part of the WAI-ARIA spec.
|
|
520
|
+
- [`jsx-a11y/aria-proptypes`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-aria-proptypes.tsx): validates literal ARIA property values against the type the spec declares for them.
|
|
521
|
+
- [`jsx-a11y/aria-role`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-aria-role.tsx): requires `role` values to be a concrete, non-abstract WAI-ARIA role.
|
|
522
|
+
- [`jsx-a11y/aria-unsupported-elements`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-aria-unsupported-elements.tsx): rejects ARIA roles and attributes on elements that do not support them.
|
|
523
|
+
- [`jsx-a11y/autocomplete-valid`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-autocomplete-valid.tsx): validates literal `autocomplete` tokens against the HTML spec and the surrounding input `type`.
|
|
524
|
+
- [`jsx-a11y/click-events-have-key-events`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-click-events-have-key-events.tsx): requires keyboard handlers alongside `onClick` on non-interactive JSX elements.
|
|
525
|
+
- [`jsx-a11y/control-has-associated-label`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-control-has-associated-label.tsx): requires interactive controls to have an accessible label.
|
|
526
|
+
- [`jsx-a11y/heading-has-content`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-heading-has-content.tsx): rejects empty JSX headings.
|
|
527
|
+
- [`jsx-a11y/html-has-lang`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-html-has-lang.tsx): requires `<html>` JSX elements to declare a non-empty `lang` attribute.
|
|
528
|
+
- [`jsx-a11y/iframe-has-title`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-iframe-has-title.tsx): requires every `<iframe>` JSX element to declare a non-empty, unique `title`.
|
|
529
|
+
- [`jsx-a11y/img-redundant-alt`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-img-redundant-alt.tsx): rejects redundant words such as *image*, *photo*, or *picture* inside the `alt` attribute of an `<img>`.
|
|
530
|
+
- [`jsx-a11y/interactive-supports-focus`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-interactive-supports-focus.tsx): requires elements with interactive ARIA roles to be focusable.
|
|
531
|
+
- [`jsx-a11y/label-has-associated-control`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-label-has-associated-control.tsx): requires `<label>` elements to wrap a form control or reference one via `htmlFor`.
|
|
532
|
+
- [`jsx-a11y/label-has-for`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-label-has-for.tsx): deprecated predecessor of `label-has-associated-control` that checks the same nesting / `htmlFor` association requirement.
|
|
533
|
+
- [`jsx-a11y/lang`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-lang.tsx): requires the `<html lang>` value to be a valid IETF BCP-47 tag.
|
|
534
|
+
- [`jsx-a11y/media-has-caption`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-media-has-caption.tsx): requires `<audio>` and `<video>` elements to provide a `<track kind="captions">` child.
|
|
535
|
+
- [`jsx-a11y/mouse-events-have-key-events`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-mouse-events-have-key-events.tsx): requires `onMouseOver` / `onMouseOut` handlers to have `onFocus` / `onBlur` parity.
|
|
536
|
+
- [`jsx-a11y/no-access-key`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-no-access-key.tsx): rejects the `accessKey` JSX attribute.
|
|
537
|
+
- [`jsx-a11y/no-aria-hidden-on-focusable`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-no-aria-hidden-on-focusable.tsx): rejects `aria-hidden` on focusable JSX elements.
|
|
538
|
+
- [`jsx-a11y/no-autofocus`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-no-autofocus.tsx): rejects `autoFocus` / `autofocus` JSX attributes.
|
|
539
|
+
- [`jsx-a11y/no-distracting-elements`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-no-distracting-elements.tsx): rejects `<blink>` and `<marquee>` elements whose motion cannot be paused.
|
|
540
|
+
- [`jsx-a11y/no-interactive-element-to-noninteractive-role`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-no-interactive-element-to-noninteractive-role.tsx): rejects non-interactive ARIA roles applied to natively interactive elements.
|
|
541
|
+
- [`jsx-a11y/no-noninteractive-element-interactions`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-no-noninteractive-element-interactions.tsx): rejects interaction event handlers on known non-interactive elements without a role override.
|
|
542
|
+
- [`jsx-a11y/no-noninteractive-element-to-interactive-role`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-no-noninteractive-element-to-interactive-role.tsx): rejects interactive ARIA roles applied to non-interactive elements.
|
|
543
|
+
- [`jsx-a11y/no-noninteractive-tabindex`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-no-noninteractive-tabindex.tsx): rejects `tabIndex` on non-interactive JSX elements that have no interactive role.
|
|
544
|
+
- [`jsx-a11y/no-redundant-roles`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-no-redundant-roles.tsx): rejects explicit `role` attributes that duplicate the native semantics of the element.
|
|
545
|
+
- [`jsx-a11y/no-static-element-interactions`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-no-static-element-interactions.tsx): requires static elements with interaction handlers to declare an interactive `role`.
|
|
546
|
+
- [`jsx-a11y/prefer-tag-over-role`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-prefer-tag-over-role.tsx): prefers native JSX tags over `div` / `span` plus an equivalent `role`.
|
|
547
|
+
- [`jsx-a11y/role-has-required-aria-props`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-role-has-required-aria-props.tsx): requires ARIA properties that the chosen role mandates.
|
|
548
|
+
- [`jsx-a11y/role-supports-aria-props`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-role-supports-aria-props.tsx): rejects ARIA properties that the role does not support.
|
|
549
|
+
- [`jsx-a11y/scope`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-scope.tsx): restricts the `scope` attribute to `<th>` cells.
|
|
550
|
+
- [`jsx-a11y/tabindex-no-positive`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsx-a11y-tabindex-no-positive.tsx): rejects `tabIndex` values greater than zero.
|
|
551
|
+
|
|
552
|
+
### Next.js
|
|
553
|
+
|
|
554
|
+
Next.js framework rules applied to TypeScript and TSX sources inside Next.js apps. Cover static TS/TSX Next.js source patterns the framework's runtime treats as load-bearing — pages/app routing, `<Head>` placement, font and script loading, image and link components, and common data export typos. Rules that need non-TypeScript files or runtime filesystem route discovery are intentionally conservative.
|
|
555
|
+
|
|
556
|
+
Source: [`@next/eslint-plugin-next`](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next).
|
|
557
|
+
|
|
558
|
+
- [`nextjs/google-font-display`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-google-font-display.tsx): require `font-display` query on Google Font `<link>` URLs so initial render is not blocked.
|
|
559
|
+
- [`nextjs/google-font-preconnect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-google-font-preconnect.tsx): require `rel="preconnect"` for `fonts.gstatic.com` links to shave latency off Google Font fetches.
|
|
560
|
+
- [`nextjs/inline-script-id`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-inline-script-id.tsx): require an `id` attribute on inline `<Script>` components from `next/script`.
|
|
561
|
+
- [`nextjs/next-script-for-ga`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-next-script-for-ga.tsx): prefer the Next.js Google Analytics integration over hand-written `gtag` script tags.
|
|
562
|
+
- [`nextjs/no-assign-module-variable`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-assign-module-variable.ts): reject local declarations named `module`, which shadow the CommonJS `module` binding Next.js relies on.
|
|
563
|
+
- [`nextjs/no-async-client-component`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-async-client-component.tsx): reject `async` function bodies on React Client Components.
|
|
564
|
+
- [`nextjs/no-before-interactive-script-outside-document`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-before-interactive-script-outside-document.tsx): restrict the `next/script` `strategy="beforeInteractive"` option to `pages/_document.tsx`.
|
|
565
|
+
- [`nextjs/no-css-tags`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-css-tags.tsx): reject raw `<link rel="stylesheet">` tags.
|
|
566
|
+
- [`nextjs/no-document-import-in-page`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-document-import-in-page.tsx): restrict `next/document` imports to `pages/_document.tsx`.
|
|
567
|
+
- [`nextjs/no-duplicate-head`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-duplicate-head.tsx): reject more than one `<Head>` element from `next/document` in `pages/_document.tsx`.
|
|
568
|
+
- [`nextjs/no-head-element`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-head-element.tsx): reject raw `<head>` elements outside the `app/` directory.
|
|
569
|
+
- [`nextjs/no-head-import-in-document`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-head-import-in-document.tsx): reject `next/head` imports inside `pages/_document.tsx`.
|
|
570
|
+
- [`nextjs/no-html-link-for-pages`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-html-link-for-pages.tsx): prefer `next/link` for internal anchors with a static `href`.
|
|
571
|
+
- [`nextjs/no-img-element`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-img-element.tsx): prefer `next/image` over raw `<img>` elements so the framework can optimize the asset.
|
|
572
|
+
- [`nextjs/no-page-custom-font`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-page-custom-font.tsx): reject Google font `<link>` tags inside regular pages files.
|
|
573
|
+
- [`nextjs/no-script-component-in-head`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-script-component-in-head.tsx): reject `next/script` inside `next/head`.
|
|
574
|
+
- [`nextjs/no-styled-jsx-in-document`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-styled-jsx-in-document.tsx): reject styled-jsx tags inside `pages/_document.tsx`.
|
|
575
|
+
- [`nextjs/no-sync-scripts`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-sync-scripts.tsx): require `async` or `defer` on external raw `<script>` tags.
|
|
576
|
+
- [`nextjs/no-title-in-document-head`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-title-in-document-head.tsx): reject `<title>` inside `Head` from `next/document`.
|
|
577
|
+
- [`nextjs/no-typos`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-typos.ts): catch near-miss typos in Next.js data-fetching export names (`getStaticProps`, `getStaticPaths`, `getServerSideProps`).
|
|
578
|
+
- [`nextjs/no-unwanted-polyfillio`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/nextjs-no-unwanted-polyfillio.tsx): reject Polyfill.io script URLs.
|
|
579
|
+
|
|
580
|
+
### Solid
|
|
581
|
+
|
|
582
|
+
Solid TSX rules. Solid components compile to fine-grained reactivity, so patterns that look correct in React (destructuring props, calling `useEffect`-style hooks with array deps) silently break reactivity in Solid. AST-only, high-confidence Solid patterns after a Solid import is present.
|
|
583
|
+
|
|
584
|
+
Source: [`eslint-plugin-solid`](https://github.com/solidjs-community/eslint-plugin-solid).
|
|
585
|
+
|
|
586
|
+
- [`solid/components-return-once`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-components-return-once.tsx): reject early returns inside Solid components that break the once-only setup contract.
|
|
587
|
+
- [`solid/event-handlers`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-event-handlers.tsx): reject lowercase string event handlers that are forwarded as plain attributes.
|
|
588
|
+
- [`solid/imports`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-imports.tsx): require Solid APIs to be imported from their canonical modules.
|
|
589
|
+
- [`solid/jsx-no-duplicate-props`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-jsx-no-duplicate-props.tsx): reject duplicate JSX attributes on the same element.
|
|
590
|
+
- [`solid/jsx-no-script-url`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-jsx-no-script-url.tsx): reject `javascript:` URLs on JSX `href`/`src` literals.
|
|
591
|
+
- [`solid/jsx-no-undef`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-jsx-no-undef.tsx): reject JSX component tags with no in-scope binding.
|
|
592
|
+
- [`solid/jsx-uses-vars`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-jsx-uses-vars.tsx): accepted for config compatibility; emits no diagnostics because `@ttsc/lint` does not run ESLint's unused-variable marker pass.
|
|
593
|
+
- [`solid/no-array-handlers`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-no-array-handlers.tsx): reject array-form `[handler, data]` event handlers easily confused with React dep arrays.
|
|
594
|
+
- [`solid/no-destructure`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-no-destructure.tsx): reject destructured component props that lose reactive accessor wiring.
|
|
595
|
+
- [`solid/no-innerhtml`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-no-innerhtml.tsx): reject `innerHTML` JSX props that bypass the reconciler.
|
|
596
|
+
- [`solid/no-proxy-apis`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-no-proxy-apis.tsx): reject direct `new Proxy(...)` construction that defeats fine-grained tracking.
|
|
597
|
+
- [`solid/no-react-deps`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-no-react-deps.tsx): reject React-style dependency arrays passed to `createEffect`/`createMemo`/`createComputed`.
|
|
598
|
+
- [`solid/no-react-specific-props`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-no-react-specific-props.tsx): reject React-only JSX prop names like `className`, `htmlFor`, and `key`.
|
|
599
|
+
- [`solid/no-unknown-namespaces`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-no-unknown-namespaces.tsx): reject JSX namespaced attributes outside Solid's known prefixes.
|
|
600
|
+
- [`solid/prefer-classlist`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-prefer-classlist.tsx): prefer the `classList` JSX prop over `clsx`/`classnames` calls.
|
|
601
|
+
- [`solid/prefer-for`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-prefer-for.tsx): prefer the `<For>` component over `Array#map` for JSX list rendering.
|
|
602
|
+
- [`solid/prefer-show`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-prefer-show.tsx): prefer the `<Show>` component over `cond && <JSX />` conditionals.
|
|
603
|
+
- [`solid/reactivity`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-reactivity.tsx): flag bare signal accessors that break fine-grained reactivity tracking.
|
|
604
|
+
- [`solid/self-closing-comp`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-self-closing-comp.tsx): require empty JSX components to use the self-closing form.
|
|
605
|
+
- [`solid/style-prop`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-style-prop.tsx): reject camelCased CSS keys in JSX `style` object literals.
|
|
606
|
+
- [`solid/validate-jsx-nesting`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/solid-validate-jsx-nesting.tsx): reject JSX nestings that the HTML parser would silently restructure at runtime — `<p>` cannot contain block-level children, `<a>` cannot contain another `<a>`, and `<button>` cannot contain other interactive elements.
|
|
607
|
+
|
|
608
|
+
### Jest
|
|
609
|
+
|
|
610
|
+
Jest test source rules. Apply to TypeScript test files that use the Jest runner (`describe`, `test`/`it`, `expect`, lifecycle hooks). Guard test-quality patterns the type system cannot detect — unended assertions, focused tests left behind, duplicate hook calls.
|
|
611
|
+
|
|
612
|
+
Source: [`eslint-plugin-jest`](https://github.com/jest-community/eslint-plugin-jest).
|
|
613
|
+
|
|
614
|
+
- [`jest/expect-expect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-expect-expect.ts): require every Jest test body to contain at least one `expect(...)` call.
|
|
615
|
+
- [`jest/max-expects`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-max-expects.ts): limit the number of `expect(...)` calls inside a single Jest test body.
|
|
616
|
+
- [`jest/no-conditional-expect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-no-conditional-expect.ts): reject `expect(...)` calls under conditional branches in Jest tests.
|
|
617
|
+
- [`jest/no-conditional-in-test`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-no-conditional-in-test.ts): reject conditional logic (`if`/`switch`/ternary) inside Jest test bodies.
|
|
618
|
+
- [`jest/no-disabled-tests`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-no-disabled-tests.ts): reject `test.skip` / `it.skip` / `describe.skip` / `.todo` variants.
|
|
619
|
+
- [`jest/no-done-callback`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-no-done-callback.ts): reject `done` callback parameters in Jest tests and lifecycle hooks.
|
|
620
|
+
- [`jest/no-duplicate-hooks`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-no-duplicate-hooks.ts): reject duplicate setup/teardown hook calls in the same `describe`.
|
|
621
|
+
- [`jest/no-export`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-no-export.ts): reject `export` statements inside Jest test files.
|
|
622
|
+
- [`jest/no-focused-tests`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-no-focused-tests.ts): reject `test.only` / `it.only` / `describe.only`.
|
|
623
|
+
- [`jest/no-hooks`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-no-hooks.ts): reject Jest `beforeEach` / `afterEach` / `beforeAll` / `afterAll` hooks.
|
|
624
|
+
- [`jest/no-identical-title`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-no-identical-title.ts): reject duplicate Jest test or `describe` titles within the same suite scope.
|
|
625
|
+
- [`jest/no-standalone-expect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-no-standalone-expect.ts): reject `expect(...)` calls outside Jest tests and hooks.
|
|
626
|
+
- [`jest/no-test-prefixes`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-no-test-prefixes.ts): reject the legacy `f`/`x` test prefixes (`fit`, `xit`, `fdescribe`, `xdescribe`).
|
|
627
|
+
- [`jest/no-test-return-statement`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-no-test-return-statement.ts): reject `return` statements that return non-Promise values from a Jest test callback.
|
|
628
|
+
- [`jest/prefer-to-have-length`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-prefer-to-have-length.ts): prefer `expect(value).toHaveLength(n)` over asserting on `value.length` with `toBe`.
|
|
629
|
+
- [`jest/require-to-throw-message`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-require-to-throw-message.ts): require a message argument on `expect(...).toThrow(...)`.
|
|
630
|
+
- [`jest/valid-describe-callback`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-valid-describe-callback.ts): validate the shape of Jest `describe` callbacks.
|
|
631
|
+
- [`jest/valid-expect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-valid-expect.ts): validate `expect(...)` arity and matcher chaining: exactly one argument, terminated by a matcher call, and async matchers properly awaited.
|
|
632
|
+
- [`jest/valid-title`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jest-valid-title.ts): require non-empty static Jest test and `describe` titles.
|
|
633
|
+
|
|
634
|
+
### Vitest
|
|
635
|
+
|
|
636
|
+
Vitest test source rules. Vitest reuses much of Jest's testing surface but ships its own runner and configuration. These rules mirror the ergonomic subset of `eslint-plugin-jest` adapted for Vitest semantics — focused or disabled tests, duplicate titles, missing or conditional assertions, standalone `expect` calls, done callbacks, invalid `expect` chains, invalid titles, returned test values, and `.length` assertions that should use `toHaveLength`.
|
|
637
|
+
|
|
638
|
+
Source: [`@vitest/eslint-plugin`](https://github.com/vitest-dev/eslint-plugin-vitest).
|
|
639
|
+
|
|
640
|
+
- [`vitest/expect-expect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/vitest-expect-expect.ts): require every Vitest test body to contain at least one `expect(...)` call.
|
|
641
|
+
- [`vitest/no-conditional-expect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/vitest-no-conditional-expect.ts): reject `expect(...)` calls under conditional branches in Vitest tests.
|
|
642
|
+
- [`vitest/no-conditional-tests`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/vitest-no-conditional-tests.ts): reject `test(...)` / `it(...)` declarations inside loops or `if` branches.
|
|
643
|
+
- [`vitest/no-disabled-tests`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/vitest-no-disabled-tests.ts): reject `test.skip`, `it.skip`, `describe.skip`, and `.todo` variants.
|
|
644
|
+
- [`vitest/no-done-callback`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/vitest-no-done-callback.ts): reject `done` callback parameters in Vitest tests and lifecycle hooks.
|
|
645
|
+
- [`vitest/no-focused-tests`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/vitest-no-focused-tests.ts): reject `test.only`, `it.only`, and `describe.only`.
|
|
646
|
+
- [`vitest/no-identical-title`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/vitest-no-identical-title.ts): reject duplicate Vitest test or `describe` titles within the same suite scope.
|
|
647
|
+
- [`vitest/no-standalone-expect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/vitest-no-standalone-expect.ts): reject `expect(...)` calls outside Vitest tests and hooks.
|
|
648
|
+
- [`vitest/no-test-return-statement`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/vitest-no-test-return-statement.ts): reject `return` statements that return non-Promise values from a Vitest test callback.
|
|
649
|
+
- [`vitest/prefer-to-have-length`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/vitest-prefer-to-have-length.ts): prefer `expect(value).toHaveLength(n)` over asserting on `value.length` with `toBe`.
|
|
650
|
+
- [`vitest/valid-describe-callback`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/vitest-valid-describe-callback.ts): validate the shape of Vitest `describe` callbacks.
|
|
651
|
+
- [`vitest/valid-expect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/vitest-valid-expect.ts): validate `expect(...)` arity and matcher chaining.
|
|
652
|
+
- [`vitest/valid-title`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/vitest-valid-title.ts): require non-empty static Vitest test and `describe` titles.
|
|
653
|
+
|
|
654
|
+
### Testing Library
|
|
655
|
+
|
|
656
|
+
Testing Library test source rules for TS/TSX test files. AST-only; rules report only after a Testing Library import is present in the file.
|
|
657
|
+
|
|
658
|
+
Source: [`eslint-plugin-testing-library`](https://github.com/testing-library/eslint-plugin-testing-library).
|
|
659
|
+
|
|
660
|
+
- [`testing-library/await-async-events`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-await-async-events.ts): require Promise-returning user-event methods to be awaited.
|
|
661
|
+
- [`testing-library/await-async-queries`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-await-async-queries.ts): require `findBy*` queries to be awaited.
|
|
662
|
+
- [`testing-library/await-async-utils`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-await-async-utils.ts): require async utilities such as `waitFor` to be awaited.
|
|
663
|
+
- [`testing-library/no-await-sync-events`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-await-sync-events.ts): reject `await` on synchronous `fireEvent.*` calls.
|
|
664
|
+
- [`testing-library/no-await-sync-queries`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-await-sync-queries.ts): reject `await` on synchronous `getBy*` and `queryBy*` queries.
|
|
665
|
+
- [`testing-library/no-container`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-container.ts): reject destructuring or accessing the render-result `container`.
|
|
666
|
+
- [`testing-library/no-node-access`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-node-access.ts): reject DOM traversal (`parentElement`, `children`, ...) off a query result.
|
|
667
|
+
- [`testing-library/prefer-screen-queries`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-prefer-screen-queries.ts): prefer `screen.*` queries over render-result query functions.
|
|
668
|
+
- [`testing-library/no-debugging-utils`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-debugging-utils.ts): reject committed debug helpers such as `debug()` and `logTestingPlaygroundURL()`.
|
|
669
|
+
- [`testing-library/no-dom-import`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-dom-import.ts): reject direct imports from `@testing-library/dom` in favor of the framework adapter.
|
|
670
|
+
- [`testing-library/no-manual-cleanup`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-manual-cleanup.ts): reject manual `cleanup()` calls when the runner registers them automatically.
|
|
671
|
+
- [`testing-library/no-test-id-queries`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-test-id-queries.ts): reject `*ByTestId` queries in favor of accessibility-driven queries.
|
|
672
|
+
- [`testing-library/no-wait-for-multiple-assertions`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-wait-for-multiple-assertions.ts): reject more than one `expect(...)` inside a single `waitFor` callback.
|
|
673
|
+
- [`testing-library/no-wait-for-side-effects`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-wait-for-side-effects.ts): reject mutating calls (e.g. `fireEvent.*`) inside a `waitFor` callback.
|
|
674
|
+
- [`testing-library/no-wait-for-snapshot`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-wait-for-snapshot.ts): reject `toMatchSnapshot` / `toMatchInlineSnapshot` inside a `waitFor` callback.
|
|
675
|
+
- [`testing-library/prefer-find-by`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-prefer-find-by.ts): prefer `findBy*` over `waitFor(() => getBy*(...))`.
|
|
676
|
+
- [`testing-library/prefer-query-by-disappearance`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-prefer-query-by-disappearance.ts): prefer `queryBy*` when waiting for an element to disappear.
|
|
677
|
+
- [`testing-library/prefer-user-event`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-prefer-user-event.ts): prefer `user-event` interactions over equivalent `fireEvent.*` calls.
|
|
678
|
+
- [`testing-library/prefer-user-event-setup`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-prefer-user-event-setup.ts): require direct user-event interactions to go through `userEvent.setup()`.
|
|
679
|
+
- [`testing-library/no-promise-in-fire-event`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-promise-in-fire-event.ts): reject passing Promise-returning expressions into `fireEvent.*` arguments.
|
|
680
|
+
- [`testing-library/no-render-in-lifecycle`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-render-in-lifecycle.ts): reject `render()` calls inside `beforeEach` and other lifecycle hooks.
|
|
681
|
+
- [`testing-library/no-unnecessary-act`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-unnecessary-act.ts): reject wrapping Testing Library calls in `act(...)` when the helper already wraps them.
|
|
682
|
+
- [`testing-library/consistent-data-testid`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-consistent-data-testid.ts): require `data-testid` values to match the configured `testIdPattern`.
|
|
683
|
+
- [`testing-library/no-global-regexp-flag-in-query`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-no-global-regexp-flag-in-query.ts): reject `/g` regex flags inside Testing Library query arguments.
|
|
684
|
+
- [`testing-library/prefer-explicit-assert`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-prefer-explicit-assert.ts): reject standalone `getBy*` queries used as implicit assertions.
|
|
685
|
+
- [`testing-library/prefer-implicit-assert`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-prefer-implicit-assert.ts): reject redundant `toBeInTheDocument()` matchers around `getBy*` queries.
|
|
686
|
+
- [`testing-library/prefer-presence-queries`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-prefer-presence-queries.ts): require presence assertions to use `getBy*` and absence assertions to use `queryBy*`.
|
|
687
|
+
- [`testing-library/prefer-query-matchers`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-prefer-query-matchers.ts): reject truthiness matchers (`toBeNull`, `toBeTruthy`, `toBeFalsy`) around Testing Library queries.
|
|
688
|
+
- [`testing-library/render-result-naming-convention`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/testing-library-render-result-naming-convention.ts): require `render()` results to be named `view`, `utils`, or destructured.
|
|
689
|
+
|
|
690
|
+
### Playwright
|
|
691
|
+
|
|
692
|
+
Playwright end-to-end test rules applied to TypeScript test files driven by the `@playwright/test` runner. Guard Playwright-specific patterns — locator usage, web-first assertions, focused/slowed tests — that would otherwise compile and run silently.
|
|
693
|
+
|
|
694
|
+
Source: [`eslint-plugin-playwright`](https://github.com/playwright-community/eslint-plugin-playwright).
|
|
695
|
+
|
|
696
|
+
- [`playwright/expect-expect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-expect-expect.ts): require every Playwright test body to contain at least one `expect(...)` call.
|
|
697
|
+
- [`playwright/max-expects`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-max-expects.ts): limit the assertion count inside a single Playwright test body.
|
|
698
|
+
- [`playwright/no-conditional-expect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-conditional-expect.ts): reject `expect(...)` calls under conditional branches in Playwright tests.
|
|
699
|
+
- [`playwright/no-conditional-in-test`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-conditional-in-test.ts): reject conditional logic inside Playwright test bodies.
|
|
700
|
+
- [`playwright/no-duplicate-hooks`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-duplicate-hooks.ts): reject duplicate Playwright setup/teardown hook calls in the same `test.describe`.
|
|
701
|
+
- [`playwright/no-duplicate-slow`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-duplicate-slow.ts): reject repeated `test.slow()` calls inside the same test.
|
|
702
|
+
- [`playwright/no-element-handle`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-element-handle.ts): reject the legacy `ElementHandle`-style Playwright API (`page.$`, `page.$$`).
|
|
703
|
+
- [`playwright/no-eval`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-eval.ts): reject `page.$eval` and `page.$$eval`.
|
|
704
|
+
- [`playwright/no-focused-test`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-focused-test.ts): reject `test.only`, `test.describe.only`, and similar focused Playwright tests.
|
|
705
|
+
- [`playwright/no-force-option`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-force-option.ts): reject Playwright `{ force: true }` options on actionable commands.
|
|
706
|
+
- [`playwright/no-get-by-title`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-get-by-title.ts): reject `getByTitle(...)` locators.
|
|
707
|
+
- [`playwright/no-hooks`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-hooks.ts): reject Playwright `test.beforeEach` / `test.afterEach` / etc.
|
|
708
|
+
- [`playwright/no-nested-step`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-nested-step.ts): reject nested `test.step(...)` calls.
|
|
709
|
+
- [`playwright/no-networkidle`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-networkidle.ts): reject the `networkidle` load-state in `page.waitForLoadState` and navigation options.
|
|
710
|
+
- [`playwright/no-nth-methods`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-nth-methods.ts): reject `.first()`, `.last()`, and `.nth(...)` on locators.
|
|
711
|
+
- [`playwright/no-page-pause`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-page-pause.ts): reject `page.pause()` debugging calls.
|
|
712
|
+
- [`playwright/no-skipped-test`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-skipped-test.ts): reject `test.skip`, `test.describe.skip`, and the conditional `test.skip()` annotation.
|
|
713
|
+
- [`playwright/no-slowed-test`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-slowed-test.ts): reject `test.slow()` marks on Playwright tests.
|
|
714
|
+
- [`playwright/no-standalone-expect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-standalone-expect.ts): reject `expect(...)` calls outside the body of a Playwright test or lifecycle hook.
|
|
715
|
+
- [`playwright/no-wait-for-navigation`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-wait-for-navigation.ts): reject `page.waitForNavigation`.
|
|
716
|
+
- [`playwright/no-wait-for-selector`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-wait-for-selector.ts): reject `page.waitForSelector`.
|
|
717
|
+
- [`playwright/no-wait-for-timeout`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-no-wait-for-timeout.ts): reject `page.waitForTimeout(ms)` sleeps.
|
|
718
|
+
- [`playwright/prefer-locator`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-prefer-locator.ts): prefer locator-based Playwright APIs over page-level convenience methods.
|
|
719
|
+
- [`playwright/prefer-to-have-count`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-prefer-to-have-count.ts): prefer `expect(locator).toHaveCount(n)` over asserting on `await locator.count()`.
|
|
720
|
+
- [`playwright/prefer-to-have-length`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-prefer-to-have-length.ts): prefer `expect(value).toHaveLength(n)` over asserting on `value.length` directly.
|
|
721
|
+
- [`playwright/prefer-web-first-assertions`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-prefer-web-first-assertions.ts): prefer Playwright web-first assertions over composed manual waits.
|
|
722
|
+
- [`playwright/require-to-pass-timeout`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-require-to-pass-timeout.ts): require an explicit `timeout` option on `expect(...).toPass(...)`.
|
|
723
|
+
- [`playwright/require-to-throw-message`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-require-to-throw-message.ts): require a message argument on `expect(...).toThrow(...)`.
|
|
724
|
+
- [`playwright/valid-describe-callback`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-valid-describe-callback.ts): validate the shape of Playwright `test.describe` callbacks.
|
|
725
|
+
- [`playwright/valid-expect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-valid-expect.ts): validate `expect(...)` arity and matcher chaining.
|
|
726
|
+
- [`playwright/valid-title`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/playwright-valid-title.ts): require non-empty static Playwright test and `describe` titles.
|
|
727
|
+
|
|
728
|
+
### Cypress
|
|
729
|
+
|
|
730
|
+
Cypress end-to-end test rules. Apply to TypeScript/TSX sources that use the Cypress runner (`cy.*` commands and Mocha-style `describe`/`it` blocks). Detect Cypress-specific anti-patterns such as async test bodies, missing assertions before screenshots, or deprecated XPath selectors.
|
|
731
|
+
|
|
732
|
+
Source: [`eslint-plugin-cypress`](https://github.com/cypress-io/eslint-plugin-cypress).
|
|
733
|
+
|
|
734
|
+
- [`cypress/assertion-before-screenshot`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/cypress-assertion-before-screenshot.ts): require a Cypress assertion before `cy.screenshot()`.
|
|
735
|
+
- [`cypress/no-and`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/cypress-no-and.ts): prefer `.should()` over `.and()` when starting Cypress assertion chains.
|
|
736
|
+
- [`cypress/no-assigning-return-values`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/cypress-no-assigning-return-values.ts): reject assigning the return value of Cypress commands.
|
|
737
|
+
- [`cypress/no-async-before`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/cypress-no-async-before.ts): reject async `before` and `beforeEach` callbacks.
|
|
738
|
+
- [`cypress/no-async-tests`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/cypress-no-async-tests.ts): reject async Cypress test callbacks.
|
|
739
|
+
- [`cypress/no-chained-get`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/cypress-no-chained-get.ts): reject chained `.get()` calls.
|
|
740
|
+
- [`cypress/no-debug`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/cypress-no-debug.ts): reject `cy.debug()` and chained `.debug()` commands.
|
|
741
|
+
- [`cypress/no-force`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/cypress-no-force.ts): reject `{ force: true }` on Cypress action commands.
|
|
742
|
+
- [`cypress/no-pause`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/cypress-no-pause.ts): reject `cy.pause()` and chained `.pause()` commands.
|
|
743
|
+
- [`cypress/no-unnecessary-waiting`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/cypress-no-unnecessary-waiting.ts): reject numeric `cy.wait(...)` sleeps.
|
|
744
|
+
- [`cypress/no-xpath`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/cypress-no-xpath.ts): reject deprecated `cy.xpath()` selectors.
|
|
745
|
+
- [`cypress/require-data-selectors`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/cypress-require-data-selectors.ts): require statically known `cy.get()` selectors to target `data-*` attributes.
|
|
746
|
+
- [`cypress/unsafe-to-chain-command`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/cypress-unsafe-to-chain-command.ts): reject chaining more commands after Cypress action commands.
|
|
747
|
+
|
|
748
|
+
### Storybook
|
|
749
|
+
|
|
750
|
+
Storybook CSF and configuration rules. Apply to `*.stories.ts(x)` and `.storybook/main.ts` files. Cover CSF metadata shape, named story exports, deprecated `storiesOf`, interaction-test imports, direct renderer-package imports, and addon installation checks. `storybook/no-uninstalled-addons` accepts `{ packageJsonLocation?: string; ignore?: string[] }`; without an explicit path it walks upward from the linted Storybook config file to find `package.json`.
|
|
751
|
+
|
|
752
|
+
Source: [`eslint-plugin-storybook`](https://github.com/storybookjs/eslint-plugin-storybook).
|
|
753
|
+
|
|
754
|
+
- [`storybook/await-interactions`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-await-interactions.ts): require play-function interactions to be awaited.
|
|
755
|
+
- [`storybook/context-in-play-function`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-context-in-play-function.ts): require forwarding the play-function `context` argument when invoking another story's `play` function.
|
|
756
|
+
- [`storybook/csf-component`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-csf-component.ts): require the CSF default meta object to declare a `component`.
|
|
757
|
+
- [`storybook/default-exports`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-default-exports.ts): require every story file to provide the CSF default export.
|
|
758
|
+
- [`storybook/hierarchy-separator`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-hierarchy-separator.ts): reject the legacy `|` separator in Storybook story titles.
|
|
759
|
+
- [`storybook/meta-inline-properties`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-meta-inline-properties.ts): require `title` and `args` in CSF meta to be inline literals.
|
|
760
|
+
- [`storybook/meta-satisfies-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-meta-satisfies-type.ts): require CSF meta objects to type-check with `satisfies Meta<…>` rather than a `: Meta<…>` annotation or `as` cast.
|
|
761
|
+
- [`storybook/no-redundant-story-name`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-no-redundant-story-name.ts): reject `name` metadata on a story when it matches Storybook's auto-derived name from the export identifier.
|
|
762
|
+
- [`storybook/no-renderer-packages`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-no-renderer-packages.ts): reject direct imports from Storybook renderer packages.
|
|
763
|
+
- [`storybook/no-stories-of`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-no-stories-of.ts): reject the legacy `storiesOf(...)` builder API.
|
|
764
|
+
- [`storybook/no-title-property-in-meta`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-no-title-property-in-meta.ts): reject the `title` property in CSF meta when the project uses Storybook's auto-title generation.
|
|
765
|
+
- [`storybook/no-uninstalled-addons`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-no-uninstalled-addons.ts): validate Storybook addon names against the project's dependencies.
|
|
766
|
+
- [`storybook/prefer-pascal-case`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-prefer-pascal-case.ts): require named story exports to use PascalCase.
|
|
767
|
+
- [`storybook/story-exports`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-story-exports.ts): require every story file to export at least one named story alongside the default meta.
|
|
768
|
+
- [`storybook/use-storybook-expect`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-use-storybook-expect.ts): require `expect` to be imported from `@storybook/test` in play functions.
|
|
769
|
+
- [`storybook/use-storybook-testing-library`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/storybook-use-storybook-testing-library.ts): reject direct Testing Library imports inside story files; use the Storybook-bundled re-exports.
|
|
770
|
+
|
|
771
|
+
### TanStack Query
|
|
772
|
+
|
|
773
|
+
TanStack Query rules. Guard the ergonomic and correctness contracts of TanStack Query (`useQuery`, `useMutation`, query-options factories) inside React TypeScript sources.
|
|
774
|
+
|
|
775
|
+
Source: [`@tanstack/eslint-plugin-query`](https://github.com/TanStack/query/tree/main/packages/eslint-plugin-query).
|
|
776
|
+
|
|
777
|
+
- [`tanstack-query/exhaustive-deps`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/tanstack-query-exhaustive-deps.ts): require `queryKey` arrays to enumerate every reactive identifier the `queryFn` reads.
|
|
778
|
+
- [`tanstack-query/infinite-query-property-order`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/tanstack-query-infinite-query-property-order.ts): require `queryFn`, `getPreviousPageParam`, and `getNextPageParam` inside `useInfiniteQuery` to appear in the order TanStack Query documents.
|
|
779
|
+
- [`tanstack-query/mutation-property-order`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/tanstack-query-mutation-property-order.ts): require `useMutation` callbacks to declare `onMutate` before `onError` and `onSettled`.
|
|
780
|
+
- [`tanstack-query/no-rest-destructuring`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/tanstack-query-no-rest-destructuring.ts): reject `...rest` destructuring on TanStack Query hook results.
|
|
781
|
+
- [`tanstack-query/no-unstable-deps`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/tanstack-query-no-unstable-deps.ts): reject passing entire TanStack Query hook results into React dependency arrays.
|
|
782
|
+
- [`tanstack-query/no-void-query-fn`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/tanstack-query-no-void-query-fn.ts): reject `queryFn` callbacks that resolve to `void`.
|
|
783
|
+
- [`tanstack-query/prefer-query-options`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/tanstack-query-prefer-query-options.ts): prefer wrapping query options in the `queryOptions()` helper.
|
|
784
|
+
- [`tanstack-query/stable-query-client`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/tanstack-query-stable-query-client.ts): reject creating a `QueryClient` inside a React component or hook body.
|
|
785
|
+
|
|
786
|
+
### Promise
|
|
787
|
+
|
|
788
|
+
Promise correctness and style rules. Check the chain shape of Promise-using code: every chain ends with `catch`, no callback inside a `then`, no nested `.then().then()`, and so on. AST-local only — type-aware Promise checks belong with `typescript/*` checker rules.
|
|
789
|
+
|
|
790
|
+
Source: [`eslint-plugin-promise`](https://github.com/eslint-community/eslint-plugin-promise).
|
|
791
|
+
|
|
792
|
+
- [`promise/always-return`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-always-return.ts): require `.then(...)` callbacks to return a value or throw.
|
|
793
|
+
- [`promise/avoid-new`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-avoid-new.ts): reject every `new Promise(...)` construction.
|
|
794
|
+
- [`promise/catch-or-return`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-catch-or-return.ts): require unreturned promise chains to terminate with `catch()`.
|
|
795
|
+
- [`promise/no-callback-in-promise`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-no-callback-in-promise.ts): reject direct invocation of an error-first callback inside a `then()` or `catch()` handler.
|
|
796
|
+
- [`promise/no-multiple-resolved`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-no-multiple-resolved.ts): detect Promise executor bodies with more than one resolve/reject call.
|
|
797
|
+
- [`promise/no-native`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-no-native.ts): require every file that uses `Promise` to import or require the implementation explicitly.
|
|
798
|
+
- [`promise/no-nesting`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-no-nesting.ts): reject nested `then()`/`catch()` calls inside the body of a Promise callback.
|
|
799
|
+
- [`promise/no-new-statics`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-no-new-statics.ts): reject `new` applied to Promise statics such as `new Promise.resolve(x)`.
|
|
800
|
+
- [`promise/no-promise-in-callback`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-no-promise-in-callback.ts): reject building a promise chain inside the body of an error-first callback.
|
|
801
|
+
- [`promise/no-return-in-finally`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-no-return-in-finally.ts): reject `return` from inside a `finally()` callback.
|
|
802
|
+
- [`promise/no-return-wrap`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-no-return-wrap.ts): reject `return Promise.resolve(x)` and `return Promise.reject(x)` inside promise callbacks.
|
|
803
|
+
- [`promise/param-names`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-param-names.ts): enforce canonical parameter names (`resolve`, `reject`) on Promise executor functions.
|
|
804
|
+
- [`promise/prefer-await-to-callbacks`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-prefer-await-to-callbacks.ts): flag continuation-passing callback shapes and suggest an `async`/`await` rewrite.
|
|
805
|
+
- [`promise/prefer-await-to-then`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-prefer-await-to-then.ts): prefer `await` over explicit `.then()`/`.catch()`/`.finally()` chains inside `async` functions.
|
|
806
|
+
- [`promise/prefer-catch`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-prefer-catch.ts): prefer `.catch(handler)` over the two-argument form `.then(onFulfilled, onRejected)`.
|
|
807
|
+
- [`promise/spec-only`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-spec-only.ts): reject non-standard `Promise` statics such as `Promise.done`, `Promise.spread`, or library-specific extensions shimmed onto the global.
|
|
808
|
+
- [`promise/valid-params`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/promise-valid-params.ts): enforce the argument counts the Promise spec defines for each method.
|
|
809
|
+
|
|
810
|
+
### Unicorn
|
|
811
|
+
|
|
812
|
+
Modernization and style rules spanning array iteration, string and regex idioms, Node.js APIs, error handling, module syntax, DOM APIs, and code shape. Rewrite legacy patterns into their modern counterparts (`for...of` over `forEach`, `Array#flatMap` over `map().flat()`, `String#replaceAll` over a global-regex `replace`, `Math.trunc` over `| 0`), forbid known anti-patterns (`null` literals, abusive `eslint-disable`, `new Buffer`, `process.exit`, `instanceof Array`), and pin a consistent style for things [ESLint core](#eslint-core) and [TypeScript](#typescript) leave underspecified (filename case, numeric separators, catch-binding names, expiring TODOs, escape-sequence case, switch-case braces). Pure-AST; no checker dependencies.
|
|
813
|
+
|
|
814
|
+
Source: [`eslint-plugin-unicorn`](https://github.com/sindresorhus/eslint-plugin-unicorn).
|
|
815
|
+
|
|
816
|
+
- [`unicorn/better-regex`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-better-regex.ts): rewrite regex literals into shorter, consistent, and safer form (character-class shorthands, redundant ranges).
|
|
817
|
+
- [`unicorn/catch-error-name`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-catch-error-name.ts): enforce a canonical parameter name (`error`) in `catch` clauses.
|
|
818
|
+
- [`unicorn/consistent-assert`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-consistent-assert.ts): enforce consistent assertion style when using `node:assert`.
|
|
819
|
+
- [`unicorn/consistent-date-clone`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-consistent-date-clone.ts): prefer passing a `Date` directly to the `Date` constructor when cloning, not `+date` or `date.getTime()`.
|
|
820
|
+
- [`unicorn/consistent-destructuring`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-consistent-destructuring.ts): once a property is destructured from an object, require subsequent reads to use the destructured binding.
|
|
821
|
+
- [`unicorn/consistent-empty-array-spread`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-consistent-empty-array-spread.ts): require both branches of a ternary spread inside an array literal to be array-typed.
|
|
822
|
+
- [`unicorn/consistent-existence-index-check`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-consistent-existence-index-check.ts): enforce a consistent comparison form (`< 0` vs `=== -1`, `>= 0` vs `!== -1`) for `indexOf` / `findIndex` existence checks.
|
|
823
|
+
- [`unicorn/consistent-function-scoping`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-consistent-function-scoping.ts): hoist function declarations to the highest scope that does not capture any outer variables.
|
|
824
|
+
- [`unicorn/consistent-template-literal-escape`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-consistent-template-literal-escape.ts): enforce a consistent style (always `\${` or always `$\{`) when escaping `${` in template literals.
|
|
825
|
+
- [`unicorn/custom-error-definition`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-custom-error-definition.ts): require user-defined `Error` subclasses to set `name`, call `super(message)`, and assign their stack correctly.
|
|
826
|
+
- [`unicorn/empty-brace-spaces`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-empty-brace-spaces.ts): reject whitespace inside empty `{}` braces.
|
|
827
|
+
- [`unicorn/error-message`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-error-message.ts): require a non-empty `message` argument when constructing a built-in `Error`.
|
|
828
|
+
- [`unicorn/escape-case`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-escape-case.ts): require consistent case for escape sequences (`\xA9` over `\xa9`, `µ` over `µ`).
|
|
829
|
+
- [`unicorn/expiring-todo-comments`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-expiring-todo-comments.ts): require every `TODO`/`FIXME`/`XXX` comment to declare an expiration date or package version.
|
|
830
|
+
- [`unicorn/explicit-length-check`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-explicit-length-check.ts): require explicit comparison of `.length` / `.size` instead of relying on truthy coercion.
|
|
831
|
+
- [`unicorn/filename-case`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-filename-case.ts): enforce a single case style (kebab/camel/snake/pascal) for source filenames.
|
|
832
|
+
- [`unicorn/import-style`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-import-style.ts): restrict each module's allowed import styles (named only, default only, namespace only).
|
|
833
|
+
- [`unicorn/isolated-functions`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-isolated-functions.ts): reject references to outer-scope variables inside functions marked as isolated (e.g., the body of a web worker).
|
|
834
|
+
- [`unicorn/new-for-builtins`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-new-for-builtins.ts): require `new` when calling builtin constructors like `Error`, `Map`, `Set`, `Date` — and forbid `new` on primitive wrappers like `String`, `Number`, `Boolean`.
|
|
835
|
+
- [`unicorn/no-abusive-eslint-disable`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-abusive-eslint-disable.ts): require every `eslint-disable*` directive to name the rules it disables.
|
|
836
|
+
- [`unicorn/no-accessor-recursion`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-accessor-recursion.ts): reject recursive reads on `this.<prop>` inside the getter / setter for `<prop>`.
|
|
837
|
+
- [`unicorn/no-anonymous-default-export`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-anonymous-default-export.ts): require a name on every default-exported function, class, or object.
|
|
838
|
+
- [`unicorn/no-array-callback-reference`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-array-callback-reference.ts): reject passing a function reference directly as the callback to `map`/`filter`/`forEach`/etc., which silently leaks extra index/array arguments.
|
|
839
|
+
- [`unicorn/no-array-for-each`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-array-for-each.ts): prefer `for...of` over `Array.prototype.forEach`.
|
|
840
|
+
- [`unicorn/no-array-method-this-argument`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-array-method-this-argument.ts): reject the second `thisArg` argument to array methods; use an explicit closure instead.
|
|
841
|
+
- [`unicorn/no-array-reduce`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-array-reduce.ts): reject `Array#reduce` / `Array#reduceRight` in favor of explicit loops or other helpers.
|
|
842
|
+
- [`unicorn/no-array-reverse`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-array-reverse.ts): prefer `Array#toReversed` over the mutating `Array#reverse`.
|
|
843
|
+
- [`unicorn/no-array-sort`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-array-sort.ts): prefer `Array#toSorted` over the mutating `Array#sort`.
|
|
844
|
+
- [`unicorn/no-await-expression-member`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-await-expression-member.ts): reject member access on an `await` expression without parens; require `(await x).y`.
|
|
845
|
+
- [`unicorn/no-await-in-promise-methods`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-await-in-promise-methods.ts): reject `await` inside arrays passed to `Promise.all`/`Promise.allSettled`/`Promise.race`/`Promise.any` — the awaits serialize the calls.
|
|
846
|
+
- [`unicorn/no-console-spaces`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-console-spaces.ts): reject leading or trailing spaces in arguments to `console.log` and friends — `console` already inserts spaces between arguments.
|
|
847
|
+
- [`unicorn/no-document-cookie`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-document-cookie.ts): reject direct reads or assignments to `document.cookie`; use the Cookie Store API or a wrapper.
|
|
848
|
+
- [`unicorn/no-empty-file`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-empty-file.ts): reject source files whose only content is whitespace and/or comments.
|
|
849
|
+
- [`unicorn/no-for-loop`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-for-loop.ts): prefer `for...of` over index-based `for` loops over arrays.
|
|
850
|
+
- [`unicorn/no-hex-escape`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-hex-escape.ts): prefer Unicode escape (`©`) over hexadecimal escape (`\xA9`).
|
|
851
|
+
- [`unicorn/no-immediate-mutation`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-immediate-mutation.ts): reject mutating a value on the same expression that produces it (`[...x].push(y)`); separate the construction and the mutation.
|
|
852
|
+
- [`unicorn/no-instanceof-builtins`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-instanceof-builtins.ts): reject `instanceof Array`, `instanceof Error`, `instanceof Map`, etc. — they fail across realms and for subclasses.
|
|
853
|
+
- [`unicorn/no-invalid-fetch-options`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-invalid-fetch-options.ts): reject GET / HEAD `fetch()` calls that also set a request `body`, which throws at runtime.
|
|
854
|
+
- [`unicorn/no-invalid-remove-event-listener`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-invalid-remove-event-listener.ts): reject `removeEventListener` calls whose handler argument is a fresh function reference and therefore matches no registered listener.
|
|
855
|
+
- [`unicorn/no-keyword-prefix`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-keyword-prefix.ts): reject identifiers that start with a reserved word (`newFoo`, `classBar`).
|
|
856
|
+
- [`unicorn/no-lonely-if`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-lonely-if.ts): reject `if` as the only statement inside an `else` block; use `else if` instead.
|
|
857
|
+
- [`unicorn/no-magic-array-flat-depth`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-magic-array-flat-depth.ts): reject magic-number depth arguments to `Array#flat`; require `Infinity` or a named constant.
|
|
858
|
+
- [`unicorn/no-named-default`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-named-default.ts): reject re-importing or re-exporting a default binding under a name that differs from the upstream binding.
|
|
859
|
+
- [`unicorn/no-negated-condition`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-negated-condition.ts): reject negated conditions in `if`/`else` and ternaries when the positive form is shorter.
|
|
860
|
+
- [`unicorn/no-negation-in-equality-check`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-negation-in-equality-check.ts): reject `!a === b`; require `a !== b` or `!(a === b)`.
|
|
861
|
+
- [`unicorn/no-nested-ternary`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-nested-ternary.ts): reject ternaries nested inside other ternaries.
|
|
862
|
+
- [`unicorn/no-new-array`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-new-array.ts): reject the `new Array(...)` constructor; use array literals or `Array.from` / `Array.of`.
|
|
863
|
+
- [`unicorn/no-new-buffer`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-new-buffer.ts): reject the deprecated `new Buffer()` constructor; use `Buffer.from` or `Buffer.alloc`.
|
|
864
|
+
- [`unicorn/no-null`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-null.ts): reject the `null` literal in favor of `undefined`.
|
|
865
|
+
- [`unicorn/no-object-as-default-parameter`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-object-as-default-parameter.ts): reject inline object literals as default values for function parameters.
|
|
866
|
+
- [`unicorn/no-process-exit`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-process-exit.ts): reject `process.exit()`; throw or return a non-zero status instead.
|
|
867
|
+
- [`unicorn/no-single-promise-in-promise-methods`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-single-promise-in-promise-methods.ts): reject `Promise.all`/`Promise.race`/etc. called with a single-element array; the wrapper is redundant.
|
|
868
|
+
- [`unicorn/no-static-only-class`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-static-only-class.ts): reject classes whose every member is `static`; use a plain module-level namespace instead.
|
|
869
|
+
- [`unicorn/no-thenable`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-thenable.ts): reject defining a property named `then` on objects, modules, or classes — `await` and Promise resolution accidentally invoke it.
|
|
870
|
+
- [`unicorn/no-this-assignment`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-this-assignment.ts): reject `const self = this` and similar aliases; capture via arrow functions instead.
|
|
871
|
+
- [`unicorn/no-typeof-undefined`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-typeof-undefined.ts): reject `typeof x === "undefined"`; compare against `undefined` directly.
|
|
872
|
+
- [`unicorn/no-unnecessary-array-flat-depth`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-unnecessary-array-flat-depth.ts): reject `1` as the explicit depth argument of `Array#flat`; the default is already `1`.
|
|
873
|
+
- [`unicorn/no-unnecessary-array-splice-count`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-unnecessary-array-splice-count.ts): reject `.length` / `Infinity` as the deleteCount argument to `splice` / `toSpliced`; omit it to delete to the end.
|
|
874
|
+
- [`unicorn/no-unnecessary-await`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-unnecessary-await.ts): reject `await` on non-thenable expressions.
|
|
875
|
+
- [`unicorn/no-unnecessary-polyfills`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-unnecessary-polyfills.ts): reject polyfill imports for APIs already available in the project's targeted Node/browser baseline.
|
|
876
|
+
- [`unicorn/no-unnecessary-slice-end`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-unnecessary-slice-end.ts): reject `.length` / `Infinity` as the end argument to `slice`; omit it to slice to the end.
|
|
877
|
+
- [`unicorn/no-unreadable-array-destructuring`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-unreadable-array-destructuring.ts): reject destructuring patterns with long hole runs (`[,,,,a]`); use a named index instead.
|
|
878
|
+
- [`unicorn/no-unreadable-iife`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-unreadable-iife.ts): reject IIFEs whose nesting (multiple parens, arrow IIFE arguments) is hard to read.
|
|
879
|
+
- [`unicorn/no-unused-properties`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-unused-properties.ts): reject object properties that are never read after definition.
|
|
880
|
+
- [`unicorn/no-useless-collection-argument`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-useless-collection-argument.ts): reject useless initializer arguments (`new Set()`, `new Map([])`, `new Set(undefined)`) on collection constructors.
|
|
881
|
+
- [`unicorn/no-useless-error-capture-stack-trace`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-useless-error-capture-stack-trace.ts): reject `Error.captureStackTrace(this, constructor)` when the surrounding subclass relies on the default `Error` capture.
|
|
882
|
+
- [`unicorn/no-useless-fallback-in-spread`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-useless-fallback-in-spread.ts): reject `...(x ?? {})` and similar fallbacks when spreading; the spread of `null`/`undefined` is already a no-op.
|
|
883
|
+
- [`unicorn/no-useless-iterator-to-array`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-useless-iterator-to-array.ts): reject `[...iterator]` / `Array.from(iterator)` when the iterator can be consumed directly (e.g., inside `for...of`).
|
|
884
|
+
- [`unicorn/no-useless-length-check`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-useless-length-check.ts): reject `arr.length` checks that the iteration method itself already handles.
|
|
885
|
+
- [`unicorn/no-useless-promise-resolve-reject`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-useless-promise-resolve-reject.ts): reject `return Promise.resolve(x)` / `return Promise.reject(e)` inside `async` functions — `return x` and `throw e` work identically.
|
|
886
|
+
- [`unicorn/no-useless-spread`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-useless-spread.ts): reject spreading a single iterable into a new collection of the same kind (`[...arr]`, `{...obj}`) when the original would suffice.
|
|
887
|
+
- [`unicorn/no-useless-switch-case`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-useless-switch-case.ts): reject `case` clauses with an empty body that immediately precede a `default` whose body executes for them.
|
|
888
|
+
- [`unicorn/no-useless-undefined`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-useless-undefined.ts): reject explicit `undefined` returns, default initializers, and arguments where the omission has the same meaning.
|
|
889
|
+
- [`unicorn/no-zero-fractions`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-no-zero-fractions.ts): reject `1.0` / `1.` / `.5e0` in favor of `1`, `1`, and `0.5`.
|
|
890
|
+
- [`unicorn/number-literal-case`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-number-literal-case.ts): enforce one consistent case for the prefix and digits of hex/binary/octal literals (`0xFF` over `0xff`).
|
|
891
|
+
- [`unicorn/numeric-separators-style`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-numeric-separators-style.ts): enforce `_` separator grouping (every 3 digits for decimal, every 4 for hex) in numeric literals.
|
|
892
|
+
- [`unicorn/prefer-add-event-listener`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-add-event-listener.ts): prefer `addEventListener` / `removeEventListener` over assigning to `on*` properties.
|
|
893
|
+
- [`unicorn/prefer-array-find`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-array-find.ts): prefer `Array#find` / `Array#findLast` over `filter(...)[0]` / `filter(...).at(-1)`.
|
|
894
|
+
- [`unicorn/prefer-array-flat`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-array-flat.ts): prefer `Array#flat` over legacy flattening idioms (`[].concat(...arrs)`, `reduce` with `concat`).
|
|
895
|
+
- [`unicorn/prefer-array-flat-map`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-array-flat-map.ts): prefer `Array#flatMap` over `map(...).flat()`.
|
|
896
|
+
- [`unicorn/prefer-array-index-of`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-array-index-of.ts): prefer `indexOf` / `lastIndexOf` over `findIndex` / `findLastIndex` when matching by `===`.
|
|
897
|
+
- [`unicorn/prefer-array-some`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-array-some.ts): prefer `Array#some` over `filter(...).length > 0`, `find(...) !== undefined`, and similar shapes.
|
|
898
|
+
- [`unicorn/prefer-at`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-at.ts): prefer `Array#at` / `String#at` over index arithmetic and `charAt`.
|
|
899
|
+
- [`unicorn/prefer-bigint-literals`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-bigint-literals.ts): prefer `1n` over `BigInt(1)` and `BigInt("1")`.
|
|
900
|
+
- [`unicorn/prefer-blob-reading-methods`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-blob-reading-methods.ts): prefer `Blob#arrayBuffer()` / `Blob#text()` over `FileReader#readAsArrayBuffer` / `readAsText`.
|
|
901
|
+
- [`unicorn/prefer-class-fields`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-class-fields.ts): prefer class field declarations over constructor assignments to `this.field = value`.
|
|
902
|
+
- [`unicorn/prefer-classlist-toggle`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-classlist-toggle.ts): prefer `Element#classList.toggle(name, condition)` over manual `add`/`remove` branches.
|
|
903
|
+
- [`unicorn/prefer-code-point`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-code-point.ts): prefer `String#codePointAt` / `String.fromCodePoint` over `charCodeAt` / `fromCharCode`.
|
|
904
|
+
- [`unicorn/prefer-date-now`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-date-now.ts): prefer `Date.now()` over `new Date().getTime()` / `+new Date()`.
|
|
905
|
+
- [`unicorn/prefer-default-parameters`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-default-parameters.ts): prefer default parameter syntax over `x = x ?? default` reassignments inside the function body.
|
|
906
|
+
- [`unicorn/prefer-dom-node-append`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-dom-node-append.ts): prefer `Node#append` over `Node#appendChild`.
|
|
907
|
+
- [`unicorn/prefer-dom-node-dataset`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-dom-node-dataset.ts): prefer `Element#dataset` over `getAttribute` / `setAttribute` for `data-*` attributes.
|
|
908
|
+
- [`unicorn/prefer-dom-node-remove`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-dom-node-remove.ts): prefer `ChildNode#remove` over `parent.removeChild(child)`.
|
|
909
|
+
- [`unicorn/prefer-dom-node-text-content`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-dom-node-text-content.ts): prefer `Node#textContent` over `HTMLElement#innerText`.
|
|
910
|
+
- [`unicorn/prefer-event-target`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-event-target.ts): prefer `EventTarget` over Node's `EventEmitter` when the code is shared between Node and the browser.
|
|
911
|
+
- [`unicorn/prefer-export-from`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-export-from.ts): prefer `export ... from` over importing-then-re-exporting in two statements.
|
|
912
|
+
- [`unicorn/prefer-global-this`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-global-this.ts): prefer `globalThis` over `window`, `self`, and `global`.
|
|
913
|
+
- [`unicorn/prefer-import-meta-properties`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-import-meta-properties.ts): prefer `import.meta.dirname` / `import.meta.filename` over `fileURLToPath` workarounds.
|
|
914
|
+
- [`unicorn/prefer-includes`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-includes.ts): prefer `String#includes` / `Array#includes` over `indexOf(...) !== -1` and `some(x => x === target)`.
|
|
915
|
+
- [`unicorn/prefer-json-parse-buffer`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-json-parse-buffer.ts): prefer passing a `Buffer` directly to `JSON.parse` (Node 21+) instead of decoding to a string first.
|
|
916
|
+
- [`unicorn/prefer-keyboard-event-key`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-keyboard-event-key.ts): prefer `KeyboardEvent#key` over the deprecated `KeyboardEvent#keyCode` / `charCode` / `which`.
|
|
917
|
+
- [`unicorn/prefer-logical-operator-over-ternary`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-logical-operator-over-ternary.ts): prefer `a || b` / `a ?? b` over the equivalent ternary `a ? a : b`.
|
|
918
|
+
- [`unicorn/prefer-math-min-max`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-math-min-max.ts): prefer `Math.min` / `Math.max` over ternaries computing the same value.
|
|
919
|
+
- [`unicorn/prefer-math-trunc`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-math-trunc.ts): prefer `Math.trunc` over `~~x` / `x | 0` for integer truncation.
|
|
920
|
+
- [`unicorn/prefer-modern-dom-apis`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-modern-dom-apis.ts): prefer `before` / `after` / `replaceWith` over `insertBefore` / `replaceChild` / `insertAdjacentText`.
|
|
921
|
+
- [`unicorn/prefer-modern-math-apis`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-modern-math-apis.ts): prefer `Math.log10` / `Math.hypot` / `Math.log2` / `Math.cbrt` over their legacy approximations.
|
|
922
|
+
- [`unicorn/prefer-module`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-module.ts): prefer ES modules (`import` / `export`) over CommonJS (`require` / `module.exports` / `__dirname` / `__filename`).
|
|
923
|
+
- [`unicorn/prefer-native-coercion-functions`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-native-coercion-functions.ts): prefer the bare `String` / `Number` / `Boolean` / `BigInt` functions over `x => String(x)` arrow wrappers.
|
|
924
|
+
- [`unicorn/prefer-negative-index`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-negative-index.ts): prefer negative-index lookups (`arr.at(-1)`, `arr.slice(-2)`) over `arr.length - 1` / `arr.length - 2` arithmetic.
|
|
925
|
+
- [`unicorn/prefer-node-protocol`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-node-protocol.ts): prefer `node:fs` / `node:path` / etc. over the bare Node builtin specifier.
|
|
926
|
+
- [`unicorn/prefer-number-properties`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-number-properties.ts): prefer `Number.isNaN` / `Number.parseInt` / `Number.NaN` over their global counterparts.
|
|
927
|
+
- [`unicorn/prefer-object-from-entries`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-object-from-entries.ts): prefer `Object.fromEntries` over `reduce`-into-object patterns.
|
|
928
|
+
- [`unicorn/prefer-optional-catch-binding`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-optional-catch-binding.ts): prefer `catch { ... }` over `catch (e) { ... }` when `e` is unused.
|
|
929
|
+
- [`unicorn/prefer-prototype-methods`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-prototype-methods.ts): prefer borrowing prototype methods (`Array.prototype.slice.call`) over `[].slice.call` empty-instance lookups.
|
|
930
|
+
- [`unicorn/prefer-query-selector`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-query-selector.ts): prefer `Document#querySelector` over `getElementById`, `getElementsByClassName`, and `getElementsByTagName`.
|
|
931
|
+
- [`unicorn/prefer-reflect-apply`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-reflect-apply.ts): prefer `Reflect.apply(fn, thisArg, args)` over `Function.prototype.apply.call(fn, thisArg, args)`.
|
|
932
|
+
- [`unicorn/prefer-regexp-test`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-regexp-test.ts): prefer `RegExp#test` over `String#match` / `RegExp#exec` when only a boolean is needed.
|
|
933
|
+
- [`unicorn/prefer-response-static-json`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-response-static-json.ts): prefer `Response.json(value)` over `new Response(JSON.stringify(value), { headers: { "content-type": "application/json" } })`.
|
|
934
|
+
- [`unicorn/prefer-set-has`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-set-has.ts): prefer `Set#has` over `Array#includes` for repeated membership lookups against a constant collection.
|
|
935
|
+
- [`unicorn/prefer-set-size`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-set-size.ts): prefer `Set#size` over `[...set].length` and `Array.from(set).length`.
|
|
936
|
+
- [`unicorn/prefer-simple-condition-first`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-simple-condition-first.ts): prefer the simpler operand on the left of `&&`/`||` so the short-circuit reads in evaluation order.
|
|
937
|
+
- [`unicorn/prefer-single-call`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-single-call.ts): prefer a single `push` / `unshift` / `classList.add` / `addEventListener` with multiple arguments over consecutive single-argument calls.
|
|
938
|
+
- [`unicorn/prefer-spread`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-spread.ts): prefer spread (`[...arr]`, `[...str]`) over `Array.from`, `Array.prototype.slice.call`, `concat([])`, and `split('')`.
|
|
939
|
+
- [`unicorn/prefer-string-raw`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-string-raw.ts): prefer `String.raw` for path literals and other strings that would otherwise need backslash escapes.
|
|
940
|
+
- [`unicorn/prefer-string-replace-all`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-string-replace-all.ts): prefer `String#replaceAll(literal, replacement)` over `replace(/literal/g, replacement)`.
|
|
941
|
+
- [`unicorn/prefer-string-slice`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-string-slice.ts): prefer `String#slice` over the deprecated `substr` / `substring`.
|
|
942
|
+
- [`unicorn/prefer-string-starts-ends-with`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-string-starts-ends-with.ts): prefer `String#startsWith` / `String#endsWith` over equivalent `RegExp#test` and slice-then-compare idioms.
|
|
943
|
+
- [`unicorn/prefer-string-trim-start-end`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-string-trim-start-end.ts): prefer `String#trimStart` / `String#trimEnd` over the deprecated `trimLeft` / `trimRight`.
|
|
944
|
+
- [`unicorn/prefer-structured-clone`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-structured-clone.ts): prefer `structuredClone(x)` over `JSON.parse(JSON.stringify(x))` for deep cloning.
|
|
945
|
+
- [`unicorn/prefer-switch`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-switch.ts): prefer `switch` over chains of three or more `else if` clauses comparing the same discriminant.
|
|
946
|
+
- [`unicorn/prefer-ternary`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-ternary.ts): prefer a ternary over `if` / `else` whose two branches differ only in the right-hand side of a common assignment, `return`, or `throw`.
|
|
947
|
+
- [`unicorn/prefer-top-level-await`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-top-level-await.ts): prefer top-level `await` over `.then` / IIFE wrappers in ES modules.
|
|
948
|
+
- [`unicorn/prefer-type-error`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prefer-type-error.ts): require throwing `TypeError` (not a bare `Error`) when the surrounding `if` is a runtime type check.
|
|
949
|
+
- [`unicorn/prevent-abbreviations`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-prevent-abbreviations.ts): reject common identifier abbreviations (`btn`, `arr`, `idx`) and replace them with their long forms.
|
|
950
|
+
- [`unicorn/relative-url-style`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-relative-url-style.ts): enforce a single style (always leading `./` vs. never) for relative URLs passed to `new URL`.
|
|
951
|
+
- [`unicorn/require-array-join-separator`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-require-array-join-separator.ts): require an explicit separator argument to `Array#join` instead of relying on the default `","`.
|
|
952
|
+
- [`unicorn/require-module-attributes`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-require-module-attributes.ts): require non-empty `with` / `assert` options on `import` / `export` statements that use them at all.
|
|
953
|
+
- [`unicorn/require-module-specifiers`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-require-module-specifiers.ts): require a non-empty specifier list on every `import` / `export` statement.
|
|
954
|
+
- [`unicorn/require-number-to-fixed-digits-argument`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-require-number-to-fixed-digits-argument.ts): require an explicit digits argument to `Number#toFixed`.
|
|
955
|
+
- [`unicorn/require-post-message-target-origin`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-require-post-message-target-origin.ts): require an explicit `targetOrigin` argument to `window.postMessage`.
|
|
956
|
+
- [`unicorn/string-content`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-string-content.ts): enforce or replace configured string-content patterns (e.g., curly quotes for straight ones).
|
|
957
|
+
- [`unicorn/switch-case-braces`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-switch-case-braces.ts): enforce a consistent presence/absence of `{}` braces around `case` clauses inside `switch`.
|
|
958
|
+
- [`unicorn/switch-case-break-position`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-switch-case-break-position.ts): enforce a consistent position for `break` (or `return` / `throw`) inside `case` clauses.
|
|
959
|
+
- [`unicorn/template-indent`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-template-indent.ts): re-indent the body of tagged template literals (`html`, `gql`, `sql`) to the indentation of the opening backtick.
|
|
960
|
+
- [`unicorn/text-encoding-identifier-case`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-text-encoding-identifier-case.ts): enforce a canonical case for text-encoding identifiers — `"utf-8"` (not `"UTF-8"` / `"utf8"`).
|
|
961
|
+
- [`unicorn/throw-new-error`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/unicorn-throw-new-error.ts): require `throw new Error(...)` over `throw Error(...)`.
|
|
962
|
+
|
|
963
|
+
### Regular expressions
|
|
964
|
+
|
|
965
|
+
Regex-shape rules. Check the structure of regex literals — emptiness, uselessness, flag ordering, shorthand classes, Unicode support. Some rules supersede the regex-related rules in [ESLint core](#eslint-core); both ids exist so projects can keep the legacy ESLint names alongside the regexp-plugin variants.
|
|
966
|
+
|
|
967
|
+
Source: [`eslint-plugin-regexp`](https://github.com/ota-meshi/eslint-plugin-regexp).
|
|
968
|
+
|
|
969
|
+
- [`regexp/no-control-character`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-no-control-character.ts): reject control characters (`\x00`–`\x1F`) embedded in regex literals.
|
|
970
|
+
- [`regexp/no-dupe-characters-character-class`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-no-dupe-characters-character-class.ts): reject duplicate literal characters inside simple regex character classes (`/[aa]/`).
|
|
971
|
+
- [`regexp/no-empty-alternative`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-no-empty-alternative.ts): reject empty alternatives in a disjunction (`/a||b/`).
|
|
972
|
+
- [`regexp/no-empty-capturing-group`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-no-empty-capturing-group.ts): reject empty capturing groups such as `/()/`.
|
|
973
|
+
- [`regexp/no-empty-character-class`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-no-empty-character-class.ts): reject empty regex character classes (`[]`).
|
|
974
|
+
- [`regexp/no-empty-group`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-no-empty-group.ts): reject empty non-capturing groups such as `/(?:)/`.
|
|
975
|
+
- [`regexp/no-empty-lookarounds-assertion`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-no-empty-lookarounds-assertion.ts): reject empty lookaround assertions such as `/(?=)/` or `/(?!)/`.
|
|
976
|
+
- [`regexp/no-misleading-unicode-character`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-no-misleading-unicode-character.ts): reject misleading Unicode characters in regex classes.
|
|
977
|
+
- [`regexp/no-useless-character-class`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-no-useless-character-class.ts): reject single-character character classes such as `/[x]/`.
|
|
978
|
+
- [`regexp/no-useless-escape`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-no-useless-escape.ts): reject unnecessary escapes inside regex literals.
|
|
979
|
+
- [`regexp/no-useless-flag`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-no-useless-flag.ts): reject regex flags that the literal does not exercise.
|
|
980
|
+
- [`regexp/no-useless-quantifier`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-no-useless-quantifier.ts): reject quantifiers that do not change the match.
|
|
981
|
+
- [`regexp/no-useless-two-nums-quantifier`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-no-useless-two-nums-quantifier.ts): reject equal min/max quantifiers (`/a{2,2}/`) in favor of `/a{2}/`.
|
|
982
|
+
- [`regexp/no-zero-quantifier`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-no-zero-quantifier.ts): reject zero-repeat quantifiers (`/a{0}/`, `/a{0,0}/`).
|
|
983
|
+
- [`regexp/prefer-d`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-prefer-d.ts): prefer `\d` over `[0-9]` in regex literals.
|
|
984
|
+
- [`regexp/prefer-plus-quantifier`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-prefer-plus-quantifier.ts): prefer `+` over `{1,}` in regex literals.
|
|
985
|
+
- [`regexp/prefer-question-quantifier`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-prefer-question-quantifier.ts): prefer `?` over `{0,1}` in regex literals.
|
|
986
|
+
- [`regexp/prefer-star-quantifier`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-prefer-star-quantifier.ts): prefer `*` over `{0,}` in regex literals.
|
|
987
|
+
- [`regexp/prefer-w`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-prefer-w.ts): prefer `\w` over `[A-Za-z0-9_]` in regex literals.
|
|
988
|
+
- [`regexp/require-unicode-regexp`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-require-unicode-regexp.ts): require regex literals to use the `u` or `v` flag.
|
|
989
|
+
- [`regexp/require-unicode-sets-regexp`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-require-unicode-sets-regexp.ts): require regex literals to use the `v` flag specifically.
|
|
990
|
+
- [`regexp/sort-flags`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/regexp-sort-flags.ts): require regex flags to appear in canonical alphabetical order (`dgimsuvy`).
|
|
991
|
+
|
|
992
|
+
### Security
|
|
993
|
+
|
|
994
|
+
Security-focused TypeScript source rules. Report likely security smells — non-literal sinks for eval, file I/O, regex construction, child-process spawning, cryptographic primitives — that warrant human review even if no exploit is statically provable. Treat findings as *hints*, not proofs.
|
|
995
|
+
|
|
996
|
+
Source: [`eslint-plugin-security@4.0.0`](https://github.com/eslint-community/eslint-plugin-security).
|
|
997
|
+
|
|
998
|
+
- [`security/detect-bidi-characters`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/security-detect-bidi-characters.ts): detect Trojan Source bidi control characters.
|
|
999
|
+
- [`security/detect-buffer-noassert`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/security-detect-buffer-noassert.ts): detect Buffer reads/writes with `noAssert` set to true.
|
|
1000
|
+
- [`security/detect-child-process`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/security-detect-child-process.ts): detect child_process imports and non-literal `exec` commands.
|
|
1001
|
+
- [`security/detect-disable-mustache-escape`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/security-detect-disable-mustache-escape.ts): detect `escapeMarkup = false` on objects.
|
|
1002
|
+
- [`security/detect-eval-with-expression`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/security-detect-eval-with-expression.ts): detect `eval` fed by non-literal expressions.
|
|
1003
|
+
- [`security/detect-new-buffer`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/security-detect-new-buffer.ts): detect `new Buffer` with non-literal input.
|
|
1004
|
+
- [`security/detect-no-csrf-before-method-override`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/security-detect-no-csrf-before-method-override.ts): detect Express csrf middleware before methodOverride.
|
|
1005
|
+
- [`security/detect-non-literal-fs-filename`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/security-detect-non-literal-fs-filename.ts): detect filesystem calls with non-literal filename arguments.
|
|
1006
|
+
- [`security/detect-non-literal-regexp`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/security-detect-non-literal-regexp.ts): detect RegExp construction from non-literal patterns.
|
|
1007
|
+
- [`security/detect-non-literal-require`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/security-detect-non-literal-require.ts): detect `require` calls with non-literal module specifiers.
|
|
1008
|
+
- [`security/detect-object-injection`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/security-detect-object-injection.ts): detect dynamic bracket access sinks.
|
|
1009
|
+
- [`security/detect-possible-timing-attacks`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/security-detect-possible-timing-attacks.ts): detect direct equality comparisons involving secret-like identifiers.
|
|
1010
|
+
- [`security/detect-pseudoRandomBytes`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/security-detect-pseudoRandomBytes.ts): detect `crypto.pseudoRandomBytes`.
|
|
1011
|
+
- [`security/detect-unsafe-regex`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/security-detect-unsafe-regex.ts): detect high-confidence catastrophic backtracking regex shapes.
|
|
1012
|
+
|
|
1013
|
+
### JSDoc
|
|
1014
|
+
|
|
1015
|
+
Documentation-comment validation rules. Bundles `eslint-plugin-jsdoc` content checks (tag names, parameter coverage, descriptions) with the lone `eslint-plugin-tsdoc` syntax check (`jsdoc/tsdoc-syntax`) — both target `/** ... */` comments. Formatting concerns (alignment, indentation) are configured through the top-level [`format`](#format) block, not here.
|
|
1016
|
+
|
|
1017
|
+
Source: [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc), [`eslint-plugin-tsdoc`](https://github.com/microsoft/tsdoc).
|
|
1018
|
+
|
|
1019
|
+
- [`jsdoc/check-tag-names`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsdoc-check-tag-names.ts): reject unknown JSDoc block tag names.
|
|
1020
|
+
- [`jsdoc/check-values`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsdoc-check-values.ts): validate closed-set JSDoc tag values such as `@access`.
|
|
1021
|
+
- [`jsdoc/empty-tags`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsdoc-empty-tags.ts): reject content on marker-only JSDoc tags such as `@async`.
|
|
1022
|
+
- [`jsdoc/no-types`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsdoc-no-types.ts): reject redundant JSDoc type braces in TypeScript source comments.
|
|
1023
|
+
- [`jsdoc/reject-any-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsdoc-reject-any-type.ts): reject `any` and `*` inside JSDoc type braces.
|
|
1024
|
+
- [`jsdoc/reject-function-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsdoc-reject-function-type.ts): reject the unsafe `Function` type inside JSDoc type braces.
|
|
1025
|
+
- [`jsdoc/require-description`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsdoc-require-description.ts): require JSDoc blocks to include block-level description text.
|
|
1026
|
+
- [`jsdoc/require-param-description`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsdoc-require-param-description.ts): require every `@param` tag with a name to include a description.
|
|
1027
|
+
- [`jsdoc/require-param-name`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsdoc-require-param-name.ts): require every `@param` tag to include a parameter name.
|
|
1028
|
+
- [`jsdoc/require-property-description`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsdoc-require-property-description.ts): require every `@property` tag with a name to include a description.
|
|
1029
|
+
- [`jsdoc/require-property-name`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsdoc-require-property-name.ts): require every `@property` tag to include a property name.
|
|
1030
|
+
- [`jsdoc/require-returns-description`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsdoc-require-returns-description.ts): require every `@returns` tag to include a description.
|
|
1031
|
+
- [`jsdoc/tsdoc-syntax`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/jsdoc-tsdoc-syntax.ts): validate malformed TSDoc block tags and inline tags in `/** ... */` comments.
|
|
1032
|
+
|
|
1033
|
+
### Functional
|
|
1034
|
+
|
|
1035
|
+
Functional-programming policy rules. Push code toward immutability, side-effect-free expressions, and expression-style control flow. Most rules are useful in pieces — projects rarely enable the whole family at `"error"`. Enabling the whole set together expresses a strict functional-core / imperative-shell discipline. Diagnostic-only: `ttsc fix` does not rewrite mutation, classes, exceptions, loops, or branching into a functional design.
|
|
1036
|
+
|
|
1037
|
+
Source: [`eslint-plugin-functional`](https://github.com/eslint-functional/eslint-plugin-functional).
|
|
1038
|
+
|
|
1039
|
+
Recommended preset for projects committing to the discipline:
|
|
1040
|
+
|
|
1041
|
+
```ts
|
|
1042
|
+
// lint.config.ts
|
|
1043
|
+
export default {
|
|
1044
|
+
rules: {
|
|
1045
|
+
"functional/no-let": "error",
|
|
1046
|
+
"functional/no-loop-statements": "error",
|
|
1047
|
+
"functional/no-conditional-statements": "error",
|
|
1048
|
+
"functional/no-throw-statements": "error",
|
|
1049
|
+
"functional/no-try-statements": "error",
|
|
1050
|
+
"functional/no-classes": "error",
|
|
1051
|
+
"functional/immutable-data": "error",
|
|
1052
|
+
"functional/prefer-readonly-type": "error",
|
|
1053
|
+
"functional/type-declaration-immutability": ["error", {
|
|
1054
|
+
rules: [{ identifiers: ".*" }],
|
|
1055
|
+
}],
|
|
1056
|
+
},
|
|
1057
|
+
} satisfies ITtscLintConfig;
|
|
1058
|
+
```
|
|
1059
|
+
|
|
1060
|
+
- [`functional/functional-parameters`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-functional-parameters.ts): rejects rest parameters, `arguments`, and optionally zero-parameter functions.
|
|
1061
|
+
- [`functional/immutable-data`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-immutable-data.ts): rejects writes through object/array members and mutable collection methods.
|
|
1062
|
+
- [`functional/no-class-inheritance`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-no-class-inheritance.ts): rejects class inheritance and abstract classes.
|
|
1063
|
+
- [`functional/no-classes`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-no-classes.ts): rejects class declarations and expressions.
|
|
1064
|
+
- [`functional/no-conditional-statements`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-no-conditional-statements.ts): rejects `if` and `switch` statements.
|
|
1065
|
+
- [`functional/no-expression-statements`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-no-expression-statements.ts): rejects expression statements used for side effects.
|
|
1066
|
+
- [`functional/no-let`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-no-let.ts): rejects `let` declarations.
|
|
1067
|
+
- [`functional/no-loop-statements`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-no-loop-statements.ts): rejects imperative loop statements.
|
|
1068
|
+
- [`functional/no-mixed-types`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-no-mixed-types.ts): rejects type/interface declarations that mix member shapes.
|
|
1069
|
+
- [`functional/no-promise-reject`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-no-promise-reject.ts): rejects `Promise.reject(...)`.
|
|
1070
|
+
- [`functional/no-return-void`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-no-return-void.ts): rejects void returns and void-returning declarations.
|
|
1071
|
+
- [`functional/no-this-expressions`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-no-this-expressions.ts): rejects `this` expressions.
|
|
1072
|
+
- [`functional/no-throw-statements`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-no-throw-statements.ts): rejects `throw` statements.
|
|
1073
|
+
- [`functional/no-try-statements`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-no-try-statements.ts): rejects `try`/`catch`/`finally` statements.
|
|
1074
|
+
- [`functional/prefer-immutable-types`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-prefer-immutable-types.ts): prefers readonly/immutable type annotations.
|
|
1075
|
+
- [`functional/prefer-property-signatures`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-prefer-property-signatures.ts): prefers function-property signatures over method signatures.
|
|
1076
|
+
- [`functional/prefer-readonly-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-prefer-readonly-type.ts): requires readonly array, tuple, and property type syntax.
|
|
1077
|
+
- [`functional/prefer-tacit`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-prefer-tacit.ts): reports simple one-argument forwarding wrappers.
|
|
1078
|
+
- [`functional/readonly-type`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-readonly-type.ts): enforces the configured readonly type spelling.
|
|
1079
|
+
- [`functional/type-declaration-immutability`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/functional-type-declaration-immutability.ts): requires matching type declarations to expose readonly member shapes.
|
|
1080
|
+
|
|
1081
|
+
### Architecture boundaries
|
|
1082
|
+
|
|
1083
|
+
Architecture-boundary rules enforce import direction and module visibility between configured source-path *elements* (layers, features, apps in a monorepo). Every rule operates on the *resolved source file* of an import — relative imports are followed to the real `.ts`/`.tsx`/`.d.ts` file before classification. Boundary diagnostics do not offer autofixes — a violation usually needs an API or architecture decision, not a mechanical import rewrite.
|
|
1084
|
+
|
|
1085
|
+
Source: ported from [`eslint-plugin-boundaries`](https://github.com/javierbrea/eslint-plugin-boundaries).
|
|
1086
|
+
|
|
1087
|
+
Example configuration:
|
|
1088
|
+
|
|
1089
|
+
```ts
|
|
1090
|
+
// lint.config.ts
|
|
1091
|
+
export default {
|
|
1092
|
+
rules: {
|
|
1093
|
+
"boundaries/element-types": ["error", {
|
|
1094
|
+
elements: [
|
|
1095
|
+
{ type: "app", pattern: "src/app/**" },
|
|
1096
|
+
{ type: "domain", pattern: "src/domain/**", entry: "index.ts", private: "internal/**" },
|
|
1097
|
+
],
|
|
1098
|
+
rules: [{ from: "app", disallow: "domain" }],
|
|
1099
|
+
}],
|
|
1100
|
+
"boundaries/entry-point": ["error", {
|
|
1101
|
+
elements: [{ type: "domain", pattern: "src/domain/**", entry: "index.ts" }],
|
|
1102
|
+
}],
|
|
1103
|
+
"boundaries/no-private": ["error", {
|
|
1104
|
+
elements: [{ type: "domain", pattern: "src/domain/**", private: "internal/**" }],
|
|
1105
|
+
}],
|
|
1106
|
+
"boundaries/no-unknown": ["error", {
|
|
1107
|
+
elements: [
|
|
1108
|
+
{ type: "app", pattern: "src/app/**" },
|
|
1109
|
+
{ type: "domain", pattern: "src/domain/**" },
|
|
1110
|
+
],
|
|
1111
|
+
}],
|
|
1112
|
+
"boundaries/external": ["error", { disallow: ["@legacy/sdk"] }],
|
|
1113
|
+
},
|
|
1114
|
+
} satisfies ITtscLintConfig;
|
|
1115
|
+
```
|
|
1116
|
+
|
|
1117
|
+
- [`boundaries/dependencies`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/boundaries-dependencies.ts): unified dependency-direction rule from upstream `eslint-plugin-boundaries`, intended to replace `element-types` / `entry-point` / `external` / `no-private` / `no-unknown` with a single policy block.
|
|
1118
|
+
- [`boundaries/element-types`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/boundaries-element-types.ts): enforces allowed dependency directions between configured source-path element types.
|
|
1119
|
+
- [`boundaries/entry-point`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/boundaries-entry-point.ts): requires imports into an element to target its configured public entry files.
|
|
1120
|
+
- [`boundaries/external`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/boundaries-external.ts): restricts external package imports by package/specifier pattern.
|
|
1121
|
+
- [`boundaries/no-private`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/boundaries-no-private.ts): rejects imports of configured private files from outside their element.
|
|
1122
|
+
- [`boundaries/no-unknown`](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/boundaries-no-unknown.ts): rejects relative imports whose resolved source file matches no configured element.
|
|
1123
|
+
|
|
303
1124
|
## Third-party rule plugins
|
|
304
1125
|
|
|
305
1126
|
Other npm packages can ship lint rules that compile into the same `@ttsc/lint` binary and report through the same diagnostic stream as built-ins. Declare them in `lint.config.ts`:
|
|
@@ -326,3 +1147,61 @@ Contributor rules emit autofixes the same way built-ins do — call `ctx.ReportF
|
|
|
326
1147
|
Thanks for your support.
|
|
327
1148
|
|
|
328
1149
|
Your [donation](https://github.com/sponsors/samchon) encourages `ttsc` development.
|
|
1150
|
+
|
|
1151
|
+
## References
|
|
1152
|
+
|
|
1153
|
+
<!--
|
|
1154
|
+
AGENT INSTRUCTIONS — adding a new upstream reference.
|
|
1155
|
+
|
|
1156
|
+
When you add a new rule family to [Rules](#rules), do all of:
|
|
1157
|
+
|
|
1158
|
+
1. Append one bullet to the list immediately below. Shape:
|
|
1159
|
+
- [\`<upstream-package>\`](https://github.com/<org>/<repo>)
|
|
1160
|
+
Use the npm package name in backticks. Drop the leading `eslint-plugin-` only
|
|
1161
|
+
when the rule family namespace itself drops it (e.g. `@next/eslint-plugin-next`,
|
|
1162
|
+
`@vitest/eslint-plugin`).
|
|
1163
|
+
2. If the family namespace inside `@ttsc/lint` (`react/*`, `jest/*`, …) is a port of
|
|
1164
|
+
that single upstream, mention the namespace in `### Claim ownership` so the
|
|
1165
|
+
maintainers know the port belongs to their family. The paragraph already lists
|
|
1166
|
+
`react/*, jest/*, playwright/*, tanstack-query/*, promise/*, and the other family
|
|
1167
|
+
namespaces` — extend that list naturally; do not start a new sentence per family.
|
|
1168
|
+
3. Do NOT put license parentheticals (`(MIT)`, `(BSD-3-Clause)`, etc.) after the
|
|
1169
|
+
link. Reader clicks through if they need the license.
|
|
1170
|
+
4. Order is roughly the same as the family ordering in [Rules](#rules); insert at
|
|
1171
|
+
the matching position rather than appending blindly at the end.
|
|
1172
|
+
-->
|
|
1173
|
+
|
|
1174
|
+
`@ttsc/lint` ports the rule semantics from each of the following upstream projects. Each family in [Rules](#rules) cites its origin under a `Source:` line; this section is the consolidated index.
|
|
1175
|
+
|
|
1176
|
+
- [ESLint core rules](https://eslint.org/docs/latest/rules/)
|
|
1177
|
+
- [`typescript-eslint`](https://github.com/typescript-eslint/typescript-eslint)
|
|
1178
|
+
- [`eslint-plugin-react`](https://github.com/jsx-eslint/eslint-plugin-react)
|
|
1179
|
+
- [`eslint-plugin-react-hooks`](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks)
|
|
1180
|
+
- [`eslint-plugin-react-refresh`](https://github.com/ArnaudBarre/eslint-plugin-react-refresh)
|
|
1181
|
+
- [`eslint-plugin-react-perf`](https://github.com/cvazac/eslint-plugin-react-perf)
|
|
1182
|
+
- [`eslint-plugin-jsx-a11y`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y)
|
|
1183
|
+
- [`@next/eslint-plugin-next`](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next)
|
|
1184
|
+
- [`eslint-plugin-solid`](https://github.com/solidjs-community/eslint-plugin-solid)
|
|
1185
|
+
- [`eslint-plugin-jest`](https://github.com/jest-community/eslint-plugin-jest)
|
|
1186
|
+
- [`@vitest/eslint-plugin`](https://github.com/vitest-dev/eslint-plugin-vitest)
|
|
1187
|
+
- [`eslint-plugin-testing-library`](https://github.com/testing-library/eslint-plugin-testing-library)
|
|
1188
|
+
- [`eslint-plugin-playwright`](https://github.com/playwright-community/eslint-plugin-playwright)
|
|
1189
|
+
- [`eslint-plugin-cypress`](https://github.com/cypress-io/eslint-plugin-cypress)
|
|
1190
|
+
- [`eslint-plugin-storybook`](https://github.com/storybookjs/eslint-plugin-storybook)
|
|
1191
|
+
- [`@tanstack/eslint-plugin-query`](https://github.com/TanStack/query/tree/main/packages/eslint-plugin-query)
|
|
1192
|
+
- [`eslint-plugin-promise`](https://github.com/eslint-community/eslint-plugin-promise)
|
|
1193
|
+
- [`eslint-plugin-regexp`](https://github.com/ota-meshi/eslint-plugin-regexp)
|
|
1194
|
+
- [`eslint-plugin-security@4.0.0`](https://github.com/eslint-community/eslint-plugin-security)
|
|
1195
|
+
- [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc)
|
|
1196
|
+
- [`eslint-plugin-tsdoc`](https://github.com/microsoft/tsdoc)
|
|
1197
|
+
- [`eslint-plugin-functional`](https://github.com/eslint-functional/eslint-plugin-functional)
|
|
1198
|
+
- [`eslint-plugin-boundaries`](https://github.com/javierbrea/eslint-plugin-boundaries)
|
|
1199
|
+
|
|
1200
|
+
### Claim ownership
|
|
1201
|
+
|
|
1202
|
+
To the maintainers of every plugin listed above: the rule semantics under `react/*`, `jest/*`, `playwright/*`, `tanstack-query/*`, `promise/*`, and the other family namespaces inside `@ttsc/lint` are a Go re-implementation of your work for the TypeScript-Go Checker. The intent is convenience — projects on `ttsc` get your rules without standing up a separate ESLint process — not ownership.
|
|
1203
|
+
|
|
1204
|
+
If you would prefer to publish a first-party `@ttsc/lint` plugin for your family yourself, you are welcome to take the Go sources under [`packages/lint/linthost/rules_*.go`](https://github.com/samchon/ttsc/tree/master/packages/lint/linthost) and the fixtures under [`tests/test-lint/src/cases/`](https://github.com/samchon/ttsc/tree/master/tests/test-lint/src/cases) and ship them as your own contributor plugin. Open an issue at [samchon/ttsc](https://github.com/samchon/ttsc/issues) when the upstream package is ready, and I will retire the in-tree port and add a redirect line under [Rules](#rules) pointing at your package. Same offer for partial coverage — name a subset and I will remove just those rules.
|
|
1205
|
+
|
|
1206
|
+
The contributor-plugin walkthrough is the [`@ttsc/lint` development guide](https://ttsc.dev/docs/development/walkthroughs/lint).
|
|
1207
|
+
|