From e927265d2da702503d371cdd2233d8bb639d9350 Mon Sep 17 00:00:00 2001 From: shulaoda Date: Mon, 26 Aug 2024 12:25:44 +0800 Subject: [PATCH] refactor(linter): remove meaningless span0 --- .../src/rules/eslint/default_case.rs | 4 +- .../src/rules/eslint/default_case_last.rs | 4 +- .../src/rules/eslint/default_param_last.rs | 4 +- .../src/rules/eslint/getter_return.rs | 4 +- .../src/rules/eslint/guard_for_in.rs | 4 +- .../src/rules/eslint/no_array_constructor.rs | 4 +- .../rules/eslint/no_async_promise_executor.rs | 4 +- .../src/rules/eslint/no_await_in_loop.rs | 4 +- .../oxc_linter/src/rules/eslint/no_caller.rs | 4 +- .../src/rules/eslint/no_case_declarations.rs | 4 +- .../src/rules/eslint/no_cond_assign.rs | 4 +- .../oxc_linter/src/rules/eslint/no_console.rs | 4 +- .../eslint/no_constant_binary_expression.rs | 8 +-- .../src/rules/eslint/no_constant_condition.rs | 4 +- .../src/rules/eslint/no_continue.rs | 4 +- .../src/rules/eslint/no_debugger.rs | 4 +- .../src/rules/eslint/no_delete_var.rs | 4 +- .../src/rules/eslint/no_div_regex.rs | 4 +- .../rules/eslint/no_empty_character_class.rs | 4 +- .../src/rules/eslint/no_empty_function.rs | 4 +- .../src/rules/eslint/no_empty_static_block.rs | 4 +- .../oxc_linter/src/rules/eslint/no_eq_null.rs | 4 +- crates/oxc_linter/src/rules/eslint/no_eval.rs | 4 +- .../src/rules/eslint/no_ex_assign.rs | 4 +- .../src/rules/eslint/no_extra_boolean_cast.rs | 8 +-- .../src/rules/eslint/no_import_assign.rs | 4 +- .../rules/eslint/no_irregular_whitespace.rs | 4 +- .../src/rules/eslint/no_iterator.rs | 4 +- .../src/rules/eslint/no_loss_of_precision.rs | 4 +- .../src/rules/eslint/no_multi_str.rs | 4 +- crates/oxc_linter/src/rules/eslint/no_new.rs | 4 +- .../oxc_linter/src/rules/eslint/no_proto.rs | 4 +- .../src/rules/eslint/no_regex_spaces.rs | 4 +- .../src/rules/eslint/no_script_url.rs | 4 +- .../src/rules/eslint/no_self_assign.rs | 4 +- .../src/rules/eslint/no_setter_return.rs | 4 +- .../eslint/no_template_curly_in_string.rs | 4 +- .../oxc_linter/src/rules/eslint/no_ternary.rs | 4 +- .../src/rules/eslint/no_this_before_super.rs | 4 +- .../src/rules/eslint/no_undefined.rs | 8 +-- .../src/rules/eslint/no_unsafe_finally.rs | 4 +- .../eslint/no_unsafe_optional_chaining.rs | 8 +-- .../src/rules/eslint/no_useless_concat.rs | 4 +- .../src/rules/eslint/no_useless_rename.rs | 4 +- crates/oxc_linter/src/rules/eslint/no_var.rs | 4 +- crates/oxc_linter/src/rules/eslint/no_void.rs | 4 +- crates/oxc_linter/src/rules/eslint/no_with.rs | 4 +- .../eslint/prefer_exponentiation_operator.rs | 4 +- .../rules/eslint/prefer_numeric_literals.rs | 4 +- crates/oxc_linter/src/rules/eslint/radix.rs | 16 +++--- .../src/rules/eslint/require_await.rs | 4 +- .../src/rules/eslint/require_yield.rs | 4 +- .../src/rules/eslint/sort_imports.rs | 8 +-- .../src/rules/eslint/unicode_bom.rs | 8 +-- .../oxc_linter/src/rules/eslint/use_isnan.rs | 12 ++--- crates/oxc_linter/src/rules/import/export.rs | 4 +- .../oxc_linter/src/rules/import/namespace.rs | 16 +++--- crates/oxc_linter/src/rules/import/no_amd.rs | 4 +- .../oxc_linter/src/rules/import/no_cycle.rs | 4 +- .../src/rules/import/no_default_export.rs | 4 +- .../src/rules/import/no_named_as_default.rs | 4 +- .../import/no_named_as_default_member.rs | 9 +--- .../src/rules/import/no_self_import.rs | 4 +- .../src/rules/import/no_unused_modules.rs | 4 +- .../rules/import/no_webpack_loader_syntax.rs | 4 +- .../src/rules/jest/consistent_test_it.rs | 8 +-- .../src/rules/jest/expect_expect.rs | 4 +- .../src/rules/jest/max_nested_describe.rs | 4 +- .../src/rules/jest/no_commented_out_tests.rs | 4 +- .../src/rules/jest/no_conditional_expect.rs | 4 +- .../src/rules/jest/no_conditional_in_test.rs | 4 +- .../rules/jest/no_confusing_set_timeout.rs | 12 ++--- .../src/rules/jest/no_done_callback.rs | 8 +-- .../src/rules/jest/no_duplicate_hooks.rs | 4 +- crates/oxc_linter/src/rules/jest/no_export.rs | 4 +- .../src/rules/jest/no_focused_tests.rs | 4 +- crates/oxc_linter/src/rules/jest/no_hooks.rs | 4 +- .../src/rules/jest/no_identical_title.rs | 8 +-- .../jest/no_interpolation_in_snapshots.rs | 4 +- .../src/rules/jest/no_large_snapshots.rs | 8 +-- .../src/rules/jest/no_mocks_import.rs | 4 +- .../src/rules/jest/no_standalone_expect.rs | 4 +- .../rules/jest/no_test_return_statement.rs | 4 +- .../src/rules/jest/prefer_called_with.rs | 8 +-- .../src/rules/jest/prefer_equality_matcher.rs | 4 +- .../src/rules/jest/prefer_expect_resolves.rs | 4 +- .../src/rules/jest/prefer_hooks_in_order.rs | 4 +- .../src/rules/jest/prefer_hooks_on_top.rs | 4 +- .../src/rules/jest/prefer_jest_mocked.rs | 4 +- .../src/rules/jest/prefer_spy_on.rs | 4 +- .../src/rules/jest/prefer_strict_equal.rs | 4 +- .../oxc_linter/src/rules/jest/prefer_to_be.rs | 20 +++---- .../src/rules/jest/prefer_to_contain.rs | 4 +- .../src/rules/jest/prefer_to_have_length.rs | 4 +- .../oxc_linter/src/rules/jest/prefer_todo.rs | 8 +-- .../oxc_linter/src/rules/jest/require_hook.rs | 4 +- .../rules/jest/require_top_level_describe.rs | 12 ++--- .../src/rules/jsdoc/check_access.rs | 8 +-- .../src/rules/jsdoc/check_property_names.rs | 4 +- .../src/rules/jsdoc/check_tag_names.rs | 4 +- .../oxc_linter/src/rules/jsdoc/empty_tags.rs | 4 +- .../src/rules/jsdoc/implements_on_classes.rs | 4 +- .../oxc_linter/src/rules/jsdoc/no_defaults.rs | 4 +- .../rules/jsdoc/require_param_description.rs | 4 +- .../src/rules/jsdoc/require_param_name.rs | 4 +- .../src/rules/jsdoc/require_param_type.rs | 4 +- .../jsdoc/require_property_description.rs | 4 +- .../src/rules/jsdoc/require_property_name.rs | 4 +- .../src/rules/jsdoc/require_property_type.rs | 4 +- .../src/rules/jsdoc/require_returns.rs | 8 +-- .../jsdoc/require_returns_description.rs | 4 +- .../src/rules/jsdoc/require_returns_type.rs | 4 +- .../src/rules/jsdoc/require_yields.rs | 12 ++--- .../oxc_linter/src/rules/jsx_a11y/alt_text.rs | 32 +++++------ .../src/rules/jsx_a11y/anchor_has_content.rs | 4 +- .../src/rules/jsx_a11y/anchor_is_valid.rs | 12 ++--- .../src/rules/jsx_a11y/aria_role.rs | 4 +- .../jsx_a11y/aria_unsupported_elements.rs | 4 +- .../jsx_a11y/click_events_have_key_events.rs | 4 +- .../src/rules/jsx_a11y/heading_has_content.rs | 4 +- .../src/rules/jsx_a11y/html_has_lang.rs | 8 +-- .../src/rules/jsx_a11y/iframe_has_title.rs | 4 +- .../src/rules/jsx_a11y/img_redundant_alt.rs | 4 +- crates/oxc_linter/src/rules/jsx_a11y/lang.rs | 4 +- .../src/rules/jsx_a11y/media_has_caption.rs | 4 +- .../jsx_a11y/mouse_events_have_key_events.rs | 8 +-- .../src/rules/jsx_a11y/no_access_key.rs | 4 +- .../jsx_a11y/no_aria_hidden_on_focusable.rs | 4 +- .../src/rules/jsx_a11y/no_autofocus.rs | 4 +- .../rules/jsx_a11y/no_distracting_elements.rs | 4 +- .../jsx_a11y/role_supports_aria_props.rs | 8 +-- crates/oxc_linter/src/rules/jsx_a11y/scope.rs | 4 +- .../rules/jsx_a11y/tabindex_no_positive.rs | 4 +- .../src/rules/nextjs/google_font_display.rs | 8 +-- .../rules/nextjs/google_font_preconnect.rs | 4 +- .../src/rules/nextjs/inline_script_id.rs | 4 +- .../src/rules/nextjs/next_script_for_ga.rs | 4 +- .../rules/nextjs/no_assign_module_variable.rs | 4 +- .../rules/nextjs/no_async_client_component.rs | 4 +- ...ore_interactive_script_outside_document.rs | 4 +- .../src/rules/nextjs/no_css_tags.rs | 4 +- .../nextjs/no_document_import_in_page.rs | 4 +- .../src/rules/nextjs/no_head_element.rs | 4 +- .../nextjs/no_head_import_in_document.rs | 4 +- .../src/rules/nextjs/no_img_element.rs | 4 +- .../src/rules/nextjs/no_page_custom_font.rs | 8 +-- .../nextjs/no_script_component_in_head.rs | 4 +- .../rules/nextjs/no_styled_jsx_in_document.rs | 4 +- .../src/rules/nextjs/no_sync_scripts.rs | 4 +- .../rules/nextjs/no_title_in_document_head.rs | 4 +- .../src/rules/oxc/approx_constant.rs | 4 +- .../src/rules/oxc/bad_bitwise_operator.rs | 4 +- .../src/rules/oxc/bad_comparison_sequence.rs | 4 +- .../oxc/bad_object_literal_comparison.rs | 8 +-- .../src/rules/oxc/double_comparisons.rs | 4 +- crates/oxc_linter/src/rules/oxc/erasing_op.rs | 4 +- .../src/rules/oxc/misrefactored_assign_op.rs | 4 +- .../oxc_linter/src/rules/oxc/missing_throw.rs | 4 +- .../src/rules/oxc/no_async_await.rs | 4 +- .../oxc_linter/src/rules/oxc/no_const_enum.rs | 4 +- .../src/rules/oxc/no_optional_chaining.rs | 6 +-- .../rules/oxc/no_rest_spread_properties.rs | 4 +- .../src/rules/oxc/only_used_in_recursion.rs | 4 +- .../oxc_linter/src/rules/promise/avoid_new.rs | 4 +- .../src/rules/promise/no_new_statics.rs | 4 +- .../src/rules/promise/no_return_in_finally.rs | 4 +- .../src/rules/promise/param_names.rs | 4 +- .../src/rules/promise/prefer_await_to_then.rs | 4 +- .../src/rules/promise/valid_params.rs | 20 +++---- .../src/rules/react/button_has_type.rs | 8 +-- .../src/rules/react/jsx_boolean_value.rs | 12 ++--- crates/oxc_linter/src/rules/react/jsx_key.rs | 8 +-- .../rules/react/jsx_no_comment_textnodes.rs | 4 +- .../src/rules/react/jsx_no_target_blank.rs | 12 ++--- .../rules/react/jsx_no_useless_fragment.rs | 8 +-- .../src/rules/react/no_children_prop.rs | 4 +- .../oxc_linter/src/rules/react/no_danger.rs | 4 +- .../rules/react/no_direct_mutation_state.rs | 4 +- .../src/rules/react/no_find_dom_node.rs | 4 +- .../src/rules/react/no_is_mounted.rs | 4 +- .../src/rules/react/no_render_return_value.rs | 4 +- .../src/rules/react/no_set_state.rs | 4 +- .../src/rules/react/no_string_refs.rs | 8 +-- .../src/rules/react/no_unescaped_entities.rs | 4 +- .../src/rules/react/no_unknown_property.rs | 16 +++--- .../src/rules/react/prefer_es6_class.rs | 8 +-- .../src/rules/react/react_in_jsx_scope.rs | 4 +- .../src/rules/react/require_render_return.rs | 4 +- .../no_side_effects_in_initialization/mod.rs | 53 +++++++++---------- .../src/rules/typescript/ban_types.rs | 12 ++--- .../typescript/consistent_type_imports.rs | 4 +- .../explicit_function_return_type.rs | 4 +- .../src/rules/typescript/no_dynamic_delete.rs | 4 +- .../rules/typescript/no_empty_interface.rs | 8 +-- .../src/rules/typescript/no_explicit_any.rs | 4 +- .../typescript/no_extra_non_null_assertion.rs | 4 +- .../typescript/no_import_type_side_effects.rs | 4 +- .../src/rules/typescript/no_misused_new.rs | 8 +-- .../src/rules/typescript/no_namespace.rs | 4 +- ...no_non_null_asserted_nullish_coalescing.rs | 4 +- .../rules/typescript/no_non_null_assertion.rs | 4 +- .../src/rules/typescript/no_this_alias.rs | 8 +-- .../typescript/no_useless_empty_export.rs | 4 +- .../src/rules/typescript/no_var_requires.rs | 4 +- .../typescript/no_wrapper_object_types.rs | 4 +- .../src/rules/typescript/prefer_as_const.rs | 4 +- .../src/rules/typescript/prefer_for_of.rs | 4 +- .../typescript/prefer_literal_enum_member.rs | 4 +- .../typescript/prefer_ts_expect_error.rs | 4 +- .../src/rules/unicorn/empty_brace_spaces.rs | 4 +- .../src/rules/unicorn/error_message.rs | 8 +-- .../src/rules/unicorn/escape_case.rs | 4 +- .../rules/unicorn/explicit_length_check.rs | 8 +-- .../src/rules/unicorn/filename_case.rs | 4 +- .../src/rules/unicorn/new_for_builtins.rs | 8 +-- .../unicorn/no_abusive_eslint_disable.rs | 4 +- .../unicorn/no_anonymous_default_export.rs | 4 +- .../src/rules/unicorn/no_array_for_each.rs | 4 +- .../src/rules/unicorn/no_array_reduce.rs | 4 +- .../unicorn/no_await_expression_member.rs | 4 +- .../unicorn/no_await_in_promise_methods.rs | 4 +- .../src/rules/unicorn/no_document_cookie.rs | 4 +- .../src/rules/unicorn/no_empty_file.rs | 4 +- .../src/rules/unicorn/no_hex_escape.rs | 4 +- .../src/rules/unicorn/no_instanceof_array.rs | 4 +- .../unicorn/no_magic_array_flat_depth.rs | 4 +- .../src/rules/unicorn/no_negated_condition.rs | 4 +- .../unicorn/no_negation_in_equality_check.rs | 4 +- .../src/rules/unicorn/no_nested_ternary.rs | 8 +-- .../src/rules/unicorn/no_new_array.rs | 4 +- .../src/rules/unicorn/no_new_buffer.rs | 4 +- .../unicorn/no_object_as_default_parameter.rs | 8 +-- .../src/rules/unicorn/no_process_exit.rs | 4 +- .../src/rules/unicorn/no_static_only_class.rs | 4 +- .../src/rules/unicorn/no_thenable.rs | 12 ++--- .../src/rules/unicorn/no_this_assignment.rs | 4 +- .../src/rules/unicorn/no_typeof_undefined.rs | 4 +- .../src/rules/unicorn/no_unnecessary_await.rs | 4 +- .../no_unreadable_array_destructuring.rs | 4 +- .../src/rules/unicorn/no_unreadable_iife.rs | 4 +- .../rules/unicorn/no_useless_length_check.rs | 8 +-- .../no_useless_promise_resolve_reject.rs | 8 +-- .../rules/unicorn/no_useless_switch_case.rs | 4 +- .../src/rules/unicorn/no_useless_undefined.rs | 4 +- .../src/rules/unicorn/no_zero_fractions.rs | 8 +-- .../src/rules/unicorn/number_literal_case.rs | 16 +++--- .../rules/unicorn/numeric_separators_style.rs | 4 +- .../unicorn/prefer_add_event_listener.rs | 4 +- .../src/rules/unicorn/prefer_array_flat.rs | 4 +- .../rules/unicorn/prefer_array_flat_map.rs | 4 +- .../src/rules/unicorn/prefer_array_some.rs | 8 +-- .../unicorn/prefer_blob_reading_methods.rs | 4 +- .../src/rules/unicorn/prefer_code_point.rs | 4 +- .../src/rules/unicorn/prefer_date_now.rs | 12 ++--- .../rules/unicorn/prefer_dom_node_append.rs | 4 +- .../rules/unicorn/prefer_dom_node_dataset.rs | 16 +++--- .../rules/unicorn/prefer_dom_node_remove.rs | 4 +- .../unicorn/prefer_dom_node_text_content.rs | 4 +- .../src/rules/unicorn/prefer_event_target.rs | 4 +- .../src/rules/unicorn/prefer_includes.rs | 4 +- .../prefer_logical_operator_over_ternary.rs | 4 +- .../src/rules/unicorn/prefer_math_trunc.rs | 5 +- .../rules/unicorn/prefer_modern_math_apis.rs | 12 ++--- .../prefer_native_coercion_functions.rs | 8 +-- .../src/rules/unicorn/prefer_node_protocol.rs | 4 +- .../rules/unicorn/prefer_number_properties.rs | 4 +- .../unicorn/prefer_optional_catch_binding.rs | 4 +- .../rules/unicorn/prefer_prototype_methods.rs | 8 +-- .../src/rules/unicorn/prefer_reflect_apply.rs | 4 +- .../src/rules/unicorn/prefer_regexp_test.rs | 4 +- .../src/rules/unicorn/prefer_set_size.rs | 4 +- .../src/rules/unicorn/prefer_spread.rs | 4 +- .../unicorn/prefer_string_replace_all.rs | 8 +-- .../src/rules/unicorn/prefer_string_slice.rs | 4 +- .../unicorn/prefer_string_starts_ends_with.rs | 8 +-- .../unicorn/prefer_string_trim_start_end.rs | 4 +- .../rules/unicorn/prefer_structured_clone.rs | 4 +- .../src/rules/unicorn/prefer_type_error.rs | 4 +- .../unicorn/require_array_join_separator.rs | 4 +- ...require_number_to_fixed_digits_argument.rs | 4 +- .../src/rules/unicorn/switch_case_braces.rs | 4 +- .../unicorn/text_encoding_identifier_case.rs | 4 +- .../src/rules/unicorn/throw_new_error.rs | 4 +- .../src/rules/vitest/no_conditional_tests.rs | 4 +- .../src/rules/vitest/no_import_node_test.rs | 4 +- ...l_test_context_for_concurrent_snapshots.rs | 4 +- 286 files changed, 781 insertions(+), 792 deletions(-) diff --git a/crates/oxc_linter/src/rules/eslint/default_case.rs b/crates/oxc_linter/src/rules/eslint/default_case.rs index aef39fe4113a7..7cd1034496a8a 100644 --- a/crates/oxc_linter/src/rules/eslint/default_case.rs +++ b/crates/oxc_linter/src/rules/eslint/default_case.rs @@ -6,10 +6,10 @@ use regex::{Regex, RegexBuilder}; use crate::{context::LintContext, rule::Rule, AstNode}; -fn default_case_diagnostic(span0: Span) -> OxcDiagnostic { +fn default_case_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Require default cases in switch statements.") .with_help("Add a default case.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/default_case_last.rs b/crates/oxc_linter/src/rules/eslint/default_case_last.rs index 763717e84c433..99ba8085c28ea 100644 --- a/crates/oxc_linter/src/rules/eslint/default_case_last.rs +++ b/crates/oxc_linter/src/rules/eslint/default_case_last.rs @@ -5,9 +5,9 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn default_case_last_diagnostic(span0: Span) -> OxcDiagnostic { +fn default_case_last_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Enforce default clauses in switch statements to be last") - .with_label(span0.label("Default clause should be the last clause.")) + .with_label(span.label("Default clause should be the last clause.")) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/default_param_last.rs b/crates/oxc_linter/src/rules/eslint/default_param_last.rs index c028121e0e732..367f37fadeb02 100644 --- a/crates/oxc_linter/src/rules/eslint/default_param_last.rs +++ b/crates/oxc_linter/src/rules/eslint/default_param_last.rs @@ -5,10 +5,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn default_param_last_diagnostic(span0: Span) -> OxcDiagnostic { +fn default_param_last_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Default parameters should be last") .with_help("Enforce default parameters to be last.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/getter_return.rs b/crates/oxc_linter/src/rules/eslint/getter_return.rs index 376d19e8645a5..f43398de73095 100644 --- a/crates/oxc_linter/src/rules/eslint/getter_return.rs +++ b/crates/oxc_linter/src/rules/eslint/getter_return.rs @@ -18,10 +18,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn getter_return_diagnostic(span0: Span) -> OxcDiagnostic { +fn getter_return_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Expected to always return a value in getter.") .with_help("Return a value from all code paths in getter.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/guard_for_in.rs b/crates/oxc_linter/src/rules/eslint/guard_for_in.rs index 0a487c4c0d233..63ec9df0f20b1 100644 --- a/crates/oxc_linter/src/rules/eslint/guard_for_in.rs +++ b/crates/oxc_linter/src/rules/eslint/guard_for_in.rs @@ -5,10 +5,10 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; -fn guard_for_in_diagnostic(span0: Span) -> OxcDiagnostic { +fn guard_for_in_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Require `for-in` loops to include an `if` statement") .with_help("The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_array_constructor.rs b/crates/oxc_linter/src/rules/eslint/no_array_constructor.rs index e0e1273286896..3bef19272a852 100644 --- a/crates/oxc_linter/src/rules/eslint/no_array_constructor.rs +++ b/crates/oxc_linter/src/rules/eslint/no_array_constructor.rs @@ -5,10 +5,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_array_constructor_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_array_constructor_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Disallow `Array` constructors") .with_help("Use array literal instead") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_async_promise_executor.rs b/crates/oxc_linter/src/rules/eslint/no_async_promise_executor.rs index 30a3dec0cd353..63d1b8523bb2b 100644 --- a/crates/oxc_linter/src/rules/eslint/no_async_promise_executor.rs +++ b/crates/oxc_linter/src/rules/eslint/no_async_promise_executor.rs @@ -8,8 +8,8 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_async_promise_executor_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Promise executor functions should not be `async`.").with_label(span0) +fn no_async_promise_executor_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Promise executor functions should not be `async`.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs b/crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs index b142dd6ab966b..998562ab85da1 100644 --- a/crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs +++ b/crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs @@ -8,8 +8,8 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_await_in_loop_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Unexpected `await` inside a loop.").with_label(span0) +fn no_await_in_loop_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Unexpected `await` inside a loop.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_caller.rs b/crates/oxc_linter/src/rules/eslint/no_caller.rs index 9b0eb1934eeaf..e19a87ddf131f 100644 --- a/crates/oxc_linter/src/rules/eslint/no_caller.rs +++ b/crates/oxc_linter/src/rules/eslint/no_caller.rs @@ -5,10 +5,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_caller_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_caller_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Disallow the use of arguments.caller or arguments.callee") .with_help("'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_case_declarations.rs b/crates/oxc_linter/src/rules/eslint/no_case_declarations.rs index b2ad9e9792746..6ebd462941ee7 100644 --- a/crates/oxc_linter/src/rules/eslint/no_case_declarations.rs +++ b/crates/oxc_linter/src/rules/eslint/no_case_declarations.rs @@ -8,8 +8,8 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_case_declarations_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Unexpected lexical declaration in case block.").with_label(span0) +fn no_case_declarations_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Unexpected lexical declaration in case block.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_cond_assign.rs b/crates/oxc_linter/src/rules/eslint/no_cond_assign.rs index ea35fa436ad9d..25ea98eaa0610 100644 --- a/crates/oxc_linter/src/rules/eslint/no_cond_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_cond_assign.rs @@ -8,10 +8,10 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_cond_assign_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_cond_assign_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Expected a conditional expression and instead saw an assignment") .with_help("Consider wrapping the assignment in additional parentheses") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_console.rs b/crates/oxc_linter/src/rules/eslint/no_console.rs index c42b64d3eea3f..c8a2ea595cc9d 100644 --- a/crates/oxc_linter/src/rules/eslint/no_console.rs +++ b/crates/oxc_linter/src/rules/eslint/no_console.rs @@ -5,8 +5,8 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_console_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Unexpected console statement.").with_label(span0) +fn no_console_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Unexpected console statement.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs b/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs index 926bd1c703f5f..5a195156b7f37 100644 --- a/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs +++ b/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs @@ -62,16 +62,16 @@ fn constant_binary_operand(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { .with_label(span2) } -fn constant_always_new(span0: Span) -> OxcDiagnostic { +fn constant_always_new(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unexpected comparison to newly constructed object") .with_help("These two values can never be equal") - .with_label(span0) + .with_label(span) } -fn constant_both_always_new(span0: Span) -> OxcDiagnostic { +fn constant_both_always_new(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unexpected comparison of two newly constructed objects") .with_help("These two values can never be equal") - .with_label(span0) + .with_label(span) } impl Rule for NoConstantBinaryExpression { diff --git a/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs b/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs index e31dcac69fd61..551ee2d75d2c9 100644 --- a/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs +++ b/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs @@ -5,10 +5,10 @@ use oxc_span::{GetSpan, Span}; use crate::{ast_util::IsConstant, context::LintContext, rule::Rule, AstNode}; -fn no_constant_condition_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_constant_condition_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unexpected constant condition") .with_help("Constant expression as a test condition is not allowed") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_continue.rs b/crates/oxc_linter/src/rules/eslint/no_continue.rs index 4c41048972703..373565f7664aa 100644 --- a/crates/oxc_linter/src/rules/eslint/no_continue.rs +++ b/crates/oxc_linter/src/rules/eslint/no_continue.rs @@ -5,10 +5,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_continue_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_continue_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unexpected use of `continue` statement.") .with_help("Do not use the `continue` statement.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_debugger.rs b/crates/oxc_linter/src/rules/eslint/no_debugger.rs index d61b7a5f24be2..f06c5d69db92c 100644 --- a/crates/oxc_linter/src/rules/eslint/no_debugger.rs +++ b/crates/oxc_linter/src/rules/eslint/no_debugger.rs @@ -5,8 +5,8 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_debugger_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("`debugger` statement is not allowed").with_label(span0) +fn no_debugger_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("`debugger` statement is not allowed").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_delete_var.rs b/crates/oxc_linter/src/rules/eslint/no_delete_var.rs index cfea7b2696593..84663b838663b 100644 --- a/crates/oxc_linter/src/rules/eslint/no_delete_var.rs +++ b/crates/oxc_linter/src/rules/eslint/no_delete_var.rs @@ -6,8 +6,8 @@ use oxc_syntax::operator::UnaryOperator; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_delete_var_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("variables should not be deleted").with_label(span0) +fn no_delete_var_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("variables should not be deleted").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_div_regex.rs b/crates/oxc_linter/src/rules/eslint/no_div_regex.rs index 1b748962e4306..04b2e2bf6d89b 100644 --- a/crates/oxc_linter/src/rules/eslint/no_div_regex.rs +++ b/crates/oxc_linter/src/rules/eslint/no_div_regex.rs @@ -5,10 +5,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_div_regex_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_div_regex_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("A regular expression literal can be confused with '/='.") .with_help("Rewrite `/=` into `/[=]`") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_empty_character_class.rs b/crates/oxc_linter/src/rules/eslint/no_empty_character_class.rs index a2970e63dde99..738086db046f9 100644 --- a/crates/oxc_linter/src/rules/eslint/no_empty_character_class.rs +++ b/crates/oxc_linter/src/rules/eslint/no_empty_character_class.rs @@ -8,10 +8,10 @@ use regex::Regex; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_empty_character_class_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_empty_character_class_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Empty character class") .with_help("Try to remove empty character class `[]` in regexp literal") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_empty_function.rs b/crates/oxc_linter/src/rules/eslint/no_empty_function.rs index 64635b3379ab9..c22dbf19338a7 100644 --- a/crates/oxc_linter/src/rules/eslint/no_empty_function.rs +++ b/crates/oxc_linter/src/rules/eslint/no_empty_function.rs @@ -5,10 +5,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_empty_function_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_empty_function_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Disallow empty functions") .with_help("Unexpected empty function block") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_empty_static_block.rs b/crates/oxc_linter/src/rules/eslint/no_empty_static_block.rs index 5ead32168cc4f..606de94f98a6b 100644 --- a/crates/oxc_linter/src/rules/eslint/no_empty_static_block.rs +++ b/crates/oxc_linter/src/rules/eslint/no_empty_static_block.rs @@ -5,10 +5,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_empty_static_block_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_empty_static_block_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Disallow empty static blocks") .with_help("Unexpected empty static block.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_eq_null.rs b/crates/oxc_linter/src/rules/eslint/no_eq_null.rs index 1ae2dcf6af64e..76137df5a193a 100644 --- a/crates/oxc_linter/src/rules/eslint/no_eq_null.rs +++ b/crates/oxc_linter/src/rules/eslint/no_eq_null.rs @@ -8,10 +8,10 @@ use oxc_syntax::operator::BinaryOperator; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_eq_null_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_eq_null_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Use '===' to compare with null") .with_help("Disallow `null` comparisons without type-checking operators.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_eval.rs b/crates/oxc_linter/src/rules/eslint/no_eval.rs index 59ab1c7cf8ce2..dbe81ab82ee42 100644 --- a/crates/oxc_linter/src/rules/eslint/no_eval.rs +++ b/crates/oxc_linter/src/rules/eslint/no_eval.rs @@ -7,8 +7,8 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; -fn no_eval_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("eval can be harmful.").with_label(span0) +fn no_eval_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("eval can be harmful.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_ex_assign.rs b/crates/oxc_linter/src/rules/eslint/no_ex_assign.rs index b739708c03908..2b2a2bb641046 100644 --- a/crates/oxc_linter/src/rules/eslint/no_ex_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_ex_assign.rs @@ -5,8 +5,8 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; -fn no_ex_assign_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Do not assign to the exception parameter.").with_help("If a catch clause in a try statement accidentally (or purposely) assigns another value to the exception parameter, it is impossible to refer to the error from that point on. Since there is no arguments object to offer alternative access to this data, assignment of the parameter is absolutely destructive.").with_label(span0) +fn no_ex_assign_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Do not assign to the exception parameter.").with_help("If a catch clause in a try statement accidentally (or purposely) assigns another value to the exception parameter, it is impossible to refer to the error from that point on. Since there is no arguments object to offer alternative access to this data, assignment of the parameter is absolutely destructive.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs b/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs index 559c70de574d0..e3fe72851ecc0 100644 --- a/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs +++ b/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs @@ -7,16 +7,16 @@ use oxc_syntax::operator::{LogicalOperator, UnaryOperator}; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_extra_double_negation_cast_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_extra_double_negation_cast_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Redundant double negation") .with_help("Remove the double negation as it will already be coerced to a boolean") - .with_label(span0) + .with_label(span) } -fn no_extra_boolean_cast_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_extra_boolean_cast_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Redundant Boolean call") .with_help("Remove the Boolean call as it will already be coerced to a boolean") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_import_assign.rs b/crates/oxc_linter/src/rules/eslint/no_import_assign.rs index ee6ba3eef1d04..c9a4d2bb9601b 100644 --- a/crates/oxc_linter/src/rules/eslint/no_import_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_import_assign.rs @@ -8,10 +8,10 @@ use phf::phf_set; use crate::{context::LintContext, rule::Rule}; -fn no_import_assign_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_import_assign_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("do not assign to imported bindings") .with_help("imported bindings are readonly") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_irregular_whitespace.rs b/crates/oxc_linter/src/rules/eslint/no_irregular_whitespace.rs index dd6a433153d29..7a32b33668fd5 100644 --- a/crates/oxc_linter/src/rules/eslint/no_irregular_whitespace.rs +++ b/crates/oxc_linter/src/rules/eslint/no_irregular_whitespace.rs @@ -4,10 +4,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; -fn no_irregular_whitespace_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_irregular_whitespace_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unexpected irregular whitespace") .with_help("Try to remove the irregular whitespace") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_iterator.rs b/crates/oxc_linter/src/rules/eslint/no_iterator.rs index 2aeb515dbaf4a..26a5199591ffe 100644 --- a/crates/oxc_linter/src/rules/eslint/no_iterator.rs +++ b/crates/oxc_linter/src/rules/eslint/no_iterator.rs @@ -5,10 +5,10 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_iterator_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_iterator_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Reserved name '__iterator__'") .with_help("Disallow the use of the `__iterator__` property.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs b/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs index 0291766b45666..3f54df91d0b33 100644 --- a/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs +++ b/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs @@ -7,8 +7,8 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_loss_of_precision_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("This number literal will lose precision at runtime.").with_label(span0) +fn no_loss_of_precision_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("This number literal will lose precision at runtime.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_multi_str.rs b/crates/oxc_linter/src/rules/eslint/no_multi_str.rs index 72710ab2d7fe8..68d8598283eec 100644 --- a/crates/oxc_linter/src/rules/eslint/no_multi_str.rs +++ b/crates/oxc_linter/src/rules/eslint/no_multi_str.rs @@ -6,8 +6,8 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_multi_str_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Unexpected multi string.").with_label(span0) +fn no_multi_str_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Unexpected multi string.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_new.rs b/crates/oxc_linter/src/rules/eslint/no_new.rs index 06b5f8b6a73df..858aae6c2d2c7 100644 --- a/crates/oxc_linter/src/rules/eslint/no_new.rs +++ b/crates/oxc_linter/src/rules/eslint/no_new.rs @@ -5,8 +5,8 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_new_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Do not use 'new' for side effects.").with_label(span0) +fn no_new_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Do not use 'new' for side effects.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_proto.rs b/crates/oxc_linter/src/rules/eslint/no_proto.rs index a29dd0a60e6f6..a9b5cc4bff615 100644 --- a/crates/oxc_linter/src/rules/eslint/no_proto.rs +++ b/crates/oxc_linter/src/rules/eslint/no_proto.rs @@ -5,10 +5,10 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_proto_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_proto_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("The '__proto__' property is deprecated") .with_help("Disallow the use of the `__proto__` property.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_regex_spaces.rs b/crates/oxc_linter/src/rules/eslint/no_regex_spaces.rs index 02aa6833db3a0..8f25eb7e02426 100644 --- a/crates/oxc_linter/src/rules/eslint/no_regex_spaces.rs +++ b/crates/oxc_linter/src/rules/eslint/no_regex_spaces.rs @@ -9,10 +9,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_regex_spaces_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_regex_spaces_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Spaces are hard to count.") .with_help("Use a quantifier, e.g. {2}") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_script_url.rs b/crates/oxc_linter/src/rules/eslint/no_script_url.rs index b1be0ff0108ef..7d68bbfac8d6d 100644 --- a/crates/oxc_linter/src/rules/eslint/no_script_url.rs +++ b/crates/oxc_linter/src/rules/eslint/no_script_url.rs @@ -5,10 +5,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_script_url_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_script_url_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Script URL is a form of eval") .with_help("Disallow `javascript:` urls") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_self_assign.rs b/crates/oxc_linter/src/rules/eslint/no_self_assign.rs index 1e8fb8f4d71a7..c2a857f13023b 100644 --- a/crates/oxc_linter/src/rules/eslint/no_self_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_self_assign.rs @@ -13,8 +13,8 @@ use oxc_syntax::operator::AssignmentOperator; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_self_assign_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("this expression is assigned to itself").with_label(span0) +fn no_self_assign_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("this expression is assigned to itself").with_label(span) } #[derive(Debug, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_setter_return.rs b/crates/oxc_linter/src/rules/eslint/no_setter_return.rs index f6c55176963d5..55973707ad4d0 100644 --- a/crates/oxc_linter/src/rules/eslint/no_setter_return.rs +++ b/crates/oxc_linter/src/rules/eslint/no_setter_return.rs @@ -5,8 +5,8 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_setter_return_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Setter cannot return a value").with_label(span0) +fn no_setter_return_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Setter cannot return a value").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_template_curly_in_string.rs b/crates/oxc_linter/src/rules/eslint/no_template_curly_in_string.rs index 90710fc4c2588..06b85678fc8fa 100644 --- a/crates/oxc_linter/src/rules/eslint/no_template_curly_in_string.rs +++ b/crates/oxc_linter/src/rules/eslint/no_template_curly_in_string.rs @@ -5,10 +5,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_template_curly_in_string_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_template_curly_in_string_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unexpected template string expression") .with_help("Disallow template literal placeholder syntax in regular strings") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_ternary.rs b/crates/oxc_linter/src/rules/eslint/no_ternary.rs index 12b72d8fd8033..f2b724620fc98 100644 --- a/crates/oxc_linter/src/rules/eslint/no_ternary.rs +++ b/crates/oxc_linter/src/rules/eslint/no_ternary.rs @@ -5,10 +5,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_ternary_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_ternary_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unexpected use of ternary expression") .with_help("Do not use the ternary expression.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_this_before_super.rs b/crates/oxc_linter/src/rules/eslint/no_this_before_super.rs index 61e7bd51f6bd6..60851014412f3 100644 --- a/crates/oxc_linter/src/rules/eslint/no_this_before_super.rs +++ b/crates/oxc_linter/src/rules/eslint/no_this_before_super.rs @@ -15,10 +15,10 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_this_before_super_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_this_before_super_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Expected to always call super() before this/super property access.") .with_help("Call super() before this/super property access.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_undefined.rs b/crates/oxc_linter/src/rules/eslint/no_undefined.rs index ea860a512d45d..4422c0c230def 100644 --- a/crates/oxc_linter/src/rules/eslint/no_undefined.rs +++ b/crates/oxc_linter/src/rules/eslint/no_undefined.rs @@ -8,10 +8,10 @@ use crate::{context::LintContext, rule::Rule, AstNode}; #[derive(Debug, Default, Clone)] pub struct NoUndefined; -fn no_undefined_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_undefined_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Disallow the use of `undefined` as an identifier") .with_help("Unexpected use of undefined.") - .with_label(span0) + .with_label(span) } declare_oxc_lint!( @@ -58,9 +58,9 @@ declare_oxc_lint!( restriction, ); -fn diagnostic_undefined_keyword(name: &str, span0: Span, ctx: &LintContext) { +fn diagnostic_undefined_keyword(name: &str, span: Span, ctx: &LintContext) { if name == "undefined" { - ctx.diagnostic(no_undefined_diagnostic(span0)); + ctx.diagnostic(no_undefined_diagnostic(span)); } } diff --git a/crates/oxc_linter/src/rules/eslint/no_unsafe_finally.rs b/crates/oxc_linter/src/rules/eslint/no_unsafe_finally.rs index 5c9dbdea0f7cd..59ff47fba7f7d 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unsafe_finally.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unsafe_finally.rs @@ -8,10 +8,10 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_unsafe_finally_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_unsafe_finally_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unsafe finally block") .with_help("Control flow inside try or catch blocks will be overwritten by this statement") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs b/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs index a393ed72262f5..dcc88d21a44e0 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs @@ -9,16 +9,16 @@ use oxc_syntax::operator::LogicalOperator; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_unsafe_optional_chaining_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_unsafe_optional_chaining_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unsafe usage of optional chaining") .with_help("If this short-circuits with 'undefined' the evaluation will throw TypeError") - .with_label(span0) + .with_label(span) } -fn no_unsafe_arithmetic_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_unsafe_arithmetic_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unsafe arithmetic operation on optional chaining") .with_help("This can result in NaN.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_useless_concat.rs b/crates/oxc_linter/src/rules/eslint/no_useless_concat.rs index 35ea1f75acdae..c9116528bb7dc 100644 --- a/crates/oxc_linter/src/rules/eslint/no_useless_concat.rs +++ b/crates/oxc_linter/src/rules/eslint/no_useless_concat.rs @@ -12,10 +12,10 @@ use crate::{context::LintContext, rule::Rule, AstNode}; #[derive(Debug, Default, Clone)] pub struct NoUselessConcat; -fn no_useless_concat_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_useless_concat_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unexpected string concatenation of literals.") .with_help("Rewrite into one string literal") - .with_label(span0) + .with_label(span) } declare_oxc_lint!( diff --git a/crates/oxc_linter/src/rules/eslint/no_useless_rename.rs b/crates/oxc_linter/src/rules/eslint/no_useless_rename.rs index 9cd391ce54c22..8c6486d296855 100644 --- a/crates/oxc_linter/src/rules/eslint/no_useless_rename.rs +++ b/crates/oxc_linter/src/rules/eslint/no_useless_rename.rs @@ -8,12 +8,12 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_useless_rename_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_useless_rename_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn( "Disallow renaming import, export, and destructured assignments to the same name", ) .with_help("Either remove the renaming or rename the variable.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_var.rs b/crates/oxc_linter/src/rules/eslint/no_var.rs index 2bdfb8aca803c..04a618c42ef48 100644 --- a/crates/oxc_linter/src/rules/eslint/no_var.rs +++ b/crates/oxc_linter/src/rules/eslint/no_var.rs @@ -5,10 +5,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_var_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_var_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unexpected var, use let or const instead.") .with_help("Replace var with let or const") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_void.rs b/crates/oxc_linter/src/rules/eslint/no_void.rs index 931c20891dab7..4ff494d54e66b 100644 --- a/crates/oxc_linter/src/rules/eslint/no_void.rs +++ b/crates/oxc_linter/src/rules/eslint/no_void.rs @@ -6,10 +6,10 @@ use oxc_syntax::operator::UnaryOperator; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_void_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_void_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Disallow `void` operators") .with_help("Expected 'undefined' and instead saw 'void'.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/no_with.rs b/crates/oxc_linter/src/rules/eslint/no_with.rs index bea0e17dabc5f..ad8180ac11b13 100644 --- a/crates/oxc_linter/src/rules/eslint/no_with.rs +++ b/crates/oxc_linter/src/rules/eslint/no_with.rs @@ -5,10 +5,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_with_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_with_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unexpected use of `with` statement.") .with_help("Do not use the `with` statement.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/prefer_exponentiation_operator.rs b/crates/oxc_linter/src/rules/eslint/prefer_exponentiation_operator.rs index bcc7310d9c2c3..667b172978aa0 100644 --- a/crates/oxc_linter/src/rules/eslint/prefer_exponentiation_operator.rs +++ b/crates/oxc_linter/src/rules/eslint/prefer_exponentiation_operator.rs @@ -11,8 +11,8 @@ use crate::{ #[derive(Debug, Default, Clone)] pub struct PreferExponentiationOperator; -fn prefer_exponentian_operator_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Prefer `**` over `Math.pow`.").with_label(span0) +fn prefer_exponentian_operator_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Prefer `**` over `Math.pow`.").with_label(span) } declare_oxc_lint!( diff --git a/crates/oxc_linter/src/rules/eslint/prefer_numeric_literals.rs b/crates/oxc_linter/src/rules/eslint/prefer_numeric_literals.rs index cee21e1618ae8..f38b88543b0dd 100644 --- a/crates/oxc_linter/src/rules/eslint/prefer_numeric_literals.rs +++ b/crates/oxc_linter/src/rules/eslint/prefer_numeric_literals.rs @@ -15,8 +15,8 @@ use crate::{ AstNode, }; -fn prefer_numeric_literals_diagnostic(span0: Span, x0: &str) -> OxcDiagnostic { - OxcDiagnostic::warn(format!("Use {x0} literals instead of parseInt().")).with_label(span0) +fn prefer_numeric_literals_diagnostic(span: Span, x0: &str) -> OxcDiagnostic { + OxcDiagnostic::warn(format!("Use {x0} literals instead of parseInt().")).with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/radix.rs b/crates/oxc_linter/src/rules/eslint/radix.rs index da915d5ee4541..5faa6a44e32ca 100644 --- a/crates/oxc_linter/src/rules/eslint/radix.rs +++ b/crates/oxc_linter/src/rules/eslint/radix.rs @@ -8,21 +8,21 @@ use oxc_span::{GetSpan, Span}; use crate::{context::LintContext, rule::Rule, AstNode}; -fn missing_parameters(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Missing parameters.").with_label(span0) +fn missing_parameters(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Missing parameters.").with_label(span) } -fn missing_radix(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Missing radix parameter.").with_label(span0) +fn missing_radix(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Missing radix parameter.").with_label(span) } -fn redundant_radix(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Redundant radix parameter.").with_label(span0) +fn redundant_radix(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Redundant radix parameter.").with_label(span) } -fn invalid_radix(span0: Span) -> OxcDiagnostic { +fn invalid_radix(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Invalid radix parameter, must be an integer between 2 and 36.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/require_await.rs b/crates/oxc_linter/src/rules/eslint/require_await.rs index 004d492160ebc..e35736f56ab1f 100644 --- a/crates/oxc_linter/src/rules/eslint/require_await.rs +++ b/crates/oxc_linter/src/rules/eslint/require_await.rs @@ -13,8 +13,8 @@ use crate::{context::LintContext, rule::Rule, AstNode}; #[derive(Debug, Default, Clone)] pub struct RequireAwait; -fn require_await_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Async function has no 'await' expression.").with_label(span0) +fn require_await_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Async function has no 'await' expression.").with_label(span) } declare_oxc_lint!( diff --git a/crates/oxc_linter/src/rules/eslint/require_yield.rs b/crates/oxc_linter/src/rules/eslint/require_yield.rs index 2ccfcf36d92bb..393500e18b96f 100644 --- a/crates/oxc_linter/src/rules/eslint/require_yield.rs +++ b/crates/oxc_linter/src/rules/eslint/require_yield.rs @@ -5,8 +5,8 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn require_yield_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("This generator function does not have 'yield'").with_label(span0) +fn require_yield_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("This generator function does not have 'yield'").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/sort_imports.rs b/crates/oxc_linter/src/rules/eslint/sort_imports.rs index e6f83c8c6c082..fb8382434a57f 100644 --- a/crates/oxc_linter/src/rules/eslint/sort_imports.rs +++ b/crates/oxc_linter/src/rules/eslint/sort_imports.rs @@ -23,15 +23,15 @@ fn unexpected_syntax_order_diagnostic( OxcDiagnostic::warn(format!("Expected '{x0}' syntax before '{x1}' syntax.")).with_label(span2) } -fn sort_imports_alphabetically_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Imports should be sorted alphabetically.").with_label(span0) +fn sort_imports_alphabetically_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Imports should be sorted alphabetically.").with_label(span) } -fn sort_members_alphabetically_diagnostic(x0: &str, span0: Span) -> OxcDiagnostic { +fn sort_members_alphabetically_diagnostic(x0: &str, span: Span) -> OxcDiagnostic { OxcDiagnostic::warn(format!( "Member '{x0}' of the import declaration should be sorted alphabetically." )) - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/unicode_bom.rs b/crates/oxc_linter/src/rules/eslint/unicode_bom.rs index a8591fef24750..8f93d4ca671b8 100644 --- a/crates/oxc_linter/src/rules/eslint/unicode_bom.rs +++ b/crates/oxc_linter/src/rules/eslint/unicode_bom.rs @@ -4,16 +4,16 @@ use oxc_span::{Span, SPAN}; use crate::{context::LintContext, rule::Rule}; -fn unexpected_unicode_bom_diagnostic(span0: Span) -> OxcDiagnostic { +fn unexpected_unicode_bom_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unexpected Unicode BOM (Byte Order Mark)") .with_help("File must not begin with the Unicode BOM") - .with_label(span0) + .with_label(span) } -fn expected_unicode_bom_diagnostic(span0: Span) -> OxcDiagnostic { +fn expected_unicode_bom_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Expected Unicode BOM (Byte Order Mark)") .with_help("File must begin with the Unicode BOM") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/eslint/use_isnan.rs b/crates/oxc_linter/src/rules/eslint/use_isnan.rs index 52c4cd4d5b524..f64a6e7300217 100644 --- a/crates/oxc_linter/src/rules/eslint/use_isnan.rs +++ b/crates/oxc_linter/src/rules/eslint/use_isnan.rs @@ -9,24 +9,24 @@ use oxc_syntax::operator::BinaryOperator; use crate::{context::LintContext, rule::Rule, AstNode}; -fn comparison_with_na_n(span0: Span) -> OxcDiagnostic { +fn comparison_with_na_n(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Requires calls to isNaN() when checking for NaN") .with_help("Use the isNaN function to compare with NaN.") - .with_label(span0) + .with_label(span) } -fn switch_na_n(span0: Span) -> OxcDiagnostic { +fn switch_na_n(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Requires calls to isNaN() when checking for NaN") .with_help( "'switch(NaN)' can never match a case clause. Use Number.isNaN instead of the switch.", ) - .with_label(span0) + .with_label(span) } -fn case_na_n(span0: Span) -> OxcDiagnostic { +fn case_na_n(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Requires calls to isNaN() when checking for NaN") .with_help("'case NaN' can never match. Use Number.isNaN before the switch.") - .with_label(span0) + .with_label(span) } fn index_of_na_n(x0: &str, span1: Span) -> OxcDiagnostic { diff --git a/crates/oxc_linter/src/rules/import/export.rs b/crates/oxc_linter/src/rules/import/export.rs index 74abbfcf7feb1..d6e7fa513d988 100644 --- a/crates/oxc_linter/src/rules/import/export.rs +++ b/crates/oxc_linter/src/rules/import/export.rs @@ -8,8 +8,8 @@ use rustc_hash::{FxHashMap, FxHashSet}; use crate::{context::LintContext, rule::Rule}; -fn no_named_export(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warn(format!("No named exports found in module '{x1}'")).with_label(span0) +fn no_named_export(span: Span, x1: &str) -> OxcDiagnostic { + OxcDiagnostic::warn(format!("No named exports found in module '{x1}'")).with_label(span) } /// diff --git a/crates/oxc_linter/src/rules/import/namespace.rs b/crates/oxc_linter/src/rules/import/namespace.rs index af1264baec0db..13d993e1438bd 100644 --- a/crates/oxc_linter/src/rules/import/namespace.rs +++ b/crates/oxc_linter/src/rules/import/namespace.rs @@ -12,24 +12,24 @@ use oxc_syntax::module_record::{ExportExportName, ExportImportName, ImportImport use crate::{context::LintContext, rule::Rule}; -fn no_export(span0: Span, x1: &str, x2: &str) -> OxcDiagnostic { - OxcDiagnostic::warn(format!("{x1:?} not found in imported namespace {x2:?}.")).with_label(span0) +fn no_export(span: Span, x1: &str, x2: &str) -> OxcDiagnostic { + OxcDiagnostic::warn(format!("{x1:?} not found in imported namespace {x2:?}.")).with_label(span) } -fn no_export_in_deeply_imported_namespace(span0: Span, x1: &str, x2: &str) -> OxcDiagnostic { +fn no_export_in_deeply_imported_namespace(span: Span, x1: &str, x2: &str) -> OxcDiagnostic { OxcDiagnostic::warn(format!("{x1:?} not found in deeply imported namespace {x2:?}.")) - .with_label(span0) + .with_label(span) } -fn computed_reference(span0: Span, x1: &str) -> OxcDiagnostic { +fn computed_reference(span: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn(format!( "Unable to validate computed reference to imported namespace {x1:?}." )) - .with_label(span0) + .with_label(span) } -fn assignment(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warn(format!("Assignment to member of namespace {x1:?}.'")).with_label(span0) +fn assignment(span: Span, x1: &str) -> OxcDiagnostic { + OxcDiagnostic::warn(format!("Assignment to member of namespace {x1:?}.'")).with_label(span) } /// diff --git a/crates/oxc_linter/src/rules/import/no_amd.rs b/crates/oxc_linter/src/rules/import/no_amd.rs index 5e48c32aca1c4..18318715c7873 100644 --- a/crates/oxc_linter/src/rules/import/no_amd.rs +++ b/crates/oxc_linter/src/rules/import/no_amd.rs @@ -8,10 +8,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, AstNode}; -fn no_amd_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { +fn no_amd_diagnostic(span: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn("Do not use AMD `require` and `define` calls.") .with_help(format!("Expected imports instead of AMD {x1}()")) - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/import/no_cycle.rs b/crates/oxc_linter/src/rules/import/no_cycle.rs index e215da63103a4..1e47d01f7c348 100644 --- a/crates/oxc_linter/src/rules/import/no_cycle.rs +++ b/crates/oxc_linter/src/rules/import/no_cycle.rs @@ -11,10 +11,10 @@ use oxc_syntax::{ use crate::{context::LintContext, rule::Rule}; -fn no_cycle_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { +fn no_cycle_diagnostic(span: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn("Dependency cycle detected") .with_help(format!("These paths form a cycle: \n{x1}")) - .with_label(span0) + .with_label(span) } /// diff --git a/crates/oxc_linter/src/rules/import/no_default_export.rs b/crates/oxc_linter/src/rules/import/no_default_export.rs index 55b2d2d0a281c..d98d6b694d188 100644 --- a/crates/oxc_linter/src/rules/import/no_default_export.rs +++ b/crates/oxc_linter/src/rules/import/no_default_export.rs @@ -4,8 +4,8 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; -fn no_default_export_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Prefer named exports").with_label(span0) +fn no_default_export_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Prefer named exports").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/import/no_named_as_default.rs b/crates/oxc_linter/src/rules/import/no_named_as_default.rs index 0689dbb09bd6e..97e5071114879 100644 --- a/crates/oxc_linter/src/rules/import/no_named_as_default.rs +++ b/crates/oxc_linter/src/rules/import/no_named_as_default.rs @@ -5,10 +5,10 @@ use oxc_syntax::module_record::ImportImportName; use crate::{context::LintContext, rule::Rule}; -fn no_named_as_default_diagnostic(span0: Span, x1: &str, x2: &str) -> OxcDiagnostic { +fn no_named_as_default_diagnostic(span: Span, x1: &str, x2: &str) -> OxcDiagnostic { OxcDiagnostic::warn(format!("Module {x2:?} has named export {x1:?}")) .with_help(format!("Using default import as {x1:?} can be confusing. Use another name for default import to avoid confusion.")) - .with_label(span0) + .with_label(span) } /// diff --git a/crates/oxc_linter/src/rules/import/no_named_as_default_member.rs b/crates/oxc_linter/src/rules/import/no_named_as_default_member.rs index 73c48c2c8a4a1..6f8f3a1485544 100644 --- a/crates/oxc_linter/src/rules/import/no_named_as_default_member.rs +++ b/crates/oxc_linter/src/rules/import/no_named_as_default_member.rs @@ -11,15 +11,10 @@ use rustc_hash::FxHashMap; use crate::{context::LintContext, rule::Rule}; -fn no_named_as_default_member_dignostic( - span0: Span, - x1: &str, - x2: &str, - x3: &str, -) -> OxcDiagnostic { +fn no_named_as_default_member_dignostic(span: Span, x1: &str, x2: &str, x3: &str) -> OxcDiagnostic { OxcDiagnostic::warn(format!("{x1:?} also has a named export {x2:?}")) .with_help(format!("Check if you meant to write `import {{{x2:}}} from {x3:?}`")) - .with_label(span0) + .with_label(span) } /// diff --git a/crates/oxc_linter/src/rules/import/no_self_import.rs b/crates/oxc_linter/src/rules/import/no_self_import.rs index 31b39c82e6a24..a58ce5bd3c25c 100644 --- a/crates/oxc_linter/src/rules/import/no_self_import.rs +++ b/crates/oxc_linter/src/rules/import/no_self_import.rs @@ -4,8 +4,8 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; -fn no_self_import_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("module importing itself is not allowed").with_label(span0) +fn no_self_import_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("module importing itself is not allowed").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/import/no_unused_modules.rs b/crates/oxc_linter/src/rules/import/no_unused_modules.rs index 0a61957f5105f..679ec96d6d5d4 100644 --- a/crates/oxc_linter/src/rules/import/no_unused_modules.rs +++ b/crates/oxc_linter/src/rules/import/no_unused_modules.rs @@ -3,9 +3,9 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; -fn no_exports_found(span0: Span) -> OxcDiagnostic { +fn no_exports_found(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("No exports found") - .with_label(span0) + .with_label(span) } /// diff --git a/crates/oxc_linter/src/rules/import/no_webpack_loader_syntax.rs b/crates/oxc_linter/src/rules/import/no_webpack_loader_syntax.rs index ca5e60f73c8eb..eb5036836830a 100644 --- a/crates/oxc_linter/src/rules/import/no_webpack_loader_syntax.rs +++ b/crates/oxc_linter/src/rules/import/no_webpack_loader_syntax.rs @@ -9,10 +9,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; -fn no_named_as_default_diagnostic(x0: &str, span0: Span) -> OxcDiagnostic { +fn no_named_as_default_diagnostic(x0: &str, span: Span) -> OxcDiagnostic { OxcDiagnostic::warn(format!("Unexpected `!` in `{x0}`.")) .with_help("Do not use import syntax to configure webpack loaders") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/consistent_test_it.rs b/crates/oxc_linter/src/rules/jest/consistent_test_it.rs index e97a3581dc1d6..2c5bfe0ad1290 100644 --- a/crates/oxc_linter/src/rules/jest/consistent_test_it.rs +++ b/crates/oxc_linter/src/rules/jest/consistent_test_it.rs @@ -16,16 +16,16 @@ use crate::{ }, }; -fn consistent_method(x1: &str, x2: &str, span0: Span) -> OxcDiagnostic { +fn consistent_method(x1: &str, x2: &str, span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Enforce `test` and `it` usage conventions") .with_help(format!("Prefer using {x1:?} instead of {x2:?}")) - .with_label(span0) + .with_label(span) } -fn consistent_method_within_describe(x1: &str, x2: &str, span0: Span) -> OxcDiagnostic { +fn consistent_method_within_describe(x1: &str, x2: &str, span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Enforce `test` and `it` usage conventions") .with_help(format!("Prefer using {x1:?} instead of {x2:?} within describe")) - .with_label(span0) + .with_label(span) } #[derive(Debug, Clone, Copy, Eq, PartialEq)] diff --git a/crates/oxc_linter/src/rules/jest/expect_expect.rs b/crates/oxc_linter/src/rules/jest/expect_expect.rs index 2f58e4af0f290..204671136a544 100644 --- a/crates/oxc_linter/src/rules/jest/expect_expect.rs +++ b/crates/oxc_linter/src/rules/jest/expect_expect.rs @@ -18,10 +18,10 @@ use crate::{ }, }; -fn expect_expect_diagnostic(span0: Span) -> OxcDiagnostic { +fn expect_expect_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Test has no assertions") .with_help("Add assertion(s) in this Test") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/max_nested_describe.rs b/crates/oxc_linter/src/rules/jest/max_nested_describe.rs index 562a3d28f137d..c31b80d5dae2c 100644 --- a/crates/oxc_linter/src/rules/jest/max_nested_describe.rs +++ b/crates/oxc_linter/src/rules/jest/max_nested_describe.rs @@ -13,10 +13,10 @@ use crate::{ }, }; -fn exceeded_max_depth(current: usize, max: usize, span0: Span) -> OxcDiagnostic { +fn exceeded_max_depth(current: usize, max: usize, span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Enforces a maximum depth to nested describe calls.") .with_help(format!("Too many nested describe calls ({current}) - maximum allowed is {max}")) - .with_label(span0) + .with_label(span) } #[derive(Debug, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_commented_out_tests.rs b/crates/oxc_linter/src/rules/jest/no_commented_out_tests.rs index 90c495c6f46c4..d4552c1ea7dee 100644 --- a/crates/oxc_linter/src/rules/jest/no_commented_out_tests.rs +++ b/crates/oxc_linter/src/rules/jest/no_commented_out_tests.rs @@ -6,10 +6,10 @@ use regex::Regex; use crate::{context::LintContext, rule::Rule}; -fn no_commented_out_tests_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_commented_out_tests_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Some tests seem to be commented") .with_help("Remove or uncomment this comment") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs b/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs index e6e028b883569..683e0e4c64502 100644 --- a/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs +++ b/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs @@ -14,10 +14,10 @@ use crate::{ }, }; -fn no_conditional_expect_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_conditional_expect_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unexpected conditional expect") .with_help("Avoid calling `expect` conditionally`") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_conditional_in_test.rs b/crates/oxc_linter/src/rules/jest/no_conditional_in_test.rs index 36cc76ad0b0f1..190d10a8446af 100644 --- a/crates/oxc_linter/src/rules/jest/no_conditional_in_test.rs +++ b/crates/oxc_linter/src/rules/jest/no_conditional_in_test.rs @@ -9,10 +9,10 @@ use crate::{ utils::{is_type_of_jest_fn_call, JestFnKind, PossibleJestNode}, }; -fn no_conditional_in_test(span0: Span) -> OxcDiagnostic { +fn no_conditional_in_test(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Disallow conditional logic in tests") .with_help("Avoid having conditionals in tests.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs b/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs index bf7bd492b44ff..aceb677825778 100644 --- a/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs +++ b/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs @@ -12,19 +12,19 @@ use crate::{ utils::{collect_possible_jest_call_node, parse_jest_fn_call, PossibleJestNode}, }; -fn no_global_set_timeout_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("`jest.setTimeout` should be call in `global` scope").with_label(span0) +fn no_global_set_timeout_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("`jest.setTimeout` should be call in `global` scope").with_label(span) } -fn no_multiple_set_timeouts_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_multiple_set_timeouts_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Do not call `jest.setTimeout` multiple times") .with_help("Only the last call to `jest.setTimeout` will have an effect.") - .with_label(span0) + .with_label(span) } -fn no_unorder_set_timeout_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_unorder_set_timeout_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("`jest.setTimeout` should be placed before any other jest methods") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_done_callback.rs b/crates/oxc_linter/src/rules/jest/no_done_callback.rs index 727ccac000aeb..ae2638bdad941 100644 --- a/crates/oxc_linter/src/rules/jest/no_done_callback.rs +++ b/crates/oxc_linter/src/rules/jest/no_done_callback.rs @@ -15,16 +15,16 @@ use crate::{ }, }; -fn no_done_callback(span0: Span) -> OxcDiagnostic { +fn no_done_callback(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Function parameter(s) use the `done` argument") .with_help("Return a Promise instead of relying on callback parameter") - .with_label(span0) + .with_label(span) } -fn use_await_instead_of_callback(span0: Span) -> OxcDiagnostic { +fn use_await_instead_of_callback(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Function parameter(s) use the `done` argument") .with_help("Use await instead of callback in async functions") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs b/crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs index 64a3084033049..cfe3f612f1c58 100644 --- a/crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs +++ b/crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs @@ -15,10 +15,10 @@ use crate::{ }, }; -fn no_duplicate_hooks_diagnostic(x0: &str, span0: Span) -> OxcDiagnostic { +fn no_duplicate_hooks_diagnostic(x0: &str, span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Disallow duplicate setup and teardown hooks.") .with_help(format!("Duplicate {x0:?} in describe block.")) - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_export.rs b/crates/oxc_linter/src/rules/jest/no_export.rs index d65b306389c62..0b01e0f8d37cf 100644 --- a/crates/oxc_linter/src/rules/jest/no_export.rs +++ b/crates/oxc_linter/src/rules/jest/no_export.rs @@ -4,10 +4,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule, utils::is_jest_file}; -fn no_export_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_export_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Do not export from a test file.") .with_help("If you want to share code between tests, move it into a separate file and import it from there.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_focused_tests.rs b/crates/oxc_linter/src/rules/jest/no_focused_tests.rs index ab25383aae116..a64a26125a9a1 100644 --- a/crates/oxc_linter/src/rules/jest/no_focused_tests.rs +++ b/crates/oxc_linter/src/rules/jest/no_focused_tests.rs @@ -12,10 +12,10 @@ use crate::{ }, }; -fn no_focused_tests_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_focused_tests_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Unexpected focused test.") .with_help("Remove focus from test.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_hooks.rs b/crates/oxc_linter/src/rules/jest/no_hooks.rs index 177494cc2dac8..29462e8819e36 100644 --- a/crates/oxc_linter/src/rules/jest/no_hooks.rs +++ b/crates/oxc_linter/src/rules/jest/no_hooks.rs @@ -12,8 +12,8 @@ use crate::{ }, }; -fn unexpected_hook_diagonsitc(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Disallow setup and teardown hooks.").with_label(span0) +fn unexpected_hook_diagonsitc(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Disallow setup and teardown hooks.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_identical_title.rs b/crates/oxc_linter/src/rules/jest/no_identical_title.rs index 600a2f45cc39f..06bcc9d94bcb5 100644 --- a/crates/oxc_linter/src/rules/jest/no_identical_title.rs +++ b/crates/oxc_linter/src/rules/jest/no_identical_title.rs @@ -19,16 +19,16 @@ use crate::{ AstNode, }; -fn describe_repeat(span0: Span) -> OxcDiagnostic { +fn describe_repeat(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Describe block title is used multiple times in the same describe block.") .with_help("Change the title of describe block.") - .with_label(span0) + .with_label(span) } -fn test_repeat(span0: Span) -> OxcDiagnostic { +fn test_repeat(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Test title is used multiple times in the same describe block.") .with_help("Change the title of test.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_interpolation_in_snapshots.rs b/crates/oxc_linter/src/rules/jest/no_interpolation_in_snapshots.rs index 8acf1d1d6d258..ead35f6b53575 100644 --- a/crates/oxc_linter/src/rules/jest/no_interpolation_in_snapshots.rs +++ b/crates/oxc_linter/src/rules/jest/no_interpolation_in_snapshots.rs @@ -9,10 +9,10 @@ use crate::{ utils::{collect_possible_jest_call_node, parse_expect_jest_fn_call, PossibleJestNode}, }; -fn no_interpolation_in_snapshots_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_interpolation_in_snapshots_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Do not use string interpolation inside of snapshots") .with_help("Remove string interpolation from snapshots") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_large_snapshots.rs b/crates/oxc_linter/src/rules/jest/no_large_snapshots.rs index 3d117e1863f3d..673ec42628b8c 100644 --- a/crates/oxc_linter/src/rules/jest/no_large_snapshots.rs +++ b/crates/oxc_linter/src/rules/jest/no_large_snapshots.rs @@ -16,18 +16,18 @@ use crate::{ utils::{collect_possible_jest_call_node, parse_expect_jest_fn_call, PossibleJestNode}, }; -fn no_snapshot(x0: usize, span0: Span) -> OxcDiagnostic { +fn no_snapshot(x0: usize, span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Disallow large snapshots.") .with_help(format!("`{x0:?}`s should begin with lowercase")) - .with_label(span0) + .with_label(span) } -fn too_long_snapshots(x0: usize, x1: usize, span0: Span) -> OxcDiagnostic { +fn too_long_snapshots(x0: usize, x1: usize, span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Disallow large snapshots.") .with_help(format!( "Expected Jest snapshot to be smaller than {x0:?} lines but was {x1:?} lines long" )) - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_mocks_import.rs b/crates/oxc_linter/src/rules/jest/no_mocks_import.rs index 3acd4fdb5147d..f0889e641700f 100644 --- a/crates/oxc_linter/src/rules/jest/no_mocks_import.rs +++ b/crates/oxc_linter/src/rules/jest/no_mocks_import.rs @@ -7,10 +7,10 @@ use oxc_span::Span; use crate::{context::LintContext, rule::Rule}; -fn no_mocks_import_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_mocks_import_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Mocks should not be manually imported from a `__mocks__` directory.") .with_help("Instead use `jest.mock` and import from the original module path.") - .with_label(span0) + .with_label(span) } /// diff --git a/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs b/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs index 800ca9c847e84..99634ba8068cd 100644 --- a/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs +++ b/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs @@ -17,10 +17,10 @@ use crate::{ AstNode, }; -fn no_standalone_expect_diagnostic(span0: Span) -> OxcDiagnostic { +fn no_standalone_expect_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Expect must be inside of a test block.") .with_help("Did you forget to wrap `expect` in a `test` or `it` block?") - .with_label(span0) + .with_label(span) } /// diff --git a/crates/oxc_linter/src/rules/jest/no_test_return_statement.rs b/crates/oxc_linter/src/rules/jest/no_test_return_statement.rs index b9ea8f912b683..13a803bbf23b4 100644 --- a/crates/oxc_linter/src/rules/jest/no_test_return_statement.rs +++ b/crates/oxc_linter/src/rules/jest/no_test_return_statement.rs @@ -14,8 +14,8 @@ use crate::{ utils::{is_type_of_jest_fn_call, JestFnKind, JestGeneralFnKind, PossibleJestNode}, }; -fn no_test_return_statement_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Jest tests should not return a value").with_label(span0) +fn no_test_return_statement_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Jest tests should not return a value").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_called_with.rs b/crates/oxc_linter/src/rules/jest/prefer_called_with.rs index 047c7f07ac779..2937d97f26079 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_called_with.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_called_with.rs @@ -9,16 +9,16 @@ use crate::{ utils::{collect_possible_jest_call_node, parse_expect_jest_fn_call, PossibleJestNode}, }; -fn use_to_be_called_with(span0: Span) -> OxcDiagnostic { +fn use_to_be_called_with(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Suggest using `toBeCalledWith()` or `toHaveBeenCalledWith()`.") .with_help("Prefer toBeCalledWith(/* expected args */)") - .with_label(span0) + .with_label(span) } -fn use_have_been_called_with(span0: Span) -> OxcDiagnostic { +fn use_have_been_called_with(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Suggest using `toBeCalledWith()` or `toHaveBeenCalledWith()`.") .with_help("Prefer toHaveBeenCalledWith(/* expected args */)") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_equality_matcher.rs b/crates/oxc_linter/src/rules/jest/prefer_equality_matcher.rs index 6f16fcb67c3df..02dfc8ca624ed 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_equality_matcher.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_equality_matcher.rs @@ -13,10 +13,10 @@ use crate::{ utils::{collect_possible_jest_call_node, parse_expect_jest_fn_call, PossibleJestNode}, }; -fn use_equality_matcher_diagnostic(span0: Span) -> OxcDiagnostic { +fn use_equality_matcher_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Suggest using the built-in equality matchers.") .with_help("Prefer using one of the equality matchers instead") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_expect_resolves.rs b/crates/oxc_linter/src/rules/jest/prefer_expect_resolves.rs index 1296f81976ba5..5a72f528e9119 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_expect_resolves.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_expect_resolves.rs @@ -16,10 +16,10 @@ use crate::{ }, }; -fn expect_resolves(span0: Span) -> OxcDiagnostic { +fn expect_resolves(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Prefer `await expect(...).resolves` over `expect(await ...)` syntax.") .with_help("Use `await expect(...).resolves` instead") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_hooks_in_order.rs b/crates/oxc_linter/src/rules/jest/prefer_hooks_in_order.rs index 28001b8f72945..9de0e4c6d6e47 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_hooks_in_order.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_hooks_in_order.rs @@ -13,10 +13,10 @@ use crate::{ }, }; -fn reorder_hooks(x1: &str, x2: &str, span0: Span) -> OxcDiagnostic { +fn reorder_hooks(x1: &str, x2: &str, span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Prefer having hooks in a consistent order.") .with_help(format!("{x1:?} hooks should be before any {x2:?} hooks")) - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_hooks_on_top.rs b/crates/oxc_linter/src/rules/jest/prefer_hooks_on_top.rs index c2bd385264ff7..b236687d27ea6 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_hooks_on_top.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_hooks_on_top.rs @@ -15,10 +15,10 @@ use crate::{ }, }; -fn no_hook_on_top(span0: Span) -> OxcDiagnostic { +fn no_hook_on_top(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Suggest having hooks before any test cases.") .with_help("Hooks should come before test cases") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_jest_mocked.rs b/crates/oxc_linter/src/rules/jest/prefer_jest_mocked.rs index 2c69be0de12b2..019d287d51485 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_jest_mocked.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_jest_mocked.rs @@ -9,10 +9,10 @@ use phf::{phf_set, Set}; use crate::{context::LintContext, rule::Rule, AstNode}; -fn use_jest_mocked(span0: Span) -> OxcDiagnostic { +fn use_jest_mocked(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Prefer `jest.mocked()` over `fn as jest.Mock`.") .with_help("Prefer `jest.mocked()`") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_spy_on.rs b/crates/oxc_linter/src/rules/jest/prefer_spy_on.rs index 2f206a92088c8..eb0b2aeaa2b66 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_spy_on.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_spy_on.rs @@ -17,10 +17,10 @@ use crate::{ utils::{get_node_name, parse_general_jest_fn_call, PossibleJestNode}, }; -fn use_jest_spy_on(span0: Span) -> OxcDiagnostic { +fn use_jest_spy_on(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Suggest using `jest.spyOn()`.") .with_help("Use jest.spyOn() instead") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_strict_equal.rs b/crates/oxc_linter/src/rules/jest/prefer_strict_equal.rs index 0aef34e3d858a..24008dbf4a869 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_strict_equal.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_strict_equal.rs @@ -9,10 +9,10 @@ use crate::{ utils::{collect_possible_jest_call_node, parse_expect_jest_fn_call, PossibleJestNode}, }; -fn use_to_strict_equal(span0: Span) -> OxcDiagnostic { +fn use_to_strict_equal(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Suggest using `toStrictEqual()`.") .with_help("Use `toStrictEqual()` instead") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_to_be.rs b/crates/oxc_linter/src/rules/jest/prefer_to_be.rs index 6ab21b0c223f3..f6b17f31a9a82 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_to_be.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_to_be.rs @@ -15,24 +15,24 @@ use crate::{ }, }; -fn use_to_be(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Use `toBe` when expecting primitive literals.").with_label(span0) +fn use_to_be(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Use `toBe` when expecting primitive literals.").with_label(span) } -fn use_to_be_undefined(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Use `toBeUndefined` instead.").with_label(span0) +fn use_to_be_undefined(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Use `toBeUndefined` instead.").with_label(span) } -fn use_to_be_defined(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Use `toBeDefined` instead.").with_label(span0) +fn use_to_be_defined(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Use `toBeDefined` instead.").with_label(span) } -fn use_to_be_null(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Use `toBeNull` instead.").with_label(span0) +fn use_to_be_null(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Use `toBeNull` instead.").with_label(span) } -fn use_to_be_na_n(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Use `toBeNaN` instead.").with_label(span0) +fn use_to_be_na_n(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Use `toBeNaN` instead.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_to_contain.rs b/crates/oxc_linter/src/rules/jest/prefer_to_contain.rs index df42a03768692..f6df08bb02ef1 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_to_contain.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_to_contain.rs @@ -15,8 +15,8 @@ use crate::{ }, }; -fn use_to_contain(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Suggest using `toContain()`.").with_label(span0) +fn use_to_contain(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Suggest using `toContain()`.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_to_have_length.rs b/crates/oxc_linter/src/rules/jest/prefer_to_have_length.rs index 896c1d2941899..02b96210be2b0 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_to_have_length.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_to_have_length.rs @@ -16,8 +16,8 @@ use crate::{ }, }; -fn use_to_have_length(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Suggest using `toHaveLength()`.").with_label(span0) +fn use_to_have_length(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Suggest using `toHaveLength()`.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_todo.rs b/crates/oxc_linter/src/rules/jest/prefer_todo.rs index 6534d5b7559bc..655593e6a5853 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_todo.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_todo.rs @@ -16,12 +16,12 @@ use crate::{ }, }; -fn empty_test(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Suggest using `test.todo`.").with_label(span0) +fn empty_test(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Suggest using `test.todo`.").with_label(span) } -fn un_implemented_test_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("Suggest using `test.todo`.").with_label(span0) +fn un_implemented_test_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Suggest using `test.todo`.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/require_hook.rs b/crates/oxc_linter/src/rules/jest/require_hook.rs index ed60cdc09f760..0cdd6827fd5dd 100644 --- a/crates/oxc_linter/src/rules/jest/require_hook.rs +++ b/crates/oxc_linter/src/rules/jest/require_hook.rs @@ -17,10 +17,10 @@ use crate::{ }, }; -fn use_hook(span0: Span) -> OxcDiagnostic { +fn use_hook(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Require setup and teardown code to be within a hook.") .with_help("This should be done within a hook") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/require_top_level_describe.rs b/crates/oxc_linter/src/rules/jest/require_top_level_describe.rs index 432baf458d3b2..d3a1be13ea367 100644 --- a/crates/oxc_linter/src/rules/jest/require_top_level_describe.rs +++ b/crates/oxc_linter/src/rules/jest/require_top_level_describe.rs @@ -15,24 +15,24 @@ use crate::{ }, }; -fn too_many_describes(max: usize, repeat: &str, span0: Span) -> OxcDiagnostic { +fn too_many_describes(max: usize, repeat: &str, span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Require test cases and hooks to be inside a `describe` block") .with_help(format!( "There should not be more than {max:?} describe{repeat} at the top level." )) - .with_label(span0) + .with_label(span) } -fn unexpected_test_case(span0: Span) -> OxcDiagnostic { +fn unexpected_test_case(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Require test cases and hooks to be inside a `describe` block") .with_help("All test cases must be wrapped in a describe block.") - .with_label(span0) + .with_label(span) } -fn unexpected_hook(span0: Span) -> OxcDiagnostic { +fn unexpected_hook(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Require test cases and hooks to be inside a `describe` block") .with_help("All hooks must be wrapped in a describe block.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/check_access.rs b/crates/oxc_linter/src/rules/jsdoc/check_access.rs index 1a14edcc905ec..07ec0c0d9b785 100644 --- a/crates/oxc_linter/src/rules/jsdoc/check_access.rs +++ b/crates/oxc_linter/src/rules/jsdoc/check_access.rs @@ -6,18 +6,18 @@ use rustc_hash::FxHashSet; use crate::{context::LintContext, rule::Rule, utils::should_ignore_as_internal}; -fn invalid_access_level(span0: Span) -> OxcDiagnostic { +fn invalid_access_level(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Invalid access level is specified or missing.") .with_help("Valid access levels are `package`, `private`, `protected`, and `public`.") - .with_label(span0) + .with_label(span) } -fn redundant_access_tags(span0: Span) -> OxcDiagnostic { +fn redundant_access_tags(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn( "Mixing of @access with @public, @private, @protected, or @package on the same doc block.", ) .with_help("There should be only one instance of access tag in a JSDoc comment.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/check_property_names.rs b/crates/oxc_linter/src/rules/jsdoc/check_property_names.rs index 213677736d7ea..07e08ee78417e 100644 --- a/crates/oxc_linter/src/rules/jsdoc/check_property_names.rs +++ b/crates/oxc_linter/src/rules/jsdoc/check_property_names.rs @@ -9,10 +9,10 @@ use crate::{ utils::{should_ignore_as_internal, should_ignore_as_private}, }; -fn no_root(span0: Span, x1: &str) -> OxcDiagnostic { +fn no_root(span: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn("No root defined for @property path.") .with_help(format!("@property path declaration `{x1}` appears before any real property.")) - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs b/crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs index 1ed81c578a220..42e1865f359a3 100644 --- a/crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs +++ b/crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs @@ -10,8 +10,8 @@ use crate::{ utils::{should_ignore_as_internal, should_ignore_as_private}, }; -fn check_tag_names_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warn("Invalid tag name found.").with_help(x1.to_string()).with_label(span0) +fn check_tag_names_diagnostic(span: Span, x1: &str) -> OxcDiagnostic { + OxcDiagnostic::warn("Invalid tag name found.").with_help(x1.to_string()).with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/empty_tags.rs b/crates/oxc_linter/src/rules/jsdoc/empty_tags.rs index c1143fd745947..374820a5bdf2f 100644 --- a/crates/oxc_linter/src/rules/jsdoc/empty_tags.rs +++ b/crates/oxc_linter/src/rules/jsdoc/empty_tags.rs @@ -6,10 +6,10 @@ use serde::Deserialize; use crate::{context::LintContext, rule::Rule, utils::should_ignore_as_private}; -fn empty_tags_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { +fn empty_tags_diagnostic(span: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn("Expects the void tags to be empty of any content.") .with_help(format!("`@{x1}` tag should not have body.")) - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs b/crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs index 5e63e8df51bc4..0083b9a394685 100644 --- a/crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs +++ b/crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs @@ -11,10 +11,10 @@ use crate::{ AstNode, }; -fn implements_on_classes_diagnostic(span0: Span) -> OxcDiagnostic { +fn implements_on_classes_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("`@implements` used on a non-constructor function") .with_help("Add `@class` tag or use ES6 class syntax.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/no_defaults.rs b/crates/oxc_linter/src/rules/jsdoc/no_defaults.rs index 9293b148b482c..885cccfbd4bf6 100644 --- a/crates/oxc_linter/src/rules/jsdoc/no_defaults.rs +++ b/crates/oxc_linter/src/rules/jsdoc/no_defaults.rs @@ -11,8 +11,8 @@ use crate::{ AstNode, }; -fn no_defaults_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warn("Defaults are not permitted.").with_help(x1.to_string()).with_label(span0) +fn no_defaults_diagnostic(span: Span, x1: &str) -> OxcDiagnostic { + OxcDiagnostic::warn("Defaults are not permitted.").with_help(x1.to_string()).with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/require_param_description.rs b/crates/oxc_linter/src/rules/jsdoc/require_param_description.rs index bea361d4103ea..85f43fb4d32ca 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_param_description.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_param_description.rs @@ -13,10 +13,10 @@ use crate::{ AstNode, }; -fn missing_type_diagnostic(span0: Span) -> OxcDiagnostic { +fn missing_type_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing JSDoc `@param` description.") .with_help("Add description to `@param` tag.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/require_param_name.rs b/crates/oxc_linter/src/rules/jsdoc/require_param_name.rs index 08715ec4cc7b6..e4a3116fa7f27 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_param_name.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_param_name.rs @@ -10,10 +10,10 @@ use crate::{ AstNode, }; -fn missing_name_diagnostic(span0: Span) -> OxcDiagnostic { +fn missing_name_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing JSDoc `@param` name.") .with_help("Add name to `@param` tag.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/require_param_type.rs b/crates/oxc_linter/src/rules/jsdoc/require_param_type.rs index 8a2760095a290..67804881b0398 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_param_type.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_param_type.rs @@ -13,10 +13,10 @@ use crate::{ AstNode, }; -fn missing_type_diagnostic(span0: Span) -> OxcDiagnostic { +fn missing_type_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing JSDoc `@param` type.") .with_help("Add {type} to `@param` tag.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/require_property_description.rs b/crates/oxc_linter/src/rules/jsdoc/require_property_description.rs index ca5e8174c346b..2c0987d662eb9 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_property_description.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_property_description.rs @@ -8,10 +8,10 @@ use crate::{ utils::{should_ignore_as_internal, should_ignore_as_private}, }; -fn require_property_description_diagnostic(span0: Span) -> OxcDiagnostic { +fn require_property_description_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing description in @property tag.") .with_help("Add a description to this @property tag.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/require_property_name.rs b/crates/oxc_linter/src/rules/jsdoc/require_property_name.rs index d538f3df71f5b..ac18791d79906 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_property_name.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_property_name.rs @@ -8,10 +8,10 @@ use crate::{ utils::{should_ignore_as_internal, should_ignore_as_private}, }; -fn require_property_name_diagnostic(span0: Span) -> OxcDiagnostic { +fn require_property_name_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing name in @property tag.") .with_help("Add a type name to this @property tag.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/require_property_type.rs b/crates/oxc_linter/src/rules/jsdoc/require_property_type.rs index 29d2846378ee8..9715cb8b1e62b 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_property_type.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_property_type.rs @@ -8,10 +8,10 @@ use crate::{ utils::{should_ignore_as_internal, should_ignore_as_private}, }; -fn require_property_type_diagnostic(span0: Span) -> OxcDiagnostic { +fn require_property_type_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing type in @property tag.") .with_help("Add a {type} to this @property tag.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/require_returns.rs b/crates/oxc_linter/src/rules/jsdoc/require_returns.rs index 562791dd5c9f1..ec47f26547c77 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_returns.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_returns.rs @@ -19,15 +19,15 @@ use crate::{ }, }; -fn missing_returns_diagnostic(span0: Span) -> OxcDiagnostic { +fn missing_returns_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing JSDoc `@returns` declaration for function.") .with_help("Add `@returns` tag to the JSDoc comment.") - .with_label(span0) + .with_label(span) } -fn duplicate_returns_diagnostic(span0: Span) -> OxcDiagnostic { +fn duplicate_returns_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Duplicate `@returns` tags.") .with_help("Remove redundunt `@returns` tag.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs b/crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs index 99f892611b397..6a498f5f2459f 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs @@ -10,10 +10,10 @@ use crate::{ AstNode, }; -fn missing_description_diagnostic(span0: Span) -> OxcDiagnostic { +fn missing_description_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing JSDoc `@returns` description.") .with_help("Add description comment to `@returns` tag.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/require_returns_type.rs b/crates/oxc_linter/src/rules/jsdoc/require_returns_type.rs index 1db7885357a71..f78c9a5cfce28 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_returns_type.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_returns_type.rs @@ -10,10 +10,10 @@ use crate::{ AstNode, }; -fn missing_type_diagnostic(span0: Span) -> OxcDiagnostic { +fn missing_type_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing JSDoc `@returns` type.") .with_help("Add {type} to `@returns` tag.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/require_yields.rs b/crates/oxc_linter/src/rules/jsdoc/require_yields.rs index f842e3889f176..f99187ccb8b3e 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_yields.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_yields.rs @@ -16,22 +16,22 @@ use crate::{ AstNode, }; -fn missing_yields(span0: Span) -> OxcDiagnostic { +fn missing_yields(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing JSDoc `@yields` declaration for generator function.") .with_help("Add `@yields` tag to the JSDoc comment.") - .with_label(span0) + .with_label(span) } -fn duplicate_yields(span0: Span) -> OxcDiagnostic { +fn duplicate_yields(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Duplicate `@yields` tags.") .with_help("Remove redundunt `@yields` tag.") - .with_label(span0) + .with_label(span) } -fn missing_yields_with_generator(span0: Span) -> OxcDiagnostic { +fn missing_yields_with_generator(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("`@yields` tag is required when using `@generator` tag.") .with_help("Add `@yields` tag to the JSDoc comment.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs b/crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs index 984609e9cfac4..38a16fe2e37cc 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs @@ -16,54 +16,54 @@ use crate::{ AstNode, }; -fn missing_alt_prop(span0: Span) -> OxcDiagnostic { +fn missing_alt_prop(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing `alt` attribute.") .with_help("Must have `alt` prop, either with meaningful text, or an empty string for decorative images.") - .with_label(span0) + .with_label(span) } -fn missing_alt_value(span0: Span) -> OxcDiagnostic { +fn missing_alt_value(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Invalid `alt` value.") .with_help( "Must have meaningful value for `alt` prop. Use alt=\"\" for presentational images.", ) - .with_label(span0) + .with_label(span) } -fn aria_label_value(span0: Span) -> OxcDiagnostic { +fn aria_label_value(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing value for `aria-label` attribute.") .with_help("Give `aria-label` a meaningful value. Prever the `alt` attribute over `aria-label` for images.") - .with_label(span0) + .with_label(span) } -fn aria_labelled_by_value(span0: Span) -> OxcDiagnostic { +fn aria_labelled_by_value(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing value for `aria-labelledby` attribute.") .with_help("Give `aria-labelledby` an ID to a label element. Prefer the `alt` attribute over `aria-labelledby` for images.") - .with_label(span0) + .with_label(span) } -fn prefer_alt(span0: Span) -> OxcDiagnostic { +fn prefer_alt(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("ARIA used where native HTML could suffice.") .with_help("Prefer alt=\"\" over presentational role. Native HTML attributes should be preferred for accessibility before resorting to ARIA attributes.") - .with_label(span0) + .with_label(span) } -fn object(span0: Span) -> OxcDiagnostic { +fn object(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing alternative text.") .with_help("Embedded elements must have a text alternative through the `alt`, `aria-label`, or `aria-labelledby` prop.") - .with_label(span0) + .with_label(span) } -fn area(span0: Span) -> OxcDiagnostic { +fn area(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing alternative text.") .with_help("Each area of an image map must have a text alternative through the `alt`, `aria-label`, or `aria-labelledby` prop.") - .with_label(span0) + .with_label(span) } -fn input_type_image(span0: Span) -> OxcDiagnostic { +fn input_type_image(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing alternative text.") .with_help(" elements with type=\"image\" must have a text alternative through the `alt`, `aria-label`, or `aria-labelledby` prop.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/anchor_has_content.rs b/crates/oxc_linter/src/rules/jsx_a11y/anchor_has_content.rs index c65d6340af9a9..6fccf7209559b 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/anchor_has_content.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/anchor_has_content.rs @@ -17,10 +17,10 @@ use crate::{ AstNode, }; -fn missing_content(span0: Span) -> OxcDiagnostic { +fn missing_content(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing accessible content when using `a` elements.") .with_help("Provide screen reader accessible content when using `a` elements.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs b/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs index a5ff81774b385..27747423f170b 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs @@ -16,22 +16,22 @@ use crate::{ AstNode, }; -fn missing_href_attribute(span0: Span) -> OxcDiagnostic { +fn missing_href_attribute(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing `href` attribute for the `a` element.") .with_help("Provide an href for the `a` element.") - .with_label(span0) + .with_label(span) } -fn incorrect_href(span0: Span) -> OxcDiagnostic { +fn incorrect_href(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Use an incorrect href for the 'a' element.") .with_help("Provide a correct href for the `a` element.") - .with_label(span0) + .with_label(span) } -fn cant_be_anchor(span0: Span) -> OxcDiagnostic { +fn cant_be_anchor(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn(" The a element has `href` and `onClick`.") .with_help("Use a `button` element instead of an `a` element.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs b/crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs index 1cdc0145707cb..9b7f38415a670 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs @@ -14,10 +14,10 @@ use crate::{ AstNode, }; -fn aria_role_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { +fn aria_role_diagnostic(span: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn("Elements with ARIA roles must use a valid, non-abstract ARIA role.") .with_help(format!("Set a valid, non-abstract ARIA role for element with ARIA{x1}")) - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs b/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs index 5e7f846e7430c..435779293ac47 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs @@ -37,10 +37,10 @@ declare_oxc_lint! { #[derive(Debug, Default, Clone)] pub struct AriaUnsupportedElements; -fn aria_unsupported_elements_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { +fn aria_unsupported_elements_diagnostic(span: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn("This element does not support ARIA roles, states and properties.") .with_help(format!("Try removing the prop `{x1}`.")) - .with_label(span0) + .with_label(span) } impl Rule for AriaUnsupportedElements { diff --git a/crates/oxc_linter/src/rules/jsx_a11y/click_events_have_key_events.rs b/crates/oxc_linter/src/rules/jsx_a11y/click_events_have_key_events.rs index e7b605bdc8772..36026d22aae62 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/click_events_have_key_events.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/click_events_have_key_events.rs @@ -14,10 +14,10 @@ use crate::{ AstNode, }; -fn click_events_have_key_events_diagnostic(span0: Span) -> OxcDiagnostic { +fn click_events_have_key_events_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Enforce a clickable non-interactive element has at least one keyboard event listener.") .with_help("Visible, non-interactive elements with click handlers must have one of keyup, keydown, or keypress listener.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/heading_has_content.rs b/crates/oxc_linter/src/rules/jsx_a11y/heading_has_content.rs index ba1ac9c040c23..dbf221c82afba 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/heading_has_content.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/heading_has_content.rs @@ -10,12 +10,12 @@ use crate::{ AstNode, }; -fn heading_has_content_diagnostic(span0: Span) -> OxcDiagnostic { +fn heading_has_content_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn( "Headings must have content and the content must be accessible by a screen reader.", ) .with_help("Provide screen reader accessible content when using heading elements.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs b/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs index c6aa85567f9e5..fb936b0830f82 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs @@ -13,16 +13,16 @@ use crate::{ AstNode, }; -fn missing_lang_prop(span0: Span) -> OxcDiagnostic { +fn missing_lang_prop(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing lang attribute.") .with_help("Add a lang attribute to the html element whose value represents the primary language of document.") - .with_label(span0) + .with_label(span) } -fn missing_lang_value(span0: Span) -> OxcDiagnostic { +fn missing_lang_value(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing value for lang attribute") .with_help("Must have meaningful value for `lang` prop.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs b/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs index 3564d49898bb1..f4cf98b97656d 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs @@ -13,10 +13,10 @@ use crate::{ AstNode, }; -fn iframe_has_title_diagnostic(span0: Span) -> OxcDiagnostic { +fn iframe_has_title_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing `title` attribute for the `iframe` element.") .with_help("Provide title property for iframe element.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/img_redundant_alt.rs b/crates/oxc_linter/src/rules/jsx_a11y/img_redundant_alt.rs index 680ca2491ee17..02fdcaf616eb9 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/img_redundant_alt.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/img_redundant_alt.rs @@ -17,9 +17,9 @@ use crate::{ AstNode, }; -fn img_redundant_alt_diagnostic(span0: Span) -> OxcDiagnostic { +fn img_redundant_alt_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Redundant alt attribute.") - .with_help("Provide no redundant alt text for image. Screen-readers already announce `img` tags as an image. You don’t need to use the words `image`, `photo,` or `picture` (or any specified custom words) in the alt prop.").with_label(span0) + .with_help("Provide no redundant alt text for image. Screen-readers already announce `img` tags as an image. You don’t need to use the words `image`, `photo,` or `picture` (or any specified custom words) in the alt prop.").with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/lang.rs b/crates/oxc_linter/src/rules/jsx_a11y/lang.rs index 4c894be11e8bd..a4351d10778a4 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/lang.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/lang.rs @@ -14,10 +14,10 @@ use crate::{ AstNode, }; -fn lang_diagnostic(span0: Span) -> OxcDiagnostic { +fn lang_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Lang attribute must have a valid value.") .with_help("Set a valid value for lang attribute.") - .with_label(span0) + .with_label(span) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/media_has_caption.rs b/crates/oxc_linter/src/rules/jsx_a11y/media_has_caption.rs index 621580d09d299..5e926be943469 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/media_has_caption.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/media_has_caption.rs @@ -11,10 +11,10 @@ use serde_json::Value; use crate::{context::LintContext, rule::Rule, utils::get_element_type, AstNode}; -fn media_has_caption_diagnostic(span0: Span) -> OxcDiagnostic { +fn media_has_caption_diagnostic(span: Span) -> OxcDiagnostic { OxcDiagnostic::warn("Missing element with captions inside