@ttsc/lint 0.14.0-dev.20260529.2 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -25
- package/lib/defaultFormat.d.ts +10 -6
- package/lib/defaultFormat.js +10 -6
- package/lib/defaultFormat.js.map +1 -1
- package/lib/structures/ITtscLintConfig.d.ts +5 -5
- package/lib/structures/TtscLintRuleSetting.d.ts +19 -19
- package/lib/structures/{ITtscLintFormat.d.ts → format/ITtscLintFormat.d.ts} +45 -70
- package/lib/structures/format/ITtscLintFormat.js.map +1 -0
- package/lib/structures/format/ITtscLintFormatJsDoc.d.ts +15 -0
- package/lib/structures/format/ITtscLintFormatJsDoc.js +3 -0
- package/lib/structures/format/ITtscLintFormatJsDoc.js.map +1 -0
- package/lib/structures/format/ITtscLintFormatSortImports.d.ts +54 -0
- package/lib/structures/format/ITtscLintFormatSortImports.js +3 -0
- package/lib/structures/format/ITtscLintFormatSortImports.js.map +1 -0
- package/lib/structures/format/index.d.ts +3 -0
- package/lib/structures/format/index.js +20 -0
- package/lib/structures/format/index.js.map +1 -0
- package/lib/structures/index.d.ts +1 -1
- package/lib/structures/index.js +1 -1
- package/lib/structures/index.js.map +1 -1
- package/lib/structures/rules/ITtscLintBoundariesRuleOptions.d.ts +18 -27
- package/lib/structures/rules/ITtscLintBoundariesRuleOptions.js +4 -5
- package/lib/structures/rules/ITtscLintBoundariesRuleOptions.js.map +1 -1
- package/lib/structures/rules/ITtscLintBoundariesRules.d.ts +29 -33
- package/lib/structures/rules/ITtscLintContributorRules.d.ts +6 -7
- package/lib/structures/rules/ITtscLintCoreRules.d.ts +380 -408
- package/lib/structures/rules/ITtscLintCypressRuleOptions.d.ts +5 -5
- package/lib/structures/rules/ITtscLintCypressRuleOptions.js +2 -2
- package/lib/structures/rules/ITtscLintCypressRules.d.ts +34 -38
- package/lib/structures/rules/ITtscLintFunctionalRuleOptions.d.ts +21 -24
- package/lib/structures/rules/ITtscLintFunctionalRuleOptions.js +2 -2
- package/lib/structures/rules/ITtscLintFunctionalRules.d.ts +51 -56
- package/lib/structures/rules/ITtscLintJestRules.d.ts +63 -74
- package/lib/structures/rules/ITtscLintJsdocRules.d.ts +47 -54
- package/lib/structures/rules/ITtscLintJsxA11yRules.d.ts +94 -102
- package/lib/structures/rules/ITtscLintNextjsRules.d.ts +50 -55
- package/lib/structures/rules/ITtscLintPlaywrightRules.d.ts +104 -122
- package/lib/structures/rules/ITtscLintPromiseRules.d.ts +62 -71
- package/lib/structures/rules/ITtscLintReactPerfRuleOptions.d.ts +4 -4
- package/lib/structures/rules/ITtscLintReactPerfRules.d.ts +17 -19
- package/lib/structures/rules/ITtscLintReactRuleOptions.d.ts +8 -10
- package/lib/structures/rules/ITtscLintReactRuleOptions.js +1 -2
- package/lib/structures/rules/ITtscLintReactRuleOptions.js.map +1 -1
- package/lib/structures/rules/ITtscLintReactRules.d.ts +91 -104
- package/lib/structures/rules/ITtscLintRegexpRules.d.ts +46 -54
- package/lib/structures/rules/ITtscLintRuleOptionsMap.d.ts +7 -8
- package/lib/structures/rules/ITtscLintSecurityRules.d.ts +45 -52
- package/lib/structures/rules/ITtscLintSolidRules.d.ts +53 -56
- package/lib/structures/rules/ITtscLintStorybookRuleOptions.d.ts +3 -4
- package/lib/structures/rules/ITtscLintStorybookRules.d.ts +60 -69
- package/lib/structures/rules/ITtscLintTanstackQueryRules.d.ts +31 -37
- package/lib/structures/rules/ITtscLintTestingLibraryRuleOptions.d.ts +2 -3
- package/lib/structures/rules/ITtscLintTestingLibraryRules.d.ts +102 -119
- package/lib/structures/rules/ITtscLintTypeScriptRules.d.ts +460 -518
- package/lib/structures/rules/ITtscLintVitestRules.d.ts +43 -51
- package/linthost/config.go +89 -72
- package/linthost/config_format.go +265 -99
- package/linthost/directives.go +5 -1
- package/linthost/display_width.go +72 -0
- package/linthost/fix.go +26 -1
- package/linthost/format.go +222 -25
- package/linthost/format_editor_settings.go +262 -0
- package/linthost/lsp.go +8 -4
- package/linthost/print_dispatch.go +3 -0
- package/linthost/print_doc.go +13 -0
- package/linthost/print_engine.go +68 -11
- package/linthost/print_nodes_array.go +167 -5
- package/linthost/print_nodes_call.go +786 -77
- package/linthost/print_nodes_function.go +43 -0
- package/linthost/print_nodes_imports.go +64 -14
- package/linthost/print_nodes_list.go +214 -8
- package/linthost/print_nodes_object.go +14 -6
- package/linthost/print_nodes_ternary.go +147 -0
- package/linthost/rules_boundaries.go +400 -400
- package/linthost/rules_camelcase.go +81 -81
- package/linthost/rules_complexity.go +52 -51
- package/linthost/rules_consistent_return.go +81 -81
- package/linthost/rules_core_extra.go +472 -472
- package/linthost/rules_curly.go +43 -43
- package/linthost/rules_default_case.go +15 -15
- package/linthost/rules_default_case_last.go +22 -22
- package/linthost/rules_format_arrow_parens.go +213 -0
- package/linthost/rules_format_bracket_spacing.go +117 -0
- package/linthost/rules_format_clause_join.go +179 -0
- package/linthost/rules_format_declaration_header.go +664 -0
- package/linthost/rules_format_indent.go +616 -0
- package/linthost/rules_format_jsdoc.go +4 -4
- package/linthost/rules_format_orphan_semi.go +106 -0
- package/linthost/rules_format_parameter_properties.go +175 -0
- package/linthost/rules_format_print_width.go +180 -69
- package/linthost/rules_format_quote_props.go +169 -0
- package/linthost/rules_format_quotes.go +75 -29
- package/linthost/rules_format_semi.go +185 -10
- package/linthost/rules_format_sort_imports.go +517 -121
- package/linthost/rules_format_statement_split.go +368 -0
- package/linthost/rules_format_ternary_nullish_parens.go +77 -0
- package/linthost/rules_format_trailing_comma.go +21 -2
- package/linthost/rules_format_whitespace.go +336 -0
- package/linthost/rules_functional.go +688 -688
- package/linthost/rules_gap.go +146 -11
- package/linthost/rules_grouped_accessor_pairs.go +60 -60
- package/linthost/rules_guard_for_in.go +122 -122
- package/linthost/rules_id_length.go +44 -44
- package/linthost/rules_imports.go +11 -3
- package/linthost/rules_init_declarations.go +25 -25
- package/linthost/rules_jsx_a11y.go +844 -844
- package/linthost/rules_max_classes_per_file.go +24 -24
- package/linthost/rules_max_depth.go +43 -43
- package/linthost/rules_max_lines.go +53 -53
- package/linthost/rules_max_lines_per_function.go +28 -28
- package/linthost/rules_max_nested_callbacks.go +26 -26
- package/linthost/rules_max_params.go +20 -20
- package/linthost/rules_max_statements.go +29 -29
- package/linthost/rules_nextjs.go +5 -5
- package/linthost/rules_no_else_return.go +38 -38
- package/linthost/rules_no_empty_named_blocks.go +45 -45
- package/linthost/rules_no_import_assign.go +96 -96
- package/linthost/rules_no_invalid_this.go +19 -19
- package/linthost/rules_no_loop_func.go +43 -43
- package/linthost/rules_no_magic_numbers.go +60 -60
- package/linthost/rules_no_mixed_operators.go +44 -44
- package/linthost/rules_no_param_reassign.go +64 -64
- package/linthost/rules_no_restricted_imports.go +45 -45
- package/linthost/rules_no_restricted_syntax.go +17 -17
- package/linthost/rules_no_shadow.go +112 -112
- package/linthost/rules_no_unreachable.go +36 -36
- package/linthost/rules_no_useless_assignment.go +79 -79
- package/linthost/rules_no_useless_constructor.go +167 -167
- package/linthost/rules_no_useless_return.go +28 -28
- package/linthost/rules_prefer_arrow_callback.go +74 -74
- package/linthost/rules_prefer_destructuring.go +61 -61
- package/linthost/rules_prefer_named_capture_group.go +87 -87
- package/linthost/rules_prefer_rest_params.go +61 -61
- package/linthost/rules_promise.go +800 -800
- package/linthost/rules_react.go +600 -600
- package/linthost/rules_react_extras.go +162 -162
- package/linthost/rules_react_hooks.go +2 -2
- package/linthost/rules_react_perf.go +231 -231
- package/linthost/rules_regexp.go +293 -293
- package/linthost/rules_security.go +613 -613
- package/linthost/rules_sort_imports.go +37 -37
- package/linthost/rules_sort_keys.go +88 -88
- package/linthost/rules_suggestions.go +13 -0
- package/linthost/rules_ts.go +2 -2
- package/linthost/rules_ts_async.go +247 -247
- package/linthost/rules_ts_class_literal_property_style.go +64 -64
- package/linthost/rules_ts_consistent_type_exports.go +209 -209
- package/linthost/rules_ts_explicit_function_return_type.go +35 -35
- package/linthost/rules_ts_extra.go +6 -2
- package/linthost/rules_ts_no_base_to_string.go +140 -140
- package/linthost/rules_ts_no_confusing_void.go +28 -28
- package/linthost/rules_ts_no_deprecated.go +110 -110
- package/linthost/rules_ts_no_for_in_array.go +45 -45
- package/linthost/rules_ts_no_magic_numbers.go +67 -67
- package/linthost/rules_ts_no_meaningless_void_operator.go +44 -44
- package/linthost/rules_ts_no_misused_spread.go +64 -64
- package/linthost/rules_ts_no_redundant_type_constituents.go +72 -72
- package/linthost/rules_ts_no_restricted_types.go +28 -28
- package/linthost/rules_ts_no_unnecessary_boolean_literal_compare.go +87 -87
- package/linthost/rules_ts_no_unnecessary_condition.go +184 -184
- package/linthost/rules_ts_no_unnecessary_qualifier.go +72 -72
- package/linthost/rules_ts_no_unnecessary_template_expression.go +120 -120
- package/linthost/rules_ts_no_unnecessary_type_arguments.go +171 -171
- package/linthost/rules_ts_no_unnecessary_type_assertion.go +90 -90
- package/linthost/rules_ts_no_unsafe_argument.go +50 -50
- package/linthost/rules_ts_no_unsafe_assignment.go +60 -60
- package/linthost/rules_ts_no_unsafe_call.go +40 -40
- package/linthost/rules_ts_no_unsafe_enum_comparison.go +147 -147
- package/linthost/rules_ts_no_unsafe_member_access.go +29 -29
- package/linthost/rules_ts_no_unsafe_return.go +64 -64
- package/linthost/rules_ts_no_unsafe_unary_minus.go +42 -42
- package/linthost/rules_ts_no_useless_constructor.go +20 -20
- package/linthost/rules_ts_non_nullable_type_assertion_style.go +60 -60
- package/linthost/rules_ts_parameter_properties.go +10 -10
- package/linthost/rules_ts_prefer_find.go +116 -116
- package/linthost/rules_ts_prefer_includes.go +173 -173
- package/linthost/rules_ts_prefer_nullish_coalescing.go +54 -54
- package/linthost/rules_ts_prefer_optional_chain.go +156 -156
- package/linthost/rules_ts_prefer_promise_reject_errors.go +104 -104
- package/linthost/rules_ts_prefer_readonly.go +31 -31
- package/linthost/rules_ts_prefer_reduce_type_parameter.go +74 -74
- package/linthost/rules_ts_prefer_regexp_exec.go +69 -69
- package/linthost/rules_ts_prefer_return_this_type.go +79 -79
- package/linthost/rules_ts_prefer_string_starts_ends_with.go +237 -237
- package/linthost/rules_ts_promise_function_async.go +41 -41
- package/linthost/rules_ts_related_getter_setter_pairs.go +61 -61
- package/linthost/rules_ts_require_array_sort_compare.go +58 -58
- package/linthost/rules_ts_restrict_plus_operands.go +82 -82
- package/linthost/rules_ts_restrict_template_expressions.go +50 -50
- package/linthost/rules_ts_simple.go +249 -249
- package/linthost/rules_ts_sort_type_constituents.go +88 -88
- package/linthost/rules_ts_strict_boolean_expressions.go +103 -103
- package/linthost/rules_ts_switch_exhaustiveness_check.go +90 -90
- package/linthost/rules_ts_unbound_method.go +65 -65
- package/linthost/rules_tsdoc.go +88 -88
- package/linthost/rules_unicorn_better_regex.go +1 -1
- package/linthost/rules_unicorn_catch_error_name.go +19 -19
- package/linthost/rules_unicorn_consistent_assert.go +20 -20
- package/linthost/rules_unicorn_consistent_date_clone.go +27 -27
- package/linthost/rules_unicorn_consistent_destructuring.go +3 -3
- package/linthost/rules_unicorn_consistent_empty_array_spread.go +34 -34
- package/linthost/rules_unicorn_consistent_existence_index_check.go +42 -42
- package/linthost/rules_unicorn_consistent_function_scoping.go +3 -3
- package/linthost/rules_unicorn_consistent_template_literal_escape.go +3 -3
- package/linthost/rules_unicorn_custom_error_definition.go +92 -92
- package/linthost/rules_unicorn_empty_brace_spaces.go +47 -47
- package/linthost/rules_unicorn_error_message.go +34 -34
- package/linthost/rules_unicorn_escape_case.go +14 -14
- package/linthost/rules_unicorn_expiring_todo_comments.go +36 -36
- package/linthost/rules_unicorn_explicit_length_check.go +51 -51
- package/linthost/rules_unicorn_filename_case.go +1 -1
- package/linthost/rules_unicorn_import_style.go +1 -1
- package/linthost/rules_unicorn_isolated_functions.go +2 -2
- package/linthost/rules_unicorn_new_for_builtins.go +49 -49
- package/linthost/rules_unicorn_no_abusive_eslint_disable.go +31 -31
- package/linthost/rules_unicorn_no_accessor_recursion.go +69 -69
- package/linthost/rules_unicorn_no_anonymous_default_export.go +40 -40
- package/linthost/rules_unicorn_no_array_callback_reference.go +33 -33
- package/linthost/rules_unicorn_no_array_for_each.go +14 -14
- package/linthost/rules_unicorn_no_array_method_this_argument.go +29 -29
- package/linthost/rules_unicorn_no_array_reduce.go +15 -15
- package/linthost/rules_unicorn_no_array_reverse.go +17 -17
- package/linthost/rules_unicorn_no_array_sort.go +17 -17
- package/linthost/rules_unicorn_no_await_expression_member.go +12 -12
- package/linthost/rules_unicorn_no_await_in_promise_methods.go +38 -38
- package/linthost/rules_unicorn_no_console_spaces.go +30 -30
- package/linthost/rules_unicorn_no_document_cookie.go +13 -13
- package/linthost/rules_unicorn_no_empty_file.go +16 -16
- package/linthost/rules_unicorn_no_for_loop.go +58 -58
- package/linthost/rules_unicorn_no_hex_escape.go +11 -11
- package/linthost/rules_unicorn_no_immediate_mutation.go +55 -55
- package/linthost/rules_unicorn_no_instanceof_builtins.go +34 -34
- package/linthost/rules_unicorn_no_invalid_fetch_options.go +52 -52
- package/linthost/rules_unicorn_no_invalid_remove_event_listener.go +25 -25
- package/linthost/rules_unicorn_no_keyword_prefix.go +56 -56
- package/linthost/rules_unicorn_no_lonely_if.go +21 -21
- package/linthost/rules_unicorn_no_magic_array_flat_depth.go +22 -22
- package/linthost/rules_unicorn_no_named_default.go +25 -25
- package/linthost/rules_unicorn_no_negated_condition.go +54 -54
- package/linthost/rules_unicorn_no_negation_in_equality_check.go +23 -23
- package/linthost/rules_unicorn_no_nested_ternary.go +15 -15
- package/linthost/rules_unicorn_no_new_array.go +5 -5
- package/linthost/rules_unicorn_no_new_buffer.go +5 -5
- package/linthost/rules_unicorn_no_null.go +2 -2
- package/linthost/rules_unicorn_no_object_as_default_parameter.go +19 -19
- package/linthost/rules_unicorn_no_process_exit.go +17 -17
- package/linthost/rules_unicorn_no_single_promise_in_promise_methods.go +29 -29
- package/linthost/rules_unicorn_no_static_only_class.go +27 -27
- package/linthost/rules_unicorn_no_thenable.go +47 -47
- package/linthost/rules_unicorn_no_this_assignment.go +10 -10
- package/linthost/rules_unicorn_no_typeof_undefined.go +31 -31
- package/linthost/rules_unicorn_no_unnecessary_array_flat_depth.go +23 -23
- package/linthost/rules_unicorn_no_unnecessary_array_splice_count.go +37 -37
- package/linthost/rules_unicorn_no_unnecessary_await.go +24 -24
- package/linthost/rules_unicorn_no_unnecessary_slice_end.go +22 -22
- package/linthost/rules_unicorn_no_unreadable_array_destructuring.go +67 -67
- package/linthost/rules_unicorn_no_unreadable_iife.go +22 -22
- package/linthost/rules_unicorn_no_useless_collection_argument.go +34 -34
- package/linthost/rules_unicorn_no_useless_error_capture_stack_trace.go +18 -18
- package/linthost/rules_unicorn_no_useless_fallback_in_spread.go +49 -49
- package/linthost/rules_unicorn_no_useless_iterator_to_array.go +41 -41
- package/linthost/rules_unicorn_no_useless_length_check.go +82 -82
- package/linthost/rules_unicorn_no_useless_promise_resolve_reject.go +42 -42
- package/linthost/rules_unicorn_no_useless_spread.go +38 -38
- package/linthost/rules_unicorn_no_useless_switch_case.go +29 -29
- package/linthost/rules_unicorn_no_useless_undefined.go +25 -25
- package/linthost/rules_unicorn_no_zero_fractions.go +17 -17
- package/linthost/rules_unicorn_number_literal_case.go +33 -33
- package/linthost/rules_unicorn_numeric_separators_style.go +36 -36
- package/linthost/rules_unicorn_prefer_add_event_listener.go +30 -30
- package/linthost/rules_unicorn_prefer_array_find.go +27 -27
- package/linthost/rules_unicorn_prefer_array_flat.go +25 -25
- package/linthost/rules_unicorn_prefer_array_flat_map.go +37 -37
- package/linthost/rules_unicorn_prefer_array_index_of.go +108 -108
- package/linthost/rules_unicorn_prefer_array_some.go +43 -43
- package/linthost/rules_unicorn_prefer_at.go +42 -42
- package/linthost/rules_unicorn_prefer_bigint_literals.go +42 -42
- package/linthost/rules_unicorn_prefer_blob_reading_methods.go +15 -15
- package/linthost/rules_unicorn_prefer_class_fields.go +57 -57
- package/linthost/rules_unicorn_prefer_classlist_toggle.go +76 -76
- package/linthost/rules_unicorn_prefer_code_point.go +21 -21
- package/linthost/rules_unicorn_prefer_date_now.go +47 -47
- package/linthost/rules_unicorn_prefer_default_parameters.go +96 -96
- package/linthost/rules_unicorn_prefer_dom_node_append.go +14 -14
- package/linthost/rules_unicorn_prefer_dom_node_dataset.go +27 -27
- package/linthost/rules_unicorn_prefer_dom_node_remove.go +17 -17
- package/linthost/rules_unicorn_prefer_dom_node_text_content.go +11 -11
- package/linthost/rules_unicorn_prefer_event_target.go +10 -10
- package/linthost/rules_unicorn_prefer_export_from.go +99 -99
- package/linthost/rules_unicorn_prefer_global_this.go +91 -91
- package/linthost/rules_unicorn_prefer_import_meta_properties.go +38 -38
- package/linthost/rules_unicorn_prefer_includes.go +108 -108
- package/linthost/rules_unicorn_prefer_json_parse_buffer.go +37 -37
- package/linthost/rules_unicorn_prefer_keyboard_event_key.go +10 -10
- package/linthost/rules_unicorn_prefer_logical_operator_over_ternary.go +20 -20
- package/linthost/rules_unicorn_prefer_math_min_max.go +33 -33
- package/linthost/rules_unicorn_prefer_math_trunc.go +32 -32
- package/linthost/rules_unicorn_prefer_modern_dom_apis.go +18 -18
- package/linthost/rules_unicorn_prefer_modern_math_apis.go +38 -38
- package/linthost/rules_unicorn_prefer_module.go +22 -22
- package/linthost/rules_unicorn_prefer_native_coercion_functions.go +73 -73
- package/linthost/rules_unicorn_prefer_negative_index.go +46 -46
- package/linthost/rules_unicorn_prefer_node_protocol.go +90 -90
- package/linthost/rules_unicorn_prefer_number_properties.go +57 -57
- package/linthost/rules_unicorn_prefer_object_from_entries.go +26 -26
- package/linthost/rules_unicorn_prefer_optional_catch_binding.go +24 -24
- package/linthost/rules_unicorn_prefer_prototype_methods.go +25 -25
- package/linthost/rules_unicorn_prefer_query_selector.go +25 -25
- package/linthost/rules_unicorn_prefer_reflect_apply.go +10 -10
- package/linthost/rules_unicorn_prefer_regexp_test_rule.go +47 -47
- package/linthost/rules_unicorn_prefer_response_static_json.go +26 -26
- package/linthost/rules_unicorn_prefer_set_has.go +16 -16
- package/linthost/rules_unicorn_prefer_set_size.go +22 -22
- package/linthost/rules_unicorn_prefer_simple_condition_first.go +3 -3
- package/linthost/rules_unicorn_prefer_single_call.go +59 -59
- package/linthost/rules_unicorn_prefer_spread.go +24 -24
- package/linthost/rules_unicorn_prefer_string_raw.go +12 -12
- package/linthost/rules_unicorn_prefer_string_replace_all.go +46 -46
- package/linthost/rules_unicorn_prefer_string_slice.go +17 -17
- package/linthost/rules_unicorn_prefer_string_starts_ends_with.go +104 -104
- package/linthost/rules_unicorn_prefer_string_trim_start_end.go +21 -21
- package/linthost/rules_unicorn_prefer_structured_clone.go +36 -36
- package/linthost/rules_unicorn_prefer_switch.go +65 -65
- package/linthost/rules_unicorn_prefer_ternary.go +35 -35
- package/linthost/rules_unicorn_prefer_top_level_await.go +34 -34
- package/linthost/rules_unicorn_prefer_type_error.go +84 -84
- package/linthost/rules_unicorn_prevent_abbreviations.go +68 -68
- package/linthost/rules_unicorn_relative_url_style.go +19 -19
- package/linthost/rules_unicorn_require_array_join_separator.go +18 -18
- package/linthost/rules_unicorn_require_module_attributes.go +25 -25
- package/linthost/rules_unicorn_require_module_specifiers.go +28 -28
- package/linthost/rules_unicorn_require_number_to_fixed_digits_argument.go +18 -18
- package/linthost/rules_unicorn_require_post_message_target_origin.go +18 -18
- package/linthost/rules_unicorn_string_content.go +1 -1
- package/linthost/rules_unicorn_switch_case_braces.go +16 -16
- package/linthost/rules_unicorn_switch_case_break_position.go +3 -3
- package/linthost/rules_unicorn_template_indent.go +1 -1
- package/linthost/rules_unicorn_text_encoding_identifier_case.go +36 -36
- package/linthost/rules_unicorn_throw_new_error.go +30 -30
- package/linthost/rules_var.go +273 -3
- package/package.json +3 -3
- package/src/defaultFormat.ts +11 -7
- package/src/structures/ITtscLintConfig.ts +5 -5
- package/src/structures/TtscLintRuleSetting.ts +19 -19
- package/src/structures/{ITtscLintFormat.ts → format/ITtscLintFormat.ts} +48 -75
- package/src/structures/format/ITtscLintFormatJsDoc.ts +16 -0
- package/src/structures/format/ITtscLintFormatSortImports.ts +62 -0
- package/src/structures/format/index.ts +3 -0
- package/src/structures/index.ts +1 -1
- package/src/structures/rules/ITtscLintBoundariesRuleOptions.ts +20 -31
- package/src/structures/rules/ITtscLintBoundariesRules.ts +32 -36
- package/src/structures/rules/ITtscLintContributorRules.ts +6 -7
- package/src/structures/rules/ITtscLintCoreRules.ts +380 -408
- package/src/structures/rules/ITtscLintCypressRuleOptions.ts +5 -5
- package/src/structures/rules/ITtscLintCypressRules.ts +34 -38
- package/src/structures/rules/ITtscLintFunctionalRuleOptions.ts +28 -41
- package/src/structures/rules/ITtscLintFunctionalRules.ts +51 -56
- package/src/structures/rules/ITtscLintJestRules.ts +63 -74
- package/src/structures/rules/ITtscLintJsdocRules.ts +47 -54
- package/src/structures/rules/ITtscLintJsxA11yRules.ts +94 -102
- package/src/structures/rules/ITtscLintNextjsRules.ts +50 -55
- package/src/structures/rules/ITtscLintPlaywrightRules.ts +104 -122
- package/src/structures/rules/ITtscLintPromiseRules.ts +62 -71
- package/src/structures/rules/ITtscLintReactPerfRuleOptions.ts +4 -4
- package/src/structures/rules/ITtscLintReactPerfRules.ts +17 -19
- package/src/structures/rules/ITtscLintReactRuleOptions.ts +8 -10
- package/src/structures/rules/ITtscLintReactRules.ts +91 -104
- package/src/structures/rules/ITtscLintRegexpRules.ts +46 -54
- package/src/structures/rules/ITtscLintRuleOptionsMap.ts +7 -8
- package/src/structures/rules/ITtscLintSecurityRules.ts +45 -52
- package/src/structures/rules/ITtscLintSolidRules.ts +53 -56
- package/src/structures/rules/ITtscLintStorybookRuleOptions.ts +3 -4
- package/src/structures/rules/ITtscLintStorybookRules.ts +60 -69
- package/src/structures/rules/ITtscLintTanstackQueryRules.ts +31 -37
- package/src/structures/rules/ITtscLintTestingLibraryRuleOptions.ts +2 -3
- package/src/structures/rules/ITtscLintTestingLibraryRules.ts +102 -119
- package/src/structures/rules/ITtscLintTypeScriptRules.ts +460 -518
- package/src/structures/rules/ITtscLintVitestRules.ts +43 -51
- package/lib/structures/ITtscLintFormat.js.map +0 -1
- /package/lib/structures/{ITtscLintFormat.js → format/ITtscLintFormat.js} +0 -0
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
import type { TtscLintRuleSetting } from "../TtscLintRuleSetting";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* TypeScript-only rules and `@typescript-eslint` plugin equivalents,
|
|
5
|
-
*
|
|
4
|
+
* TypeScript-only rules and `@typescript-eslint` plugin equivalents, exposed
|
|
5
|
+
* under the `typescript/*` namespace.
|
|
6
6
|
*
|
|
7
|
-
* Every rule listed here either requires TypeScript syntax (interface,
|
|
8
|
-
* `
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* Every rule listed here either requires TypeScript syntax (interface, `enum`,
|
|
8
|
+
* `namespace`, `as`, `!`, `import type`, type parameters, declaration merging,
|
|
9
|
+
* parameter properties, triple-slash references) or originates from
|
|
10
|
+
* `@typescript-eslint` as a TS-aware extension that has no counterpart in plain
|
|
11
|
+
* ESLint.
|
|
12
12
|
*
|
|
13
13
|
* Generic JS/TS rules (such as `eqeqeq`, `no-console`) stay unnamespaced in
|
|
14
14
|
* {@link ITtscLintCoreRules}.
|
|
15
15
|
*
|
|
16
|
-
* This family deliberately mirrors `typescript-eslint`'s rule ids but
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* This family deliberately mirrors `typescript-eslint`'s rule ids but **only**
|
|
17
|
+
* under the `typescript/*` prefix — `@ttsc/lint` does not accept legacy bare
|
|
18
|
+
* names or `@typescript-eslint/*` aliases for these rules.
|
|
19
19
|
*
|
|
20
20
|
* @reference https://typescript-eslint.io/rules/
|
|
21
21
|
*/
|
|
22
22
|
export interface ITtscLintTypeScriptRules {
|
|
23
23
|
/**
|
|
24
|
-
* Require overload declarations for the same member to be written
|
|
25
|
-
* adjacently.
|
|
24
|
+
* Require overload declarations for the same member to be written adjacently.
|
|
26
25
|
*
|
|
27
|
-
* Splitting overloads with other members hides the full signature
|
|
28
|
-
*
|
|
26
|
+
* Splitting overloads with other members hides the full signature set from
|
|
27
|
+
* readers and tools.
|
|
29
28
|
*
|
|
30
29
|
* @reference https://typescript-eslint.io/rules/adjacent-overload-signatures
|
|
31
30
|
*/
|
|
@@ -34,9 +33,8 @@ export interface ITtscLintTypeScriptRules {
|
|
|
34
33
|
/**
|
|
35
34
|
* Enforce one consistent spelling of array types.
|
|
36
35
|
*
|
|
37
|
-
* By default the rule prefers `T[]` / `readonly T[]` over `Array<T>`
|
|
38
|
-
*
|
|
39
|
-
* default.
|
|
36
|
+
* By default the rule prefers `T[]` / `readonly T[]` over `Array<T>` /
|
|
37
|
+
* `ReadonlyArray<T>`, matching `@typescript-eslint`'s `array-type` default.
|
|
40
38
|
*
|
|
41
39
|
* @reference https://typescript-eslint.io/rules/array-type
|
|
42
40
|
*/
|
|
@@ -45,66 +43,65 @@ export interface ITtscLintTypeScriptRules {
|
|
|
45
43
|
/**
|
|
46
44
|
* Reject `await` on operands that are not thenable.
|
|
47
45
|
*
|
|
48
|
-
* Type-aware — the Checker decides whether the awaited expression has
|
|
49
|
-
*
|
|
46
|
+
* Type-aware — the Checker decides whether the awaited expression has a
|
|
47
|
+
* `then` method. Autofixable: drops the `await`.
|
|
50
48
|
*
|
|
51
49
|
* @reference https://typescript-eslint.io/rules/await-thenable
|
|
52
50
|
*/
|
|
53
51
|
"typescript/await-thenable"?: TtscLintRuleSetting;
|
|
54
52
|
|
|
55
53
|
/**
|
|
56
|
-
* Reject `@ts-ignore
|
|
57
|
-
* `@ts-check` comments.
|
|
54
|
+
* Reject `@ts-ignore` and `@ts-expect-error` comments.
|
|
58
55
|
*
|
|
59
|
-
* The
|
|
60
|
-
*
|
|
56
|
+
* The rule flags both directives unconditionally. There is no
|
|
57
|
+
* description-based allowance, and the `@typescript-eslint` options are not
|
|
58
|
+
* implemented.
|
|
61
59
|
*
|
|
62
60
|
* @reference https://typescript-eslint.io/rules/ban-ts-comment
|
|
63
61
|
*/
|
|
64
62
|
"typescript/ban-ts-comment"?: TtscLintRuleSetting;
|
|
65
63
|
|
|
66
64
|
/**
|
|
67
|
-
* Reject `// tslint:disable` and related TSLint directive comments
|
|
68
|
-
*
|
|
65
|
+
* Reject `// tslint:disable` and related TSLint directive comments left
|
|
66
|
+
* behind from the legacy TSLint era.
|
|
69
67
|
*
|
|
70
68
|
* @reference https://typescript-eslint.io/rules/ban-tslint-comment
|
|
71
69
|
*/
|
|
72
70
|
"typescript/ban-tslint-comment"?: TtscLintRuleSetting;
|
|
73
71
|
|
|
74
72
|
/**
|
|
75
|
-
* Prefer a `static readonly` field over a `get` accessor whose body
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* side effects cannot be reproduced by a field.
|
|
73
|
+
* Prefer a `static readonly` field over a `get` accessor whose body is a
|
|
74
|
+
* single `return <literal>;`. The getter form re-runs the body on every read
|
|
75
|
+
* and obscures that the value is fixed; a readonly field is shorter, narrows
|
|
76
|
+
* to the literal type, and signals "this is a constant" at the call site.
|
|
77
|
+
* Skipped when the class also declares a `set` accessor for the same member
|
|
78
|
+
* name — the setter's side effects cannot be reproduced by a field.
|
|
82
79
|
*
|
|
83
80
|
* @reference https://typescript-eslint.io/rules/class-literal-property-style
|
|
84
81
|
*/
|
|
85
82
|
"typescript/class-literal-property-style"?: TtscLintRuleSetting;
|
|
86
83
|
|
|
87
84
|
/**
|
|
88
|
-
* Prefer `Record<K, V>` over `{ [key: K]: V }` when an object type
|
|
89
|
-
*
|
|
85
|
+
* Prefer `Record<K, V>` over `{ [key: K]: V }` when an object type has a
|
|
86
|
+
* single index signature and no other members.
|
|
90
87
|
*
|
|
91
88
|
* @reference https://typescript-eslint.io/rules/consistent-indexed-object-style
|
|
92
89
|
*/
|
|
93
90
|
"typescript/consistent-indexed-object-style"?: TtscLintRuleSetting;
|
|
94
91
|
|
|
95
92
|
/**
|
|
96
|
-
* Prefer the `as` form of type assertions over the angle-bracket
|
|
97
|
-
*
|
|
93
|
+
* Prefer the `as` form of type assertions over the angle-bracket form
|
|
94
|
+
* `<T>expr`, which is ambiguous inside JSX.
|
|
98
95
|
*
|
|
99
96
|
* @reference https://typescript-eslint.io/rules/consistent-type-assertions
|
|
100
97
|
*/
|
|
101
98
|
"typescript/consistent-type-assertions"?: TtscLintRuleSetting;
|
|
102
99
|
|
|
103
100
|
/**
|
|
104
|
-
* Reject the redundant pattern where a variable is annotated with a
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
101
|
+
* Reject the redundant pattern where a variable is annotated with a generic
|
|
102
|
+
* type AND the same generic arguments are repeated on the constructor: `const
|
|
103
|
+
* m: Map<K, V> = new Map<K, V>()`. One of the two type-argument lists carries
|
|
104
|
+
* the binding; stating both is noise.
|
|
108
105
|
*
|
|
109
106
|
* @reference https://typescript-eslint.io/rules/consistent-generic-constructors
|
|
110
107
|
*/
|
|
@@ -113,58 +110,56 @@ export interface ITtscLintTypeScriptRules {
|
|
|
113
110
|
/**
|
|
114
111
|
* Enforce one consistent shape for object types.
|
|
115
112
|
*
|
|
116
|
-
* By default the rule prefers `interface` over `type` aliases for
|
|
117
|
-
*
|
|
113
|
+
* By default the rule prefers `interface` over `type` aliases for plain
|
|
114
|
+
* object shapes.
|
|
118
115
|
*
|
|
119
116
|
* @reference https://typescript-eslint.io/rules/consistent-type-definitions
|
|
120
117
|
*/
|
|
121
118
|
"typescript/consistent-type-definitions"?: TtscLintRuleSetting;
|
|
122
119
|
|
|
123
120
|
/**
|
|
124
|
-
* Require type-only re-exports to use `export type { ... }` instead
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* import.
|
|
121
|
+
* Require type-only re-exports to use `export type { ... }` instead of the
|
|
122
|
+
* value form `export { ... }` when the exported binding only refers to a type
|
|
123
|
+
* alias or interface in the same file. The type form has no runtime cost and
|
|
124
|
+
* signals intent to the downstream import.
|
|
129
125
|
*
|
|
130
126
|
* @reference https://typescript-eslint.io/rules/consistent-type-exports
|
|
131
127
|
*/
|
|
132
128
|
"typescript/consistent-type-exports"?: TtscLintRuleSetting;
|
|
133
129
|
|
|
134
130
|
/**
|
|
135
|
-
* Require imports that only reference types to use `import type {}`
|
|
136
|
-
*
|
|
131
|
+
* Require imports that only reference types to use `import type {}` so the
|
|
132
|
+
* import has no runtime cost.
|
|
137
133
|
*
|
|
138
134
|
* @reference https://typescript-eslint.io/rules/consistent-type-imports
|
|
139
135
|
*/
|
|
140
136
|
"typescript/consistent-type-imports"?: TtscLintRuleSetting;
|
|
141
137
|
|
|
142
138
|
/**
|
|
143
|
-
* Require every exported function and method declaration to carry an
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
139
|
+
* Require every exported function and method declaration to carry an explicit
|
|
140
|
+
* return-type annotation. Implicit return types let downstream consumers
|
|
141
|
+
* depend on inference details that can shift with future edits; the explicit
|
|
142
|
+
* annotation pins the contract.
|
|
147
143
|
*
|
|
148
144
|
* @reference https://typescript-eslint.io/rules/explicit-function-return-type
|
|
149
145
|
*/
|
|
150
146
|
"typescript/explicit-function-return-type"?: TtscLintRuleSetting;
|
|
151
147
|
|
|
152
148
|
/**
|
|
153
|
-
* Require an explicit accessibility modifier (`public`, `private`,
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
149
|
+
* Require an explicit accessibility modifier (`public`, `private`, or
|
|
150
|
+
* `protected`) on every class member declaration. Implicit public is
|
|
151
|
+
* permitted by TypeScript but obscures intent — the modifier makes the
|
|
152
|
+
* encapsulation contract self-documenting. Members declared with the `#name`
|
|
153
|
+
* private-hash form are exempt.
|
|
158
154
|
*
|
|
159
155
|
* @reference https://typescript-eslint.io/rules/explicit-member-accessibility
|
|
160
156
|
*/
|
|
161
157
|
"typescript/explicit-member-accessibility"?: TtscLintRuleSetting;
|
|
162
158
|
|
|
163
159
|
/**
|
|
164
|
-
* Prefer a function-property signature (`f: () => void`) over a
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* applies.
|
|
160
|
+
* Prefer a function-property signature (`f: () => void`) over a shorthand
|
|
161
|
+
* method signature (`f(): void`) in interfaces and type literals so the
|
|
162
|
+
* strict-function-types contravariance check applies.
|
|
168
163
|
*
|
|
169
164
|
* @reference https://typescript-eslint.io/rules/method-signature-style
|
|
170
165
|
*/
|
|
@@ -180,93 +175,89 @@ export interface ITtscLintTypeScriptRules {
|
|
|
180
175
|
"typescript/no-array-delete"?: TtscLintRuleSetting;
|
|
181
176
|
|
|
182
177
|
/**
|
|
183
|
-
* Prefer `for ... of` over `Array.prototype.forEach()`. The for-of
|
|
184
|
-
*
|
|
185
|
-
*
|
|
178
|
+
* Prefer `for ... of` over `Array.prototype.forEach()`. The for-of form
|
|
179
|
+
* supports early termination (`break`/`return`) and `await`, while `forEach`
|
|
180
|
+
* swallows both.
|
|
186
181
|
*
|
|
187
182
|
* @reference https://typescript-eslint.io/rules/no-array-for-each
|
|
188
183
|
*/
|
|
189
184
|
"typescript/no-array-for-each"?: TtscLintRuleSetting;
|
|
190
185
|
|
|
191
186
|
/**
|
|
192
|
-
* Reject string-coercion contexts (
|
|
193
|
-
*
|
|
187
|
+
* Reject string-coercion contexts (`${x}`, `x + ""`, `String(x)`) where `x`
|
|
188
|
+
* has a type whose `toString` resolves to the default
|
|
194
189
|
* `Object.prototype.toString` and would print `"[object Object]"`.
|
|
195
190
|
*
|
|
196
|
-
* Type-aware via the Checker. Stringish primitives, `Date`, `Error`,
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
* default string.
|
|
191
|
+
* Type-aware via the Checker. Stringish primitives, `Date`, `Error`, arrays,
|
|
192
|
+
* regexes, and any object that overrides `toString` are safe; plain `{}`
|
|
193
|
+
* literals, `Record<...>` shapes, and structural interfaces with no
|
|
194
|
+
* `toString` member are the ones that produce the useless default string.
|
|
201
195
|
*
|
|
202
196
|
* @reference https://typescript-eslint.io/rules/no-base-to-string
|
|
203
197
|
*/
|
|
204
198
|
"typescript/no-base-to-string"?: TtscLintRuleSetting;
|
|
205
199
|
|
|
206
200
|
/**
|
|
207
|
-
* Reject classes that exist purely as a namespace for static members
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
201
|
+
* Reject classes that exist purely as a namespace for static members or that
|
|
202
|
+
* are entirely empty. A namespace import or plain functions are clearer than
|
|
203
|
+
* `class Util { static foo() {} }` — the class adds indirection without
|
|
204
|
+
* providing instance behavior.
|
|
211
205
|
*
|
|
212
206
|
* @reference https://typescript-eslint.io/rules/no-extraneous-class
|
|
213
207
|
*/
|
|
214
208
|
"typescript/no-extraneous-class"?: TtscLintRuleSetting;
|
|
215
209
|
|
|
216
210
|
/**
|
|
217
|
-
* Reject non-null assertions placed where they visually merge with
|
|
218
|
-
*
|
|
219
|
-
*
|
|
211
|
+
* Reject non-null assertions placed where they visually merge with a
|
|
212
|
+
* following operator — `a! == b` (reads as `!=`), `a! in b`, or `a!
|
|
213
|
+
* instanceof B`.
|
|
220
214
|
*
|
|
221
|
-
* Wrap the assertion in parentheses (`(a!) == b`) or drop it
|
|
222
|
-
* entirely.
|
|
215
|
+
* Wrap the assertion in parentheses (`(a!) == b`) or drop it entirely.
|
|
223
216
|
*
|
|
224
217
|
* @reference https://typescript-eslint.io/rules/no-confusing-non-null-assertion
|
|
225
218
|
*/
|
|
226
219
|
"typescript/no-confusing-non-null-assertion"?: TtscLintRuleSetting;
|
|
227
220
|
|
|
228
221
|
/**
|
|
229
|
-
* Reject `void X` expressions used in any position where the
|
|
230
|
-
*
|
|
231
|
-
*
|
|
222
|
+
* Reject `void X` expressions used in any position where the surrounding
|
|
223
|
+
* context expects a value — initializer, call argument, `return` operand,
|
|
224
|
+
* conditional, binary, or ternary subexpression.
|
|
232
225
|
*
|
|
233
|
-
* The only acceptable positions are an expression statement
|
|
234
|
-
*
|
|
235
|
-
*
|
|
226
|
+
* The only acceptable positions are an expression statement (`void x;`), an
|
|
227
|
+
* arrow function's concise body (`() => void x`), and the operand of an
|
|
228
|
+
* enclosing `void` operator (`void void x`).
|
|
236
229
|
*
|
|
237
230
|
* @reference https://typescript-eslint.io/rules/no-confusing-void-expression
|
|
238
231
|
*/
|
|
239
232
|
"typescript/no-confusing-void-expression"?: TtscLintRuleSetting;
|
|
240
233
|
|
|
241
234
|
/**
|
|
242
|
-
* Reject references to declarations marked `@deprecated` in their
|
|
243
|
-
* JSDoc.
|
|
235
|
+
* Reject references to declarations marked `@deprecated` in their JSDoc.
|
|
244
236
|
*
|
|
245
237
|
* Type-aware via the Checker. The rule resolves the symbol at each
|
|
246
|
-
* identifier, property access, call, `new`, or JSX tag-name location,
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
238
|
+
* identifier, property access, call, `new`, or JSX tag-name location, walks
|
|
239
|
+
* the symbol's declarations for an attached `@deprecated` JSDoc tag, and
|
|
240
|
+
* reports at the reference. References inside the same declaration block as
|
|
241
|
+
* the deprecation marker are skipped so the deprecation site itself doesn't
|
|
242
|
+
* fire.
|
|
251
243
|
*
|
|
252
244
|
* @reference https://typescript-eslint.io/rules/no-deprecated
|
|
253
245
|
*/
|
|
254
246
|
"typescript/no-deprecated"?: TtscLintRuleSetting;
|
|
255
247
|
|
|
256
248
|
/**
|
|
257
|
-
* Reject `enum` declarations whose members share the same literal
|
|
258
|
-
* value.
|
|
249
|
+
* Reject `enum` declarations whose members share the same literal value.
|
|
259
250
|
*
|
|
260
|
-
* Reverse lookup (`E[E.X]`) returns whichever member is listed last,
|
|
261
|
-
*
|
|
251
|
+
* Reverse lookup (`E[E.X]`) returns whichever member is listed last, so
|
|
252
|
+
* duplicates almost always reflect a copy-paste mistake.
|
|
262
253
|
*
|
|
263
254
|
* @reference https://typescript-eslint.io/rules/no-duplicate-enum-values
|
|
264
255
|
*/
|
|
265
256
|
"typescript/no-duplicate-enum-values"?: TtscLintRuleSetting;
|
|
266
257
|
|
|
267
258
|
/**
|
|
268
|
-
* Reject computed bracket-key `delete` expressions (`delete obj[x]`)
|
|
269
|
-
*
|
|
259
|
+
* Reject computed bracket-key `delete` expressions (`delete obj[x]`) where
|
|
260
|
+
* `x` is not a string literal, since these escape type tracking.
|
|
270
261
|
*
|
|
271
262
|
* @reference https://typescript-eslint.io/rules/no-dynamic-delete
|
|
272
263
|
*/
|
|
@@ -275,8 +266,8 @@ export interface ITtscLintTypeScriptRules {
|
|
|
275
266
|
/**
|
|
276
267
|
* Reject empty `interface` declarations.
|
|
277
268
|
*
|
|
278
|
-
* An empty interface that does not `extends` anything is equivalent
|
|
279
|
-
*
|
|
269
|
+
* An empty interface that does not `extends` anything is equivalent to
|
|
270
|
+
* `unknown` and almost always represents incomplete typing work.
|
|
280
271
|
*
|
|
281
272
|
* @reference https://typescript-eslint.io/rules/no-empty-interface
|
|
282
273
|
*/
|
|
@@ -285,9 +276,9 @@ export interface ITtscLintTypeScriptRules {
|
|
|
285
276
|
/**
|
|
286
277
|
* Reject `{}` as a type annotation.
|
|
287
278
|
*
|
|
288
|
-
* `{}` matches every non-nullish value and is almost never intended;
|
|
289
|
-
*
|
|
290
|
-
*
|
|
279
|
+
* `{}` matches every non-nullish value and is almost never intended; use
|
|
280
|
+
* `Record<string, unknown>` for a generic object, or `object` for any
|
|
281
|
+
* non-primitive.
|
|
291
282
|
*
|
|
292
283
|
* @reference https://typescript-eslint.io/rules/no-empty-object-type
|
|
293
284
|
*/
|
|
@@ -303,62 +294,61 @@ export interface ITtscLintTypeScriptRules {
|
|
|
303
294
|
"typescript/no-explicit-any"?: TtscLintRuleSetting;
|
|
304
295
|
|
|
305
296
|
/**
|
|
306
|
-
* Reject `x!!` — chained non-null assertions where the inner one
|
|
307
|
-
*
|
|
297
|
+
* Reject `x!!` — chained non-null assertions where the inner one already
|
|
298
|
+
* removes nullability. Autofixable: drops the extra `!`.
|
|
308
299
|
*
|
|
309
300
|
* @reference https://typescript-eslint.io/rules/no-extra-non-null-assertion
|
|
310
301
|
*/
|
|
311
302
|
"typescript/no-extra-non-null-assertion"?: TtscLintRuleSetting;
|
|
312
303
|
|
|
313
304
|
/**
|
|
314
|
-
* Reject Promise-typed expressions whose result is discarded — most
|
|
315
|
-
*
|
|
305
|
+
* Reject Promise-typed expressions whose result is discarded — most often a
|
|
306
|
+
* bare `getPromise();` expression statement.
|
|
316
307
|
*
|
|
317
|
-
* Type-aware via the Checker. A floating promise loses its rejection
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
*
|
|
308
|
+
* Type-aware via the Checker. A floating promise loses its rejection channel
|
|
309
|
+
* and runs out of order with surrounding code. Acceptable sinks are `await`,
|
|
310
|
+
* `.catch(...)`, `.then(_, onRejected)`, `.finally(...)`, assignment, the
|
|
311
|
+
* `void` operator, and `return`.
|
|
321
312
|
*
|
|
322
313
|
* @reference https://typescript-eslint.io/rules/no-floating-promises
|
|
323
314
|
*/
|
|
324
315
|
"typescript/no-floating-promises"?: TtscLintRuleSetting;
|
|
325
316
|
|
|
326
317
|
/**
|
|
327
|
-
* Reject `for (const k in arr)` where `arr` is statically typed as an
|
|
328
|
-
*
|
|
318
|
+
* Reject `for (const k in arr)` where `arr` is statically typed as an array
|
|
319
|
+
* or tuple.
|
|
329
320
|
*
|
|
330
|
-
* Type-aware via the Checker. `for...in` iterates enumerable property
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
321
|
+
* Type-aware via the Checker. `for...in` iterates enumerable property names
|
|
322
|
+
* (yielded as strings, including any inherited or custom-added members), not
|
|
323
|
+
* array values or numeric indices — almost always a mistake for `for...of`,
|
|
324
|
+
* `Array#forEach`, or an indexed `for` loop.
|
|
334
325
|
*
|
|
335
326
|
* @reference https://typescript-eslint.io/rules/no-for-in-array
|
|
336
327
|
*/
|
|
337
328
|
"typescript/no-for-in-array"?: TtscLintRuleSetting;
|
|
338
329
|
|
|
339
330
|
/**
|
|
340
|
-
* Hoist inline `type` modifiers on individual imports into a single
|
|
341
|
-
*
|
|
331
|
+
* Hoist inline `type` modifiers on individual imports into a single top-level
|
|
332
|
+
* `import type {}`. Autofixable.
|
|
342
333
|
*
|
|
343
334
|
* @reference https://typescript-eslint.io/rules/no-import-type-side-effects
|
|
344
335
|
*/
|
|
345
336
|
"typescript/no-import-type-side-effects"?: TtscLintRuleSetting;
|
|
346
337
|
|
|
347
338
|
/**
|
|
348
|
-
* Reject explicit type annotations that TypeScript can already
|
|
349
|
-
*
|
|
339
|
+
* Reject explicit type annotations that TypeScript can already infer from the
|
|
340
|
+
* initializer (`const x: number = 1`).
|
|
350
341
|
*
|
|
351
342
|
* @reference https://typescript-eslint.io/rules/no-inferrable-types
|
|
352
343
|
*/
|
|
353
344
|
"typescript/no-inferrable-types"?: TtscLintRuleSetting;
|
|
354
345
|
|
|
355
346
|
/**
|
|
356
|
-
* Reject `void` used as anything other than a function return type.
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
*
|
|
361
|
-
* `AsyncGenerator` / `Iterator` / `AsyncIterator` /
|
|
347
|
+
* Reject `void` used as anything other than a function return type. `void` in
|
|
348
|
+
* a union (`string | void`) or as a non-allow-listed generic argument is
|
|
349
|
+
* almost always a confusion with `undefined`. Allowed positions:
|
|
350
|
+
* function/method/arrow return-type annotations and generic arguments to
|
|
351
|
+
* `Promise` / `Generator` / `AsyncGenerator` / `Iterator` / `AsyncIterator` /
|
|
362
352
|
* `IterableIterator` / `AsyncIterableIterator`.
|
|
363
353
|
*
|
|
364
354
|
* @reference https://typescript-eslint.io/rules/no-invalid-void-type
|
|
@@ -366,35 +356,34 @@ export interface ITtscLintTypeScriptRules {
|
|
|
366
356
|
"typescript/no-invalid-void-type"?: TtscLintRuleSetting;
|
|
367
357
|
|
|
368
358
|
/**
|
|
369
|
-
* TypeScript-aware extension of `no-magic-numbers` that additionally ignores
|
|
359
|
+
* TypeScript-aware extension of `no-magic-numbers` that additionally ignores
|
|
360
|
+
* enum member values.
|
|
370
361
|
*
|
|
371
362
|
* @reference https://typescript-eslint.io/rules/no-magic-numbers
|
|
372
363
|
*/
|
|
373
364
|
"typescript/no-magic-numbers"?: TtscLintRuleSetting;
|
|
374
365
|
|
|
375
366
|
/**
|
|
376
|
-
* Reject `void X` where `X` is already statically typed `void` — the
|
|
377
|
-
*
|
|
378
|
-
*
|
|
379
|
-
*
|
|
367
|
+
* Reject `void X` where `X` is already statically typed `void` — the `void`
|
|
368
|
+
* operator adds nothing because the operand already evaluates to `undefined`.
|
|
369
|
+
* The operator is meaningful only on a value- returning expression that the
|
|
370
|
+
* caller wants to discard.
|
|
380
371
|
*
|
|
381
|
-
* Type-aware — the Checker decides whether the operand carries the
|
|
382
|
-
*
|
|
383
|
-
*
|
|
384
|
-
* does not.
|
|
372
|
+
* Type-aware — the Checker decides whether the operand carries the `void`
|
|
373
|
+
* type. The upstream `checkNever` option is left at its default of `false`:
|
|
374
|
+
* only `void`-typed operands trigger, `never` does not.
|
|
385
375
|
*
|
|
386
376
|
* @reference https://typescript-eslint.io/rules/no-meaningless-void-operator
|
|
387
377
|
*/
|
|
388
378
|
"typescript/no-meaningless-void-operator"?: TtscLintRuleSetting;
|
|
389
379
|
|
|
390
380
|
/**
|
|
391
|
-
* Reject signatures that fake a constructor or an instance `new`
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
* C }`.
|
|
381
|
+
* Reject signatures that fake a constructor or an instance `new` method —
|
|
382
|
+
* `interface I { new (): I }` (TypeScript treats this as the type of `new
|
|
383
|
+
* I()` regardless of intent) and `class C { new(): C }`.
|
|
395
384
|
*
|
|
396
|
-
* Use a separate construct signature on a factory type when the
|
|
397
|
-
*
|
|
385
|
+
* Use a separate construct signature on a factory type when the intent is
|
|
386
|
+
* "anything callable with `new`".
|
|
398
387
|
*
|
|
399
388
|
* @reference https://typescript-eslint.io/rules/no-misused-new
|
|
400
389
|
*/
|
|
@@ -403,25 +392,24 @@ export interface ITtscLintTypeScriptRules {
|
|
|
403
392
|
/**
|
|
404
393
|
* Reject Promise values supplied where a non-Promise was expected.
|
|
405
394
|
*
|
|
406
|
-
* Covers conditional positions (`if (promise)`, `while`, `for`,
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
410
|
-
*
|
|
395
|
+
* Covers conditional positions (`if (promise)`, `while`, `for`, ternary,
|
|
396
|
+
* `&&`, `||`, `??`) where the Promise is truthy by reference, and `async`
|
|
397
|
+
* callbacks passed to APIs that expect a void-returning function (e.g.
|
|
398
|
+
* `Array#forEach`, JSX event handlers), where the returned Promise is
|
|
399
|
+
* silently dropped.
|
|
411
400
|
*
|
|
412
401
|
* @reference https://typescript-eslint.io/rules/no-misused-promises
|
|
413
402
|
*/
|
|
414
403
|
"typescript/no-misused-promises"?: TtscLintRuleSetting;
|
|
415
404
|
|
|
416
405
|
/**
|
|
417
|
-
* Reject spread expressions whose operand is syntactically wrong
|
|
418
|
-
*
|
|
406
|
+
* Reject spread expressions whose operand is syntactically wrong for the
|
|
407
|
+
* surrounding context.
|
|
419
408
|
*
|
|
420
|
-
* AST-only subset of the upstream rule — no Checker required.
|
|
421
|
-
*
|
|
422
|
-
*
|
|
423
|
-
*
|
|
424
|
-
* (`{ ...[1, 2] }`). General iterability detection still needs the
|
|
409
|
+
* AST-only subset of the upstream rule — no Checker required. Fires on object
|
|
410
|
+
* literal spread inside an array literal or a call/construct argument (`[...{
|
|
411
|
+
* a: 1 }]`, `f(...{ a: 1 })`) and on array literal spread inside an object
|
|
412
|
+
* literal (`{ ...[1, 2] }`). General iterability detection still needs the
|
|
425
413
|
* full type-aware rule.
|
|
426
414
|
*
|
|
427
415
|
* @reference https://typescript-eslint.io/rules/no-misused-spread
|
|
@@ -429,28 +417,28 @@ export interface ITtscLintTypeScriptRules {
|
|
|
429
417
|
"typescript/no-misused-spread"?: TtscLintRuleSetting;
|
|
430
418
|
|
|
431
419
|
/**
|
|
432
|
-
* Reject `enum`s that mix numeric and string members, which makes
|
|
433
|
-
*
|
|
420
|
+
* Reject `enum`s that mix numeric and string members, which makes the
|
|
421
|
+
* resulting type unsafe for reverse lookups.
|
|
434
422
|
*
|
|
435
423
|
* @reference https://typescript-eslint.io/rules/no-mixed-enums
|
|
436
424
|
*/
|
|
437
425
|
"typescript/no-mixed-enums"?: TtscLintRuleSetting;
|
|
438
426
|
|
|
439
427
|
/**
|
|
440
|
-
* Reject non-ambient `namespace` and `module Foo {}` declarations
|
|
441
|
-
*
|
|
428
|
+
* Reject non-ambient `namespace` and `module Foo {}` declarations in regular
|
|
429
|
+
* `.ts` files.
|
|
442
430
|
*
|
|
443
431
|
* ES modules replace the legacy namespace concept; ambient `declare
|
|
444
|
-
* namespace` in `.d.ts` files stays allowed by default for global
|
|
445
|
-
*
|
|
432
|
+
* namespace` in `.d.ts` files stays allowed by default for global typings
|
|
433
|
+
* compatibility.
|
|
446
434
|
*
|
|
447
435
|
* @reference https://typescript-eslint.io/rules/no-namespace
|
|
448
436
|
*/
|
|
449
437
|
"typescript/no-namespace"?: TtscLintRuleSetting;
|
|
450
438
|
|
|
451
439
|
/**
|
|
452
|
-
* Reject `x! ?? y` — the `!` collapses `null | undefined` to a
|
|
453
|
-
*
|
|
440
|
+
* Reject `x! ?? y` — the `!` collapses `null | undefined` to a non-nullish
|
|
441
|
+
* value, so the `??` branch is unreachable.
|
|
454
442
|
*
|
|
455
443
|
* @reference https://typescript-eslint.io/rules/no-non-null-asserted-nullish-coalescing
|
|
456
444
|
*/
|
|
@@ -458,8 +446,7 @@ export interface ITtscLintTypeScriptRules {
|
|
|
458
446
|
|
|
459
447
|
/**
|
|
460
448
|
* Reject `x!?.y` — the non-null assertion makes the optional chain
|
|
461
|
-
* meaningless because the inner expression is already known to be
|
|
462
|
-
* defined.
|
|
449
|
+
* meaningless because the inner expression is already known to be defined.
|
|
463
450
|
*
|
|
464
451
|
* @reference https://typescript-eslint.io/rules/no-non-null-asserted-optional-chain
|
|
465
452
|
*/
|
|
@@ -468,119 +455,114 @@ export interface ITtscLintTypeScriptRules {
|
|
|
468
455
|
/**
|
|
469
456
|
* Reject postfix `!` non-null assertions altogether.
|
|
470
457
|
*
|
|
471
|
-
* The operator suppresses a real `null` / `undefined` possibility
|
|
472
|
-
*
|
|
473
|
-
*
|
|
458
|
+
* The operator suppresses a real `null` / `undefined` possibility without
|
|
459
|
+
* inserting a check; prefer a narrowing branch, optional chaining, or
|
|
460
|
+
* refining the type at its source.
|
|
474
461
|
*
|
|
475
462
|
* @reference https://typescript-eslint.io/rules/no-non-null-assertion
|
|
476
463
|
*/
|
|
477
464
|
"typescript/no-non-null-assertion"?: TtscLintRuleSetting;
|
|
478
465
|
|
|
479
466
|
/**
|
|
480
|
-
* Reject union and intersection type constituents that the type
|
|
481
|
-
*
|
|
482
|
-
*
|
|
483
|
-
*
|
|
467
|
+
* Reject union and intersection type constituents that the type system
|
|
468
|
+
* absorbs anyway — `string | any` collapses to `any`, `T & never` collapses
|
|
469
|
+
* to `never`, `T & unknown` collapses to `T`, and repeated constituents add
|
|
470
|
+
* nothing.
|
|
484
471
|
*
|
|
485
|
-
* AST-only baseline: only the literal `any` / `unknown` / `never`
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
*
|
|
472
|
+
* AST-only baseline: only the literal `any` / `unknown` / `never` keyword
|
|
473
|
+
* constituents and duplicates matched by textual identity are reported.
|
|
474
|
+
* Subset relations such as `string | "foo"` and generic alias resolution
|
|
475
|
+
* still require the type-aware path.
|
|
489
476
|
*
|
|
490
477
|
* @reference https://typescript-eslint.io/rules/no-redundant-type-constituents
|
|
491
478
|
*/
|
|
492
479
|
"typescript/no-redundant-type-constituents"?: TtscLintRuleSetting;
|
|
493
480
|
|
|
494
481
|
/**
|
|
495
|
-
* Reject specific type-reference names that are almost always a
|
|
496
|
-
*
|
|
497
|
-
*
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
* the wrapper names imply.
|
|
482
|
+
* Reject specific type-reference names that are almost always a mistake — by
|
|
483
|
+
* default the global wrapper types `Object`, `Function`, `Number`, `String`,
|
|
484
|
+
* and `Boolean`. The lowercase primitives (`number`, `string`, `boolean`) and
|
|
485
|
+
* explicit call signatures convey the intended type without the
|
|
486
|
+
* runtime-boxing semantics that the wrapper names imply.
|
|
501
487
|
*
|
|
502
|
-
* AST-only baseline: shadow guard reuses the same file-scope check
|
|
503
|
-
*
|
|
504
|
-
*
|
|
488
|
+
* AST-only baseline: shadow guard reuses the same file-scope check as
|
|
489
|
+
* `no-wrapper-object-types` so a user-declared `interface String {}` is not
|
|
490
|
+
* flagged as the global wrapper.
|
|
505
491
|
*
|
|
506
492
|
* @reference https://typescript-eslint.io/rules/no-restricted-types
|
|
507
493
|
*/
|
|
508
494
|
"typescript/no-restricted-types"?: TtscLintRuleSetting;
|
|
509
495
|
|
|
510
496
|
/**
|
|
511
|
-
* Reject `require(...)` calls and `import x = require(...)`
|
|
512
|
-
* declarations.
|
|
497
|
+
* Reject `require(...)` calls and `import x = require(...)` declarations.
|
|
513
498
|
*
|
|
514
|
-
* Use ES module `import` syntax so the type-only / runtime-import
|
|
515
|
-
*
|
|
499
|
+
* Use ES module `import` syntax so the type-only / runtime-import distinction
|
|
500
|
+
* is preserved and declaration shape stays consistent.
|
|
516
501
|
*
|
|
517
502
|
* @reference https://typescript-eslint.io/rules/no-require-imports
|
|
518
503
|
*/
|
|
519
504
|
"typescript/no-require-imports"?: TtscLintRuleSetting;
|
|
520
505
|
|
|
521
506
|
/**
|
|
522
|
-
* Reject aliasing `this` to a local (`const self = this`, `const
|
|
523
|
-
*
|
|
507
|
+
* Reject aliasing `this` to a local (`const self = this`, `const that =
|
|
508
|
+
* this`, destructuring `const { x } = this`).
|
|
524
509
|
*
|
|
525
|
-
* Arrow functions and `.bind(this)` make the workaround unnecessary;
|
|
526
|
-
*
|
|
510
|
+
* Arrow functions and `.bind(this)` make the workaround unnecessary; the
|
|
511
|
+
* alias also breaks type narrowing on `this`.
|
|
527
512
|
*
|
|
528
513
|
* @reference https://typescript-eslint.io/rules/no-this-alias
|
|
529
514
|
*/
|
|
530
515
|
"typescript/no-this-alias"?: TtscLintRuleSetting;
|
|
531
516
|
|
|
532
517
|
/**
|
|
533
|
-
* Reject direct comparison of a boolean-typed value with `true` /
|
|
534
|
-
*
|
|
535
|
-
*
|
|
536
|
-
*
|
|
518
|
+
* Reject direct comparison of a boolean-typed value with `true` / `false`
|
|
519
|
+
* literals — `x === true` is just `x`, `x !== false` is just `x`. The literal
|
|
520
|
+
* compare adds noise without changing the result whenever the non-literal
|
|
521
|
+
* side is provably pure boolean.
|
|
537
522
|
*
|
|
538
|
-
* Type-aware via the Checker. Skipped when the value side carries
|
|
539
|
-
* `
|
|
540
|
-
*
|
|
523
|
+
* Type-aware via the Checker. Skipped when the value side carries `null` /
|
|
524
|
+
* `undefined` — the literal compare is also stripping nullability there, and
|
|
525
|
+
* the rewrite would lose information.
|
|
541
526
|
*
|
|
542
527
|
* @reference https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare
|
|
543
528
|
*/
|
|
544
529
|
"typescript/no-unnecessary-boolean-literal-compare"?: TtscLintRuleSetting;
|
|
545
530
|
|
|
546
531
|
/**
|
|
547
|
-
* Reject conditions whose static type proves the runtime truthiness
|
|
548
|
-
*
|
|
549
|
-
*
|
|
550
|
-
*
|
|
551
|
-
*
|
|
552
|
-
* names the intent.
|
|
532
|
+
* Reject conditions whose static type proves the runtime truthiness is fixed
|
|
533
|
+
* — `if ({})`, `if (null)`, `while ("")`, `0 && f()`. The conditional becomes
|
|
534
|
+
* either dead code (the always-false arm) or unconditional execution (the
|
|
535
|
+
* always-true arm); the explicit shape (`if (true)`, deleting the dead
|
|
536
|
+
* branch, or widening the type) names the intent.
|
|
553
537
|
*
|
|
554
|
-
* Type-aware via the Checker. The rule stays silent on `any`,
|
|
555
|
-
*
|
|
556
|
-
*
|
|
557
|
-
*
|
|
558
|
-
*
|
|
538
|
+
* Type-aware via the Checker. The rule stays silent on `any`, `unknown`,
|
|
539
|
+
* plain `boolean`, plain `string`, plain `number`, unions that mix truthy and
|
|
540
|
+
* falsy outcomes, and any other shape whose runtime truthiness is not
|
|
541
|
+
* statically decidable — only the provably always-truthy / always-falsy
|
|
542
|
+
* positions are flagged.
|
|
559
543
|
*
|
|
560
544
|
* @reference https://typescript-eslint.io/rules/no-unnecessary-condition
|
|
561
545
|
*/
|
|
562
546
|
"typescript/no-unnecessary-condition"?: TtscLintRuleSetting;
|
|
563
547
|
|
|
564
548
|
/**
|
|
565
|
-
* Reject `this.x = x` in a constructor body when `x` is already
|
|
566
|
-
*
|
|
567
|
-
* assignment automatically.
|
|
549
|
+
* Reject `this.x = x` in a constructor body when `x` is already declared as a
|
|
550
|
+
* parameter property — TypeScript performs the assignment automatically.
|
|
568
551
|
*
|
|
569
552
|
* @reference https://typescript-eslint.io/rules/no-unnecessary-parameter-property-assignment
|
|
570
553
|
*/
|
|
571
554
|
"typescript/no-unnecessary-parameter-property-assignment"?: TtscLintRuleSetting;
|
|
572
555
|
|
|
573
556
|
/**
|
|
574
|
-
* Reject `Foo.Bar` references written inside `namespace Foo { ... }`
|
|
575
|
-
*
|
|
576
|
-
*
|
|
577
|
-
*
|
|
557
|
+
* Reject `Foo.Bar` references written inside `namespace Foo { ... }` or `enum
|
|
558
|
+
* Foo { ..., X = Foo.Y, ... }` where the `Foo.` qualifier names the same
|
|
559
|
+
* lexical scope the access lives in. Dropping the qualifier leaves the
|
|
560
|
+
* identical binding lookup.
|
|
578
561
|
*
|
|
579
562
|
* AST-only: walks `Parent` links for an enclosing namespace or enum
|
|
580
|
-
* declaration whose identifier matches the qualifier's head. The
|
|
581
|
-
*
|
|
582
|
-
*
|
|
583
|
-
* declaration ancestry.
|
|
563
|
+
* declaration whose identifier matches the qualifier's head. The Checker is
|
|
564
|
+
* not required because the upstream rule operates on lexical scope identity,
|
|
565
|
+
* which the AST already encodes via declaration ancestry.
|
|
584
566
|
*
|
|
585
567
|
* @reference https://typescript-eslint.io/rules/no-unnecessary-qualifier
|
|
586
568
|
*/
|
|
@@ -588,42 +570,41 @@ export interface ITtscLintTypeScriptRules {
|
|
|
588
570
|
|
|
589
571
|
/**
|
|
590
572
|
* Reject template literals that carry no template-only behavior — a
|
|
591
|
-
*
|
|
592
|
-
*
|
|
593
|
-
*
|
|
594
|
-
*
|
|
573
|
+
* `${"abc"}` interpolation, a lone `${name}` span around a string-typed
|
|
574
|
+
* value, or a `abc` no-substitution literal with no escaped backticks. Each
|
|
575
|
+
* of these collapses to a regular string literal without changing meaning, so
|
|
576
|
+
* the backtick form is just noise.
|
|
595
577
|
*
|
|
596
|
-
* Type-aware via the Checker. The interpolation forms are flagged only
|
|
597
|
-
*
|
|
598
|
-
*
|
|
599
|
-
*
|
|
578
|
+
* Type-aware via the Checker. The interpolation forms are flagged only when
|
|
579
|
+
* the span's expression statically resolves to a string-like type and the
|
|
580
|
+
* surrounding head / tail text is empty — the runtime coercion is then a
|
|
581
|
+
* no-op, mirroring the upstream rule.
|
|
600
582
|
*
|
|
601
583
|
* @reference https://typescript-eslint.io/rules/no-unnecessary-template-expression
|
|
602
584
|
*/
|
|
603
585
|
"typescript/no-unnecessary-template-expression"?: TtscLintRuleSetting;
|
|
604
586
|
|
|
605
587
|
/**
|
|
606
|
-
* Reject `Foo<DefaultT>` calls where the supplied generic argument is
|
|
607
|
-
*
|
|
588
|
+
* Reject `Foo<DefaultT>` calls where the supplied generic argument is the
|
|
589
|
+
* same as the parameter's default — the argument adds nothing.
|
|
608
590
|
*
|
|
609
|
-
* Type-aware via the Checker. Walks the resolved type parameters of
|
|
610
|
-
*
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
591
|
+
* Type-aware via the Checker. Walks the resolved type parameters of the
|
|
592
|
+
* call's signature and compares each explicit argument against the
|
|
593
|
+
* parameter's declared default. Only the contiguous trailing run of
|
|
594
|
+
* default-equal arguments is reported — TypeScript can only omit a suffix of
|
|
595
|
+
* the type-argument list.
|
|
614
596
|
*
|
|
615
597
|
* @reference https://typescript-eslint.io/rules/no-unnecessary-type-arguments
|
|
616
598
|
*/
|
|
617
599
|
"typescript/no-unnecessary-type-arguments"?: TtscLintRuleSetting;
|
|
618
600
|
|
|
619
601
|
/**
|
|
620
|
-
* Reject `x as T` and `<T>x` assertions whose target type is the same
|
|
621
|
-
*
|
|
602
|
+
* Reject `x as T` and `<T>x` assertions whose target type is the same as
|
|
603
|
+
* `x`'s already-known static type — the assertion adds nothing.
|
|
622
604
|
*
|
|
623
|
-
* Also rejects `x!` non-null assertions when `x` is already
|
|
624
|
-
*
|
|
625
|
-
*
|
|
626
|
-
* `prefer-as-const` rule.
|
|
605
|
+
* Also rejects `x!` non-null assertions when `x` is already statically
|
|
606
|
+
* non-nullable. The `as const` syntax is excluded because it produces a
|
|
607
|
+
* strictly different type and is handled by the `prefer-as-const` rule.
|
|
627
608
|
*
|
|
628
609
|
* Type-aware via the Checker.
|
|
629
610
|
*
|
|
@@ -632,8 +613,8 @@ export interface ITtscLintTypeScriptRules {
|
|
|
632
613
|
"typescript/no-unnecessary-type-assertion"?: TtscLintRuleSetting;
|
|
633
614
|
|
|
634
615
|
/**
|
|
635
|
-
* Reject `<T extends unknown>` and similar constraints that match
|
|
636
|
-
*
|
|
616
|
+
* Reject `<T extends unknown>` and similar constraints that match everything.
|
|
617
|
+
* Autofixable: drops the constraint.
|
|
637
618
|
*
|
|
638
619
|
* @reference https://typescript-eslint.io/rules/no-unnecessary-type-constraint
|
|
639
620
|
*/
|
|
@@ -641,8 +622,8 @@ export interface ITtscLintTypeScriptRules {
|
|
|
641
622
|
|
|
642
623
|
/**
|
|
643
624
|
* Reject passing an `any`-typed value into a parameter whose type is
|
|
644
|
-
* concrete. The call still runs, but every static guarantee the
|
|
645
|
-
*
|
|
625
|
+
* concrete. The call still runs, but every static guarantee the function's
|
|
626
|
+
* signature would otherwise enforce is silently dropped.
|
|
646
627
|
*
|
|
647
628
|
* Type-aware via the Checker. `unknown` is not flagged.
|
|
648
629
|
*
|
|
@@ -651,9 +632,9 @@ export interface ITtscLintTypeScriptRules {
|
|
|
651
632
|
"typescript/no-unsafe-argument"?: TtscLintRuleSetting;
|
|
652
633
|
|
|
653
634
|
/**
|
|
654
|
-
* Reject assigning an `any`-typed value into a concretely typed
|
|
655
|
-
*
|
|
656
|
-
*
|
|
635
|
+
* Reject assigning an `any`-typed value into a concretely typed location —
|
|
636
|
+
* variable initializer with an explicit annotation, or a reassignment whose
|
|
637
|
+
* left-hand side has a static type.
|
|
657
638
|
*
|
|
658
639
|
* Type-aware via the Checker. `unknown` is not flagged.
|
|
659
640
|
*
|
|
@@ -662,9 +643,9 @@ export interface ITtscLintTypeScriptRules {
|
|
|
662
643
|
"typescript/no-unsafe-assignment"?: TtscLintRuleSetting;
|
|
663
644
|
|
|
664
645
|
/**
|
|
665
|
-
* Reject calling a value whose static type is `any`. The runtime
|
|
666
|
-
*
|
|
667
|
-
*
|
|
646
|
+
* Reject calling a value whose static type is `any`. The runtime call still
|
|
647
|
+
* happens, but the signature is unchecked and the return type spreads `any`
|
|
648
|
+
* to every downstream use.
|
|
668
649
|
*
|
|
669
650
|
* Type-aware via the Checker. Visits plain calls, `new`, and tagged
|
|
670
651
|
* templates. `unknown` is not flagged.
|
|
@@ -674,37 +655,34 @@ export interface ITtscLintTypeScriptRules {
|
|
|
674
655
|
"typescript/no-unsafe-call"?: TtscLintRuleSetting;
|
|
675
656
|
|
|
676
657
|
/**
|
|
677
|
-
* Reject declaration merging between an `interface` and a `class`
|
|
678
|
-
*
|
|
658
|
+
* Reject declaration merging between an `interface` and a `class` with the
|
|
659
|
+
* same name.
|
|
679
660
|
*
|
|
680
|
-
* The interface grafts members onto the class type without forcing a
|
|
681
|
-
*
|
|
682
|
-
* exposes.
|
|
661
|
+
* The interface grafts members onto the class type without forcing a runtime
|
|
662
|
+
* implementation, so the class object lies about what it exposes.
|
|
683
663
|
*
|
|
684
664
|
* @reference https://typescript-eslint.io/rules/no-unsafe-declaration-merging
|
|
685
665
|
*/
|
|
686
666
|
"typescript/no-unsafe-declaration-merging"?: TtscLintRuleSetting;
|
|
687
667
|
|
|
688
668
|
/**
|
|
689
|
-
* Reject `==` / `===` / `!=` / `!==` comparisons between an
|
|
690
|
-
*
|
|
691
|
-
*
|
|
692
|
-
*
|
|
693
|
-
* primitive.
|
|
669
|
+
* Reject `==` / `===` / `!=` / `!==` comparisons between an enum-typed value
|
|
670
|
+
* and a plain `number` or `string` of the same widened primitive — the
|
|
671
|
+
* comparison silently accepts unrelated enums and raw literals that happen to
|
|
672
|
+
* share the underlying primitive.
|
|
694
673
|
*
|
|
695
|
-
* Type-aware via the Checker. The rule fires when one side carries
|
|
696
|
-
*
|
|
697
|
-
*
|
|
698
|
-
*
|
|
699
|
-
* helpers quiet), pass through.
|
|
674
|
+
* Type-aware via the Checker. The rule fires when one side carries an enum
|
|
675
|
+
* type and the other is the widened primitive without naming the same enum;
|
|
676
|
+
* comparisons against members of the same enum, and against `any` / `unknown`
|
|
677
|
+
* / `never` (to keep generic helpers quiet), pass through.
|
|
700
678
|
*
|
|
701
679
|
* @reference https://typescript-eslint.io/rules/no-unsafe-enum-comparison
|
|
702
680
|
*/
|
|
703
681
|
"typescript/no-unsafe-enum-comparison"?: TtscLintRuleSetting;
|
|
704
682
|
|
|
705
683
|
/**
|
|
706
|
-
* Reject the unsafe `Function` type, which matches every callable
|
|
707
|
-
*
|
|
684
|
+
* Reject the unsafe `Function` type, which matches every callable regardless
|
|
685
|
+
* of signature.
|
|
708
686
|
*
|
|
709
687
|
* Declare the specific call signature instead.
|
|
710
688
|
*
|
|
@@ -713,50 +691,49 @@ export interface ITtscLintTypeScriptRules {
|
|
|
713
691
|
"typescript/no-unsafe-function-type"?: TtscLintRuleSetting;
|
|
714
692
|
|
|
715
693
|
/**
|
|
716
|
-
* Reject property access on a receiver whose static type is `any`.
|
|
717
|
-
*
|
|
718
|
-
*
|
|
694
|
+
* Reject property access on a receiver whose static type is `any`. The lookup
|
|
695
|
+
* still resolves at runtime, but the property type is `any` and spreads
|
|
696
|
+
* through the rest of the program.
|
|
719
697
|
*
|
|
720
|
-
* Type-aware via the Checker. Visits dot access and computed
|
|
721
|
-
*
|
|
698
|
+
* Type-aware via the Checker. Visits dot access and computed element access.
|
|
699
|
+
* `unknown` is not flagged.
|
|
722
700
|
*
|
|
723
701
|
* @reference https://typescript-eslint.io/rules/no-unsafe-member-access
|
|
724
702
|
*/
|
|
725
703
|
"typescript/no-unsafe-member-access"?: TtscLintRuleSetting;
|
|
726
704
|
|
|
727
705
|
/**
|
|
728
|
-
* Reject a `return` expression whose static type is `any` from a
|
|
729
|
-
*
|
|
730
|
-
* non-`
|
|
731
|
-
*
|
|
732
|
-
* value.
|
|
706
|
+
* Reject a `return` expression whose static type is `any` from a function
|
|
707
|
+
* whose declared return type is a concrete (non-`any` / non-`unknown` /
|
|
708
|
+
* non-`void`) shape — the `any` leaks past the type boundary and disables
|
|
709
|
+
* every downstream check on the returned value.
|
|
733
710
|
*
|
|
734
|
-
* Type-aware via the Checker. The rule walks each `return` to its
|
|
735
|
-
*
|
|
736
|
-
*
|
|
737
|
-
*
|
|
738
|
-
*
|
|
711
|
+
* Type-aware via the Checker. The rule walks each `return` to its enclosing
|
|
712
|
+
* function-like declaration, asks the Checker for that function's signature,
|
|
713
|
+
* and compares the declared return type against the expression type.
|
|
714
|
+
* `unknown`-typed expressions pass through because they cannot be used
|
|
715
|
+
* without further narrowing.
|
|
739
716
|
*
|
|
740
717
|
* @reference https://typescript-eslint.io/rules/no-unsafe-return
|
|
741
718
|
*/
|
|
742
719
|
"typescript/no-unsafe-return"?: TtscLintRuleSetting;
|
|
743
720
|
|
|
744
721
|
/**
|
|
745
|
-
* Reject the unary `-` operator applied to an operand whose static
|
|
746
|
-
*
|
|
747
|
-
*
|
|
748
|
-
* always indicates a bug.
|
|
722
|
+
* Reject the unary `-` operator applied to an operand whose static type is
|
|
723
|
+
* not number-like or bigint-like — `-x` silently coerces strings, objects,
|
|
724
|
+
* and other shapes via `Number(x)` and almost always indicates a bug.
|
|
749
725
|
*
|
|
750
|
-
* Type-aware via the Checker. `any` / `unknown` / `never` operands
|
|
751
|
-
*
|
|
752
|
-
*
|
|
726
|
+
* Type-aware via the Checker. `any` / `unknown` / `never` operands pass
|
|
727
|
+
* through to match the upstream `allowAny`-style defaults that keep generic
|
|
728
|
+
* helpers quiet.
|
|
753
729
|
*
|
|
754
730
|
* @reference https://typescript-eslint.io/rules/no-unsafe-unary-minus
|
|
755
731
|
*/
|
|
756
732
|
"typescript/no-unsafe-unary-minus"?: TtscLintRuleSetting;
|
|
757
733
|
|
|
758
734
|
/**
|
|
759
|
-
* TypeScript-aware extension of `no-useless-constructor` that tolerates a
|
|
735
|
+
* TypeScript-aware extension of `no-useless-constructor` that tolerates a
|
|
736
|
+
* constructor existing solely to expose parameter properties.
|
|
760
737
|
*
|
|
761
738
|
* @reference https://typescript-eslint.io/rules/no-useless-constructor
|
|
762
739
|
*/
|
|
@@ -765,59 +742,53 @@ export interface ITtscLintTypeScriptRules {
|
|
|
765
742
|
/**
|
|
766
743
|
* Reject redundant `export {}` declarations in module files.
|
|
767
744
|
*
|
|
768
|
-
* The file is already a module via its other top-level `import` /
|
|
769
|
-
* `export`.
|
|
745
|
+
* The file is already a module via its other top-level `import` / `export`.
|
|
770
746
|
*
|
|
771
747
|
* @reference https://typescript-eslint.io/rules/no-useless-empty-export
|
|
772
748
|
*/
|
|
773
749
|
"typescript/no-useless-empty-export"?: TtscLintRuleSetting;
|
|
774
750
|
|
|
775
751
|
/**
|
|
776
|
-
* Reject the wrapper object types `String`, `Number`, `Boolean`,
|
|
777
|
-
*
|
|
752
|
+
* Reject the wrapper object types `String`, `Number`, `Boolean`, `Symbol`,
|
|
753
|
+
* and `BigInt`.
|
|
778
754
|
*
|
|
779
|
-
* Autofixable to the corresponding primitive. `Object` stays
|
|
780
|
-
*
|
|
755
|
+
* Autofixable to the corresponding primitive. `Object` stays detection-only
|
|
756
|
+
* because it has slightly different semantics.
|
|
781
757
|
*
|
|
782
758
|
* @reference https://typescript-eslint.io/rules/no-wrapper-object-types
|
|
783
759
|
*/
|
|
784
760
|
"typescript/no-wrapper-object-types"?: TtscLintRuleSetting;
|
|
785
761
|
|
|
786
762
|
/**
|
|
787
|
-
* Reject `x as Foo` assertions whose target type is the non-nullable
|
|
788
|
-
*
|
|
789
|
-
* non-null assertion.
|
|
763
|
+
* Reject `x as Foo` assertions whose target type is the non-nullable version
|
|
764
|
+
* of `x`'s static type — replace with the shorter `x!` non-null assertion.
|
|
790
765
|
*
|
|
791
|
-
* Type-aware via the Checker. Fires when the source expression's
|
|
792
|
-
*
|
|
793
|
-
*
|
|
794
|
-
* non-nullable subset.
|
|
766
|
+
* Type-aware via the Checker. Fires when the source expression's static type
|
|
767
|
+
* is `Foo | null`, `Foo | undefined`, or `Foo | null | undefined`, and the
|
|
768
|
+
* asserted type equals the non-nullable subset.
|
|
795
769
|
*
|
|
796
770
|
* @reference https://typescript-eslint.io/rules/non-nullable-type-assertion-style
|
|
797
771
|
*/
|
|
798
772
|
"typescript/non-nullable-type-assertion-style"?: TtscLintRuleSetting;
|
|
799
773
|
|
|
800
774
|
/**
|
|
801
|
-
* Reject `throw X` where `X` is statically known not to derive from
|
|
802
|
-
*
|
|
803
|
-
* like.
|
|
775
|
+
* Reject `throw X` where `X` is statically known not to derive from `Error` —
|
|
776
|
+
* string literals, numbers, plain object literals, and the like.
|
|
804
777
|
*
|
|
805
|
-
* Type-aware via the Checker. Non-Error throws lose the stack trace
|
|
806
|
-
*
|
|
778
|
+
* Type-aware via the Checker. Non-Error throws lose the stack trace and
|
|
779
|
+
* confuse `instanceof` checks in the surrounding `catch`.
|
|
807
780
|
*
|
|
808
781
|
* @reference https://typescript-eslint.io/rules/only-throw-error
|
|
809
782
|
*/
|
|
810
783
|
"typescript/only-throw-error"?: TtscLintRuleSetting;
|
|
811
784
|
|
|
812
785
|
/**
|
|
813
|
-
* Reject TypeScript parameter-property constructors
|
|
814
|
-
*
|
|
815
|
-
*
|
|
816
|
-
* buried inside the constructor parameter list.
|
|
786
|
+
* Reject TypeScript parameter-property constructors (`constructor(public foo:
|
|
787
|
+
* T)`) — prefer plain field declarations so the class shape is visible from
|
|
788
|
+
* the member list instead of buried inside the constructor parameter list.
|
|
817
789
|
*
|
|
818
|
-
* AST-only — the trigger is a syntactic modifier (`public` /
|
|
819
|
-
* `
|
|
820
|
-
* constructor parameter.
|
|
790
|
+
* AST-only — the trigger is a syntactic modifier (`public` / `private` /
|
|
791
|
+
* `protected` / `readonly` / `override`) on a constructor parameter.
|
|
821
792
|
*
|
|
822
793
|
* @reference https://typescript-eslint.io/rules/parameter-properties
|
|
823
794
|
*/
|
|
@@ -833,8 +804,8 @@ export interface ITtscLintTypeScriptRules {
|
|
|
833
804
|
/**
|
|
834
805
|
* Require every `enum` member to have an explicit initializer.
|
|
835
806
|
*
|
|
836
|
-
* Implicit auto-increment is fine for novelty enums but dangerous
|
|
837
|
-
*
|
|
807
|
+
* Implicit auto-increment is fine for novelty enums but dangerous once a
|
|
808
|
+
* value gets persisted.
|
|
838
809
|
*
|
|
839
810
|
* @reference https://typescript-eslint.io/rules/prefer-enum-initializers
|
|
840
811
|
*/
|
|
@@ -844,102 +815,95 @@ export interface ITtscLintTypeScriptRules {
|
|
|
844
815
|
* Prefer `arr.find(predicate)` over `arr.filter(predicate)[0]` and
|
|
845
816
|
* `arr.filter(predicate).at(0)`.
|
|
846
817
|
*
|
|
847
|
-
* Type-aware via the Checker. Fires only when the receiver of
|
|
848
|
-
*
|
|
849
|
-
*
|
|
850
|
-
*
|
|
851
|
-
*
|
|
852
|
-
*
|
|
853
|
-
* `find` cannot express them.
|
|
818
|
+
* Type-aware via the Checker. Fires only when the receiver of `filter` is
|
|
819
|
+
* provably an array or tuple. `find` short-circuits on the first match
|
|
820
|
+
* instead of materializing the whole filtered array, so it expresses the "get
|
|
821
|
+
* me the first match" intent more directly and is strictly faster on large
|
|
822
|
+
* inputs. Non-zero index accesses (`[1]`, `.at(1)`, ...) are intentionally
|
|
823
|
+
* skipped because `find` cannot express them.
|
|
854
824
|
*
|
|
855
825
|
* @reference https://typescript-eslint.io/rules/prefer-find
|
|
856
826
|
*/
|
|
857
827
|
"typescript/prefer-find"?: TtscLintRuleSetting;
|
|
858
828
|
|
|
859
829
|
/**
|
|
860
|
-
* Prefer a type alias over an interface that declares only a
|
|
861
|
-
*
|
|
862
|
-
* structural typing.
|
|
830
|
+
* Prefer a type alias over an interface that declares only a single call
|
|
831
|
+
* signature — the type form composes better with structural typing.
|
|
863
832
|
*
|
|
864
833
|
* @reference https://typescript-eslint.io/rules/prefer-function-type
|
|
865
834
|
*/
|
|
866
835
|
"typescript/prefer-function-type"?: TtscLintRuleSetting;
|
|
867
836
|
|
|
868
837
|
/**
|
|
869
|
-
* Prefer `array.includes(x)` over `array.indexOf(x) !== -1` (and the
|
|
870
|
-
*
|
|
838
|
+
* Prefer `array.includes(x)` over `array.indexOf(x) !== -1` (and the matching
|
|
839
|
+
* `=== -1`, `>= 0`, `< 0`, `> -1` shapes).
|
|
871
840
|
*
|
|
872
|
-
* Type-aware via the Checker. Fires only when the receiver of
|
|
873
|
-
*
|
|
874
|
-
*
|
|
875
|
-
*
|
|
876
|
-
* `indexOf` return value against `-1`.
|
|
841
|
+
* Type-aware via the Checker. Fires only when the receiver of `indexOf` is
|
|
842
|
+
* provably an array, tuple, or string. The `includes`-style call states the
|
|
843
|
+
* intent directly and avoids the sentinel-vs-position confusion that comes
|
|
844
|
+
* with comparing an `indexOf` return value against `-1`.
|
|
877
845
|
*
|
|
878
846
|
* @reference https://typescript-eslint.io/rules/prefer-includes
|
|
879
847
|
*/
|
|
880
848
|
"typescript/prefer-includes"?: TtscLintRuleSetting;
|
|
881
849
|
|
|
882
850
|
/**
|
|
883
|
-
* Prefer literal initializers (`= 0`, `= "FOO"`) for enum members
|
|
884
|
-
*
|
|
885
|
-
* time.
|
|
851
|
+
* Prefer literal initializers (`= 0`, `= "FOO"`) for enum members over
|
|
852
|
+
* computed expressions, so the value is decidable at compile time.
|
|
886
853
|
*
|
|
887
854
|
* @reference https://typescript-eslint.io/rules/prefer-literal-enum-member
|
|
888
855
|
*/
|
|
889
856
|
"typescript/prefer-literal-enum-member"?: TtscLintRuleSetting;
|
|
890
857
|
|
|
891
858
|
/**
|
|
892
|
-
* Prefer the `namespace` keyword over the legacy `module Foo {}`
|
|
893
|
-
*
|
|
859
|
+
* Prefer the `namespace` keyword over the legacy `module Foo {}` form.
|
|
860
|
+
* Autofixable.
|
|
894
861
|
*
|
|
895
862
|
* @reference https://typescript-eslint.io/rules/prefer-namespace-keyword
|
|
896
863
|
*/
|
|
897
864
|
"typescript/prefer-namespace-keyword"?: TtscLintRuleSetting;
|
|
898
865
|
|
|
899
866
|
/**
|
|
900
|
-
* Prefer `??` over `||` (and `??=` over `||=`, and `??` over the
|
|
901
|
-
*
|
|
902
|
-
* `undefined`.
|
|
867
|
+
* Prefer `??` over `||` (and `??=` over `||=`, and `??` over the ternary `x ?
|
|
868
|
+
* x : y`) when the intent is to default `null` / `undefined`.
|
|
903
869
|
*
|
|
904
|
-
* `||` short-circuits on every falsy value (0, "", false, NaN), so
|
|
905
|
-
*
|
|
906
|
-
*
|
|
907
|
-
*
|
|
908
|
-
* ternary condition, etc.).
|
|
870
|
+
* `||` short-circuits on every falsy value (0, "", false, NaN), so "default
|
|
871
|
+
* this if missing" silently coerces legitimate zeros and empty strings. The
|
|
872
|
+
* AST-only baseline skips operands the surrounding context already coerces to
|
|
873
|
+
* boolean (`if (a || b)`, `!(a || b)`, ternary condition, etc.).
|
|
909
874
|
*
|
|
910
875
|
* @reference https://typescript-eslint.io/rules/prefer-nullish-coalescing
|
|
911
876
|
*/
|
|
912
877
|
"typescript/prefer-nullish-coalescing"?: TtscLintRuleSetting;
|
|
913
878
|
|
|
914
879
|
/**
|
|
915
|
-
* Prefer an optional chain (`a?.b?.c`) over chained boolean guards
|
|
916
|
-
*
|
|
880
|
+
* Prefer an optional chain (`a?.b?.c`) over chained boolean guards such as `a
|
|
881
|
+
* && a.b && a.b.c` or `a != null && a.b`.
|
|
917
882
|
*
|
|
918
|
-
* The optional-chain form is shorter and short-circuits to
|
|
919
|
-
*
|
|
920
|
-
*
|
|
921
|
-
*
|
|
922
|
-
*
|
|
923
|
-
*
|
|
883
|
+
* The optional-chain form is shorter and short-circuits to `undefined`
|
|
884
|
+
* instead of the leftmost falsy value, which is almost always the intent when
|
|
885
|
+
* guarding a property access against a nullish base. AST-only: the rule
|
|
886
|
+
* matches by the textual identity of the guard against the receiver of the
|
|
887
|
+
* right-hand access, and skips chains that cross a call expression with
|
|
888
|
+
* arguments.
|
|
924
889
|
*
|
|
925
890
|
* @reference https://typescript-eslint.io/rules/prefer-optional-chain
|
|
926
891
|
*/
|
|
927
892
|
"typescript/prefer-optional-chain"?: TtscLintRuleSetting;
|
|
928
893
|
|
|
929
894
|
/**
|
|
930
|
-
* Reject `Promise.reject(value)` where `value` is statically known
|
|
931
|
-
*
|
|
932
|
-
*
|
|
895
|
+
* Reject `Promise.reject(value)` where `value` is statically known not to
|
|
896
|
+
* derive from `Error` — string literals, numbers, plain primitives, and the
|
|
897
|
+
* like.
|
|
933
898
|
*
|
|
934
|
-
* Type-aware via the Checker. Mirrors `typescript/only-throw-error`
|
|
935
|
-
*
|
|
936
|
-
*
|
|
937
|
-
*
|
|
938
|
-
*
|
|
939
|
-
*
|
|
940
|
-
*
|
|
941
|
-
* `
|
|
942
|
-
* `allowThrowingAny` / `allowThrowingUnknown` defaults.
|
|
899
|
+
* Type-aware via the Checker. Mirrors `typescript/only-throw-error` for the
|
|
900
|
+
* rejection side of the promise contract: a non-Error rejection loses the
|
|
901
|
+
* structured stack trace and breaks downstream `instanceof Error` checks in
|
|
902
|
+
* `.catch(...)` / `try { await … } catch (err)` handlers. Covers
|
|
903
|
+
* `Promise.reject(arg)`, `<promise>.reject(arg)` on a Promise-typed receiver,
|
|
904
|
+
* and `reject(arg)` calls bound to the second parameter of a `new Promise((_,
|
|
905
|
+
* reject) => …)` executor. `any` and `unknown` pass through, matching
|
|
906
|
+
* upstream's `allowThrowingAny` / `allowThrowingUnknown` defaults.
|
|
943
907
|
*
|
|
944
908
|
* @reference https://typescript-eslint.io/rules/prefer-promise-reject-errors
|
|
945
909
|
*/
|
|
@@ -948,15 +912,14 @@ export interface ITtscLintTypeScriptRules {
|
|
|
948
912
|
/**
|
|
949
913
|
* Reject private class fields that could carry `readonly`.
|
|
950
914
|
*
|
|
951
|
-
* AST-only baseline: fires on a `PropertyDeclaration` inside a class
|
|
952
|
-
*
|
|
953
|
-
*
|
|
954
|
-
*
|
|
955
|
-
*
|
|
956
|
-
*
|
|
957
|
-
*
|
|
958
|
-
*
|
|
959
|
-
* narrow but safe shape.
|
|
915
|
+
* AST-only baseline: fires on a `PropertyDeclaration` inside a class body
|
|
916
|
+
* that is `private` (or uses the `#name` private-hash form), does not already
|
|
917
|
+
* carry `readonly`, and is initialized at the declaration site. A field
|
|
918
|
+
* initialized at declaration time is set before the constructor runs, so
|
|
919
|
+
* locking it as `readonly` rules out accidental reassignments without
|
|
920
|
+
* changing runtime behavior. The fully type-aware upstream rule also walks
|
|
921
|
+
* assignments inside the constructor and other methods; the AST baseline
|
|
922
|
+
* targets the narrow but safe shape.
|
|
960
923
|
*
|
|
961
924
|
* @reference https://typescript-eslint.io/rules/prefer-readonly
|
|
962
925
|
*/
|
|
@@ -966,83 +929,75 @@ export interface ITtscLintTypeScriptRules {
|
|
|
966
929
|
* Prefer `arr.reduce<T>(callback, initial)` over the assertion-on-
|
|
967
930
|
* initial-value pattern `arr.reduce(callback, initial as T)`.
|
|
968
931
|
*
|
|
969
|
-
* Type-aware via the Checker. The accumulator type bound through a
|
|
970
|
-
*
|
|
971
|
-
*
|
|
972
|
-
*
|
|
973
|
-
*
|
|
974
|
-
*
|
|
975
|
-
*
|
|
976
|
-
* or angle-bracket type assertion.
|
|
932
|
+
* Type-aware via the Checker. The accumulator type bound through a call-site
|
|
933
|
+
* type parameter constrains the callback's accumulator parameter directly; an
|
|
934
|
+
* `as` on the seed only widens the runtime value and lets the callback infer
|
|
935
|
+
* the accumulator's parameter type from the seed's widened literal shape
|
|
936
|
+
* instead. The rule fires only when the `.reduce` receiver is provably an
|
|
937
|
+
* array or tuple, the call has no existing type arguments, and the second
|
|
938
|
+
* argument is an `as` or angle-bracket type assertion.
|
|
977
939
|
*
|
|
978
940
|
* @reference https://typescript-eslint.io/rules/prefer-reduce-type-parameter
|
|
979
941
|
*/
|
|
980
942
|
"typescript/prefer-reduce-type-parameter"?: TtscLintRuleSetting;
|
|
981
943
|
|
|
982
944
|
/**
|
|
983
|
-
* Prefer `re.exec(str)` over `str.match(re)` when the regex has no
|
|
984
|
-
* `g` flag.
|
|
945
|
+
* Prefer `re.exec(str)` over `str.match(re)` when the regex has no `g` flag.
|
|
985
946
|
*
|
|
986
|
-
* Type-aware via the Checker. Both shapes return the same
|
|
987
|
-
*
|
|
988
|
-
*
|
|
989
|
-
*
|
|
990
|
-
*
|
|
991
|
-
*
|
|
992
|
-
*
|
|
993
|
-
*
|
|
994
|
-
* conservatively skipped because static flag tracking would explode
|
|
995
|
-
* in scope.
|
|
947
|
+
* Type-aware via the Checker. Both shapes return the same `RegExpExecArray |
|
|
948
|
+
* null` for first-match queries, but `String#match` silently switches to
|
|
949
|
+
* "every match" the moment the regex gains the `g` flag — a typo at the regex
|
|
950
|
+
* literal changes the call's return shape from `[fullMatch, ...captures]` to
|
|
951
|
+
* a flat `string[]` of matches. The AST-only baseline reads the flag suffix
|
|
952
|
+
* off the regex literal directly; non-literal regex arguments (a `new
|
|
953
|
+
* RegExp(...)`, a variable holding `/.../`) are conservatively skipped
|
|
954
|
+
* because static flag tracking would explode in scope.
|
|
996
955
|
*
|
|
997
956
|
* @reference https://typescript-eslint.io/rules/prefer-regexp-exec
|
|
998
957
|
*/
|
|
999
958
|
"typescript/prefer-regexp-exec"?: TtscLintRuleSetting;
|
|
1000
959
|
|
|
1001
960
|
/**
|
|
1002
|
-
* When an instance method always `return this`, declare its return
|
|
1003
|
-
*
|
|
1004
|
-
*
|
|
1005
|
-
* stays polymorphic.
|
|
961
|
+
* When an instance method always `return this`, declare its return type as
|
|
962
|
+
* `this` instead of the enclosing class name so subclass call sites keep the
|
|
963
|
+
* narrower receiver type and method-chaining stays polymorphic.
|
|
1006
964
|
*
|
|
1007
|
-
* Type-aware via the Checker. Fires only when the method declares
|
|
1008
|
-
*
|
|
1009
|
-
*
|
|
1010
|
-
*
|
|
1011
|
-
*
|
|
1012
|
-
*
|
|
1013
|
-
* semantics the `this` rewrite does not preserve.
|
|
965
|
+
* Type-aware via the Checker. Fires only when the method declares an explicit
|
|
966
|
+
* non-`this` return-type annotation AND every value-returning `return`
|
|
967
|
+
* statement in the body returns exactly `this`. Methods with no annotation,
|
|
968
|
+
* methods with at least one non-`this` return, `async` methods, generators,
|
|
969
|
+
* constructors, accessors, and static methods are skipped — each has
|
|
970
|
+
* return-shape semantics the `this` rewrite does not preserve.
|
|
1014
971
|
*
|
|
1015
972
|
* @reference https://typescript-eslint.io/rules/prefer-return-this-type
|
|
1016
973
|
*/
|
|
1017
974
|
"typescript/prefer-return-this-type"?: TtscLintRuleSetting;
|
|
1018
975
|
|
|
1019
976
|
/**
|
|
1020
|
-
* Prefer `str.startsWith(prefix)` / `str.endsWith(suffix)` over the
|
|
1021
|
-
*
|
|
1022
|
-
*
|
|
1023
|
-
*
|
|
1024
|
-
* and `/suffix$/.test(str)`.
|
|
977
|
+
* Prefer `str.startsWith(prefix)` / `str.endsWith(suffix)` over the `indexOf`
|
|
978
|
+
* / `lastIndexOf` and anchored-regex idioms — `str.indexOf(p) === 0`,
|
|
979
|
+
* `str.indexOf(p, str.length - p.length) !== -1`, `str.lastIndexOf(p) ===
|
|
980
|
+
* str.length - p.length`, `/^prefix/.test(str)`, and `/suffix$/.test(str)`.
|
|
1025
981
|
*
|
|
1026
|
-
* Type-aware via the Checker. Fires only when the string-position
|
|
1027
|
-
*
|
|
1028
|
-
*
|
|
1029
|
-
*
|
|
982
|
+
* Type-aware via the Checker. Fires only when the string-position subject is
|
|
983
|
+
* provably a `string`-like type. The dedicated methods state the intent
|
|
984
|
+
* directly and avoid the off-by-one arithmetic and regex-anchor pitfalls of
|
|
985
|
+
* the older shapes.
|
|
1030
986
|
*
|
|
1031
987
|
* @reference https://typescript-eslint.io/rules/prefer-string-starts-ends-with
|
|
1032
988
|
*/
|
|
1033
989
|
"typescript/prefer-string-starts-ends-with"?: TtscLintRuleSetting;
|
|
1034
990
|
|
|
1035
991
|
/**
|
|
1036
|
-
* Require functions whose return type is `Promise<T>` (or a
|
|
1037
|
-
*
|
|
992
|
+
* Require functions whose return type is `Promise<T>` (or a Promise-like
|
|
993
|
+
* thenable) to be declared with the `async` keyword.
|
|
1038
994
|
*
|
|
1039
|
-
* Type-aware via the Checker. An `async` function wraps a synchronous
|
|
1040
|
-
*
|
|
1041
|
-
*
|
|
1042
|
-
*
|
|
1043
|
-
*
|
|
1044
|
-
*
|
|
1045
|
-
* abstract methods, and declaration-merging hosts (functions with
|
|
995
|
+
* Type-aware via the Checker. An `async` function wraps a synchronous `throw`
|
|
996
|
+
* into a rejected Promise so the caller's `await` / `.catch(...)` observes
|
|
997
|
+
* it; the non-async equivalent throws synchronously and bypasses every
|
|
998
|
+
* Promise-aware handler downstream. Marking the function `async` keeps the
|
|
999
|
+
* rejection channel consistent with the declared return type. Overload
|
|
1000
|
+
* signatures, abstract methods, and declaration-merging hosts (functions with
|
|
1046
1001
|
* no body) are skipped — there is no body to wrap.
|
|
1047
1002
|
*
|
|
1048
1003
|
* @reference https://typescript-eslint.io/rules/promise-function-async
|
|
@@ -1050,87 +1005,81 @@ export interface ITtscLintTypeScriptRules {
|
|
|
1050
1005
|
"typescript/promise-function-async"?: TtscLintRuleSetting;
|
|
1051
1006
|
|
|
1052
1007
|
/**
|
|
1053
|
-
* Reject a `get` accessor whose declared return type does not match
|
|
1054
|
-
*
|
|
1055
|
-
*
|
|
1056
|
-
*
|
|
1057
|
-
*
|
|
1058
|
-
* accessors carry independent annotations.
|
|
1008
|
+
* Reject a `get` accessor whose declared return type does not match the
|
|
1009
|
+
* parameter type of its companion `set` accessor on the same class. The
|
|
1010
|
+
* accessor pair presents a single conceptual field to callers — `obj.x = v`
|
|
1011
|
+
* followed by `w = obj.x` should round-trip with compatible types — but
|
|
1012
|
+
* TypeScript otherwise lets the two accessors carry independent annotations.
|
|
1059
1013
|
*
|
|
1060
|
-
* Type-aware. The comparison resolves both sides through the
|
|
1061
|
-
*
|
|
1062
|
-
*
|
|
1063
|
-
* is decided.
|
|
1014
|
+
* Type-aware. The comparison resolves both sides through the Checker so type
|
|
1015
|
+
* aliases, generic parameters, and union constituents collapse to the same
|
|
1016
|
+
* set of values before equality is decided.
|
|
1064
1017
|
*
|
|
1065
1018
|
* @reference https://typescript-eslint.io/rules/related-getter-setter-pairs
|
|
1066
1019
|
*/
|
|
1067
1020
|
"typescript/related-getter-setter-pairs"?: TtscLintRuleSetting;
|
|
1068
1021
|
|
|
1069
1022
|
/**
|
|
1070
|
-
* Require `arr.sort()` and `arr.toSorted()` calls to pass an
|
|
1071
|
-
*
|
|
1023
|
+
* Require `arr.sort()` and `arr.toSorted()` calls to pass an explicit
|
|
1024
|
+
* `compareFunction`.
|
|
1072
1025
|
*
|
|
1073
|
-
* Without a comparator both methods coerce elements to strings and
|
|
1074
|
-
*
|
|
1075
|
-
*
|
|
1076
|
-
*
|
|
1077
|
-
*
|
|
1078
|
-
* trigger the rule.
|
|
1026
|
+
* Without a comparator both methods coerce elements to strings and sort
|
|
1027
|
+
* lexically, so `[10, 2, 1].sort()` returns `[1, 10, 2]` — almost never the
|
|
1028
|
+
* intent. Type-aware via the Checker: only fires when the receiver is
|
|
1029
|
+
* provably an array or tuple, so user-defined methods named `sort` /
|
|
1030
|
+
* `toSorted` on non-array types do not trigger the rule.
|
|
1079
1031
|
*
|
|
1080
1032
|
* @reference https://typescript-eslint.io/rules/require-array-sort-compare
|
|
1081
1033
|
*/
|
|
1082
1034
|
"typescript/require-array-sort-compare"?: TtscLintRuleSetting;
|
|
1083
1035
|
|
|
1084
1036
|
/**
|
|
1085
|
-
* Reject `async` functions whose body contains no `await`
|
|
1086
|
-
* expression.
|
|
1037
|
+
* Reject `async` functions whose body contains no `await` expression.
|
|
1087
1038
|
*
|
|
1088
|
-
* An async function with no `await` only inflates the return type
|
|
1089
|
-
*
|
|
1090
|
-
*
|
|
1091
|
-
*
|
|
1039
|
+
* An async function with no `await` only inflates the return type to
|
|
1040
|
+
* `Promise<T>` without doing any asynchronous work; collapse it to a sync
|
|
1041
|
+
* function. Async generators are accepted as long as they have at least one
|
|
1042
|
+
* `yield`.
|
|
1092
1043
|
*
|
|
1093
1044
|
* @reference https://typescript-eslint.io/rules/require-await
|
|
1094
1045
|
*/
|
|
1095
1046
|
"typescript/require-await"?: TtscLintRuleSetting;
|
|
1096
1047
|
|
|
1097
1048
|
/**
|
|
1098
|
-
* Reject `+` expressions whose operands are not both `number`,
|
|
1099
|
-
*
|
|
1049
|
+
* Reject `+` expressions whose operands are not both `number`, both `string`,
|
|
1050
|
+
* or both `bigint`.
|
|
1100
1051
|
*
|
|
1101
|
-
* Type-aware via the Checker. `1 + "a"`, `null + 5`, and
|
|
1102
|
-
*
|
|
1103
|
-
*
|
|
1104
|
-
*
|
|
1105
|
-
* or use a template literal.
|
|
1052
|
+
* Type-aware via the Checker. `1 + "a"`, `null + 5`, and `obj + 1` are
|
|
1053
|
+
* silently coerced by the runtime — almost always a bug. Mixed
|
|
1054
|
+
* `number`/`string` concatenations are likewise rejected: the author should
|
|
1055
|
+
* convert explicitly with `String(x)` or use a template literal.
|
|
1106
1056
|
*
|
|
1107
1057
|
* @reference https://typescript-eslint.io/rules/restrict-plus-operands
|
|
1108
1058
|
*/
|
|
1109
1059
|
"typescript/restrict-plus-operands"?: TtscLintRuleSetting;
|
|
1110
1060
|
|
|
1111
1061
|
/**
|
|
1112
|
-
* Reject template-literal interpolations whose expression carries a
|
|
1113
|
-
*
|
|
1114
|
-
*
|
|
1062
|
+
* Reject template-literal interpolations whose expression carries a type that
|
|
1063
|
+
* does not stringify cleanly — `${obj}` prints `"[object Object]"`, `${null}`
|
|
1064
|
+
* prints `"null"`, and so on.
|
|
1115
1065
|
*
|
|
1116
|
-
* Type-aware via the Checker. Each `${...}` span's type must be
|
|
1117
|
-
*
|
|
1118
|
-
*
|
|
1119
|
-
*
|
|
1120
|
-
*
|
|
1121
|
-
* constituent stringify cleanly.
|
|
1066
|
+
* Type-aware via the Checker. Each `${...}` span's type must be string-like,
|
|
1067
|
+
* number-like, bigint-like, or boolean-like; `any`, `unknown`, and `never`
|
|
1068
|
+
* pass through to avoid false positives on generic helpers, matching upstream
|
|
1069
|
+
* `allowAny` / `allowNever` defaults. Union and intersection types must have
|
|
1070
|
+
* every constituent stringify cleanly.
|
|
1122
1071
|
*
|
|
1123
1072
|
* @reference https://typescript-eslint.io/rules/restrict-template-expressions
|
|
1124
1073
|
*/
|
|
1125
1074
|
"typescript/restrict-template-expressions"?: TtscLintRuleSetting;
|
|
1126
1075
|
|
|
1127
1076
|
/**
|
|
1128
|
-
* Reject `return promise` inside `try`, `catch`, or `finally`;
|
|
1129
|
-
*
|
|
1077
|
+
* Reject `return promise` inside `try`, `catch`, or `finally`; require
|
|
1078
|
+
* `return await promise`.
|
|
1130
1079
|
*
|
|
1131
|
-
* Without the `await`, the surrounding handler unbinds before the
|
|
1132
|
-
*
|
|
1133
|
-
*
|
|
1080
|
+
* Without the `await`, the surrounding handler unbinds before the promise
|
|
1081
|
+
* settles, so a rejection skips the `catch` block entirely and the `finally`
|
|
1082
|
+
* cleanup races the result.
|
|
1134
1083
|
*
|
|
1135
1084
|
* @reference https://typescript-eslint.io/rules/return-await
|
|
1136
1085
|
*/
|
|
@@ -1138,17 +1087,15 @@ export interface ITtscLintTypeScriptRules {
|
|
|
1138
1087
|
|
|
1139
1088
|
/**
|
|
1140
1089
|
* Require union and intersection type constituents to be listed in a
|
|
1141
|
-
* canonical group order — keyword primitives alphabetized first,
|
|
1142
|
-
*
|
|
1143
|
-
*
|
|
1144
|
-
*
|
|
1145
|
-
* discussion from review.
|
|
1090
|
+
* canonical group order — keyword primitives alphabetized first, named /
|
|
1091
|
+
* object references alphabetized next, `null` / `undefined` last. Two authors
|
|
1092
|
+
* writing the same set of values can otherwise disagree on the spelling, and
|
|
1093
|
+
* the canonical order eliminates that discussion from review.
|
|
1146
1094
|
*
|
|
1147
1095
|
* AST-only baseline: ordering is decided by syntactic group (keyword
|
|
1148
|
-
* primitive vs. named reference vs. nullish) and a within-group
|
|
1149
|
-
*
|
|
1150
|
-
* the
|
|
1151
|
-
* diagnostic.
|
|
1096
|
+
* primitive vs. named reference vs. nullish) and a within-group source-text
|
|
1097
|
+
* sort. Nested unions / intersections are skipped — only the outermost shape,
|
|
1098
|
+
* the one the author wrote, fires the diagnostic.
|
|
1152
1099
|
*
|
|
1153
1100
|
* @reference https://typescript-eslint.io/rules/sort-type-constituents
|
|
1154
1101
|
*/
|
|
@@ -1157,13 +1104,12 @@ export interface ITtscLintTypeScriptRules {
|
|
|
1157
1104
|
/**
|
|
1158
1105
|
* Reject non-boolean values used in a boolean context.
|
|
1159
1106
|
*
|
|
1160
|
-
* Type-aware via the Checker. Fires when the test of an `if`,
|
|
1161
|
-
* `
|
|
1162
|
-
*
|
|
1163
|
-
*
|
|
1164
|
-
*
|
|
1165
|
-
*
|
|
1166
|
-
* coerce in boolean position; an explicit comparison (`count !== 0`,
|
|
1107
|
+
* Type-aware via the Checker. Fires when the test of an `if`, `while`, `do`,
|
|
1108
|
+
* `for`, or ternary, the operand of `!`, or either side of `&&` / `||`
|
|
1109
|
+
* carries a type whose flags are not pure boolean. Numbers (`if (count)` is
|
|
1110
|
+
* truthy for any non-zero), strings (`""` is falsy), and nullable objects
|
|
1111
|
+
* (`if (obj)` conflates `null` / `undefined` with a present object) all
|
|
1112
|
+
* silently coerce in boolean position; an explicit comparison (`count !== 0`,
|
|
1167
1113
|
* `str.length > 0`, `obj != null`) names the intent.
|
|
1168
1114
|
*
|
|
1169
1115
|
* @reference https://typescript-eslint.io/rules/strict-boolean-expressions
|
|
@@ -1171,24 +1117,22 @@ export interface ITtscLintTypeScriptRules {
|
|
|
1171
1117
|
"typescript/strict-boolean-expressions"?: TtscLintRuleSetting;
|
|
1172
1118
|
|
|
1173
1119
|
/**
|
|
1174
|
-
* Require every member of a union or `enum` discriminant to be
|
|
1175
|
-
*
|
|
1176
|
-
* present.
|
|
1120
|
+
* Require every member of a union or `enum` discriminant to be covered by an
|
|
1121
|
+
* explicit `case`, unless a `default` clause is present.
|
|
1177
1122
|
*
|
|
1178
|
-
* Type-aware via the Checker. The rule resolves the discriminant
|
|
1179
|
-
*
|
|
1180
|
-
*
|
|
1181
|
-
*
|
|
1182
|
-
* `default` clause
|
|
1183
|
-
* remaining shape and silences the rule.
|
|
1123
|
+
* Type-aware via the Checker. The rule resolves the discriminant type, walks
|
|
1124
|
+
* each constituent of the union (or each member of the enum), matches it
|
|
1125
|
+
* against the `case` expressions in the body, and flags the switch when at
|
|
1126
|
+
* least one constituent is uncovered and no `default` clause is present. A
|
|
1127
|
+
* `default` clause covers the remaining shape and silences the rule.
|
|
1184
1128
|
*
|
|
1185
1129
|
* @reference https://typescript-eslint.io/rules/switch-exhaustiveness-check
|
|
1186
1130
|
*/
|
|
1187
1131
|
"typescript/switch-exhaustiveness-check"?: TtscLintRuleSetting;
|
|
1188
1132
|
|
|
1189
1133
|
/**
|
|
1190
|
-
* Reject `/// <reference path="..." />`, `/// <reference types=""
|
|
1191
|
-
*
|
|
1134
|
+
* Reject `/// <reference path="..." />`, `/// <reference types="" />`, and
|
|
1135
|
+
* `/// <reference lib="" />` directives.
|
|
1192
1136
|
*
|
|
1193
1137
|
* Replace with `import` (or `import type`) declarations and
|
|
1194
1138
|
* `compilerOptions.types` in `tsconfig.json`.
|
|
@@ -1198,31 +1142,29 @@ export interface ITtscLintTypeScriptRules {
|
|
|
1198
1142
|
"typescript/triple-slash-reference"?: TtscLintRuleSetting;
|
|
1199
1143
|
|
|
1200
1144
|
/**
|
|
1201
|
-
* Reject referencing a class instance method as a value instead of
|
|
1202
|
-
*
|
|
1203
|
-
*
|
|
1145
|
+
* Reject referencing a class instance method as a value instead of calling it
|
|
1146
|
+
* (`obj.method` passed as a callback, aliased to a variable, or stored on
|
|
1147
|
+
* another object).
|
|
1204
1148
|
*
|
|
1205
|
-
* Type-aware via the Checker. JavaScript methods are not bound to
|
|
1206
|
-
*
|
|
1207
|
-
*
|
|
1208
|
-
*
|
|
1209
|
-
*
|
|
1210
|
-
*
|
|
1211
|
-
*
|
|
1212
|
-
* stably bound.
|
|
1149
|
+
* Type-aware via the Checker. JavaScript methods are not bound to their
|
|
1150
|
+
* receiver — once extracted, `this` resolves to whatever the caller supplies
|
|
1151
|
+
* (usually `undefined` in strict mode or the host object the value lands on).
|
|
1152
|
+
* Safe positions — immediate call (`obj.method()`), assignment target,
|
|
1153
|
+
* `typeof` / `delete` operand, `instanceof` / `in` operand, and
|
|
1154
|
+
* tagged-template tag — pass through; static methods are exempt because the
|
|
1155
|
+
* constructor is stably bound.
|
|
1213
1156
|
*
|
|
1214
1157
|
* @reference https://typescript-eslint.io/rules/unbound-method
|
|
1215
1158
|
*/
|
|
1216
1159
|
"typescript/unbound-method"?: TtscLintRuleSetting;
|
|
1217
1160
|
|
|
1218
1161
|
/**
|
|
1219
|
-
* Require the callback parameter of `.catch(...)` and the second
|
|
1220
|
-
*
|
|
1162
|
+
* Require the callback parameter of `.catch(...)` and the second argument of
|
|
1163
|
+
* `.then(...)` to be typed `unknown`.
|
|
1221
1164
|
*
|
|
1222
|
-
* Mirrors TypeScript 4.4+ `useUnknownInCatchVariables`, which made
|
|
1223
|
-
*
|
|
1224
|
-
*
|
|
1225
|
-
* implicit `any`.
|
|
1165
|
+
* Mirrors TypeScript 4.4+ `useUnknownInCatchVariables`, which made `catch
|
|
1166
|
+
* (e)` default to `unknown` — the same discipline applied to promise
|
|
1167
|
+
* rejection handlers so a rejection cannot smuggle in an implicit `any`.
|
|
1226
1168
|
*
|
|
1227
1169
|
* @reference https://typescript-eslint.io/rules/use-unknown-in-catch-callback-variable
|
|
1228
1170
|
*/
|