diff --git a/crates/oxc_linter/src/rules/import/default.rs b/crates/oxc_linter/src/rules/import/default.rs index 6ce5da7f06b55..8256b68f1c143 100644 --- a/crates/oxc_linter/src/rules/import/default.rs +++ b/crates/oxc_linter/src/rules/import/default.rs @@ -10,7 +10,7 @@ fn default_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { "eslint-plugin-import(default): No default export found in imported module {x0:?}" )) .with_help(format!("does {x0:?} have the default export?")) - .with_labels([span1.into()]) + .with_label(span1) } /// diff --git a/crates/oxc_linter/src/rules/import/export.rs b/crates/oxc_linter/src/rules/import/export.rs index c8b3f9865f051..08b5191fa82b1 100644 --- a/crates/oxc_linter/src/rules/import/export.rs +++ b/crates/oxc_linter/src/rules/import/export.rs @@ -12,7 +12,7 @@ fn no_named_export(span0: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn(format!( "eslint-plugin-import(export): No named exports found in module '{x1}'" )) - .with_labels([span0.into()]) + .with_label(span0) } /// diff --git a/crates/oxc_linter/src/rules/import/named.rs b/crates/oxc_linter/src/rules/import/named.rs index 5211e5376b5df..927434ece8564 100644 --- a/crates/oxc_linter/src/rules/import/named.rs +++ b/crates/oxc_linter/src/rules/import/named.rs @@ -8,7 +8,7 @@ use crate::{context::LintContext, rule::Rule}; fn named_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { OxcDiagnostic::warn(format!("eslint-plugin-import(named): named import {x0:?} not found")) .with_help(format!("does {x1:?} have the export {x0:?}?")) - .with_labels([span2.into()]) + .with_label(span2) } /// diff --git a/crates/oxc_linter/src/rules/import/namespace.rs b/crates/oxc_linter/src/rules/import/namespace.rs index 8479677bdc7ec..ae0aae6a270ed 100644 --- a/crates/oxc_linter/src/rules/import/namespace.rs +++ b/crates/oxc_linter/src/rules/import/namespace.rs @@ -16,25 +16,25 @@ fn no_export(span0: Span, x1: &str, x2: &str) -> OxcDiagnostic { OxcDiagnostic::warn(format!( "eslint-plugin-import(namespace): {x1:?} not found in imported namespace {x2:?}." )) - .with_labels([span0.into()]) + .with_label(span0) } fn no_export_in_deeply_imported_namespace(span0: Span, x1: &str, x2: &str) -> OxcDiagnostic { OxcDiagnostic::warn(format!( "eslint-plugin-import(namespace): {x1:?} not found in deeply imported namespace {x2:?}." )) - .with_labels([span0.into()]) + .with_label(span0) } fn computed_reference(span0: Span, x1: &str) -> OxcDiagnostic { - OxcDiagnostic::warn(format!("eslint-plugin-import(namespace): Unable to validate computed reference to imported namespace {x1:?}.")).with_labels([span0.into()]) + OxcDiagnostic::warn(format!("eslint-plugin-import(namespace): Unable to validate computed reference to imported namespace {x1:?}.")).with_label(span0) } fn assignment(span0: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn(format!( "eslint-plugin-import(namespace): Assignment to member of namespace {x1:?}.'" )) - .with_labels([span0.into()]) + .with_label(span0) } /// diff --git a/crates/oxc_linter/src/rules/import/no_amd.rs b/crates/oxc_linter/src/rules/import/no_amd.rs index a12f953abc46b..c35c1751ebb94 100644 --- a/crates/oxc_linter/src/rules/import/no_amd.rs +++ b/crates/oxc_linter/src/rules/import/no_amd.rs @@ -13,7 +13,7 @@ fn no_amd_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { "eslint-plugin-import(no-amd): Do not use AMD `require` and `define` calls.", ) .with_help(format!("Expected imports instead of AMD {x1}()")) - .with_labels([span0.into()]) + .with_label(span0) } #[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 9237d32843b30..aa4e279766483 100644 --- a/crates/oxc_linter/src/rules/import/no_cycle.rs +++ b/crates/oxc_linter/src/rules/import/no_cycle.rs @@ -14,7 +14,7 @@ use crate::{context::LintContext, rule::Rule}; fn no_cycle_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-import(no-cycle): Dependency cycle detected") .with_help(format!("These paths form a cycle: \n{x1}")) - .with_labels([span0.into()]) + .with_label(span0) } /// 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 e6c01d046cb84..1afa56e1f08f5 100644 --- a/crates/oxc_linter/src/rules/import/no_default_export.rs +++ b/crates/oxc_linter/src/rules/import/no_default_export.rs @@ -6,7 +6,7 @@ use crate::{context::LintContext, rule::Rule}; fn no_default_export_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-import(no-default-export): Prefer named exports") - .with_labels([span0.into()]) + .with_label(span0) } #[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 f790efd4d62e1..9c538560bc87b 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 @@ -8,7 +8,7 @@ use crate::{context::LintContext, rule::Rule}; fn no_named_as_default_diagnostic(span0: Span, x1: &str, x2: &str) -> OxcDiagnostic { OxcDiagnostic::warn(format!("eslint-plugin-import(no-named-as-default): 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_labels([span0.into()]) + .with_label(span0) } /// 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 d12f3f3391517..0228c42a52a24 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 @@ -24,7 +24,7 @@ fn no_named_as_default_member_dignostic( "eslint-plugin-import(no-named-as-default-member): {x1:?} also has a named export {x2:?}" )) .with_help(format!("Check if you meant to write `import {{{x2:}}} from {x3:?}`")) - .with_labels([span0.into()]) + .with_label(span0) } /// 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 361ea1908cce3..2d03808546632 100644 --- a/crates/oxc_linter/src/rules/import/no_self_import.rs +++ b/crates/oxc_linter/src/rules/import/no_self_import.rs @@ -8,7 +8,7 @@ fn no_self_import_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn( "eslint-plugin-import(no-self-import): module importing itself is not allowed", ) - .with_labels([span0.into()]) + .with_label(span0) } #[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 5fa5f11d14f0c..ac820001759e1 100644 --- a/crates/oxc_linter/src/rules/import/no_unused_modules.rs +++ b/crates/oxc_linter/src/rules/import/no_unused_modules.rs @@ -5,7 +5,7 @@ use crate::{context::LintContext, rule::Rule}; fn no_exports_found(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-import(no-unused-modules): No exports found") - .with_labels([span0.into()]) + .with_label(span0) } /// diff --git a/crates/oxc_linter/src/rules/jest/expect_expect.rs b/crates/oxc_linter/src/rules/jest/expect_expect.rs index bb1ca3e4e7855..afd59c3e7b68a 100644 --- a/crates/oxc_linter/src/rules/jest/expect_expect.rs +++ b/crates/oxc_linter/src/rules/jest/expect_expect.rs @@ -21,7 +21,7 @@ use crate::{ fn expect_expect_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(expect-expect): Test has no assertions") .with_help("Add assertion(s) in this Test") - .with_labels([span0.into()]) + .with_label(span0) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/max_expects.rs b/crates/oxc_linter/src/rules/jest/max_expects.rs index 175e6c7b71900..a25640df59ba7 100644 --- a/crates/oxc_linter/src/rules/jest/max_expects.rs +++ b/crates/oxc_linter/src/rules/jest/max_expects.rs @@ -13,7 +13,7 @@ use crate::{ fn exceeded_max_assertion(x0: usize, x1: usize, span2: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(max-expects): Enforces a maximum number assertion calls in a test body.") .with_help(format!("Too many assertion calls ({x0:?}) - maximum allowed is {x1:?}")) - .with_labels([span2.into()]) + .with_label(span2) } #[derive(Debug, 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 a007704067e11..0682e8fdfc85e 100644 --- a/crates/oxc_linter/src/rules/jest/max_nested_describe.rs +++ b/crates/oxc_linter/src/rules/jest/max_nested_describe.rs @@ -18,7 +18,7 @@ fn exceeded_max_depth(current: usize, max: usize, span0: Span) -> OxcDiagnostic "eslint-plugin-jest(max-nested-describe): Enforces a maximum depth to nested describe calls.", ) .with_help(format!("Too many nested describe calls ({current}) - maximum allowed is {max}")) - .with_labels([span0.into()]) + .with_label(span0) } #[derive(Debug, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_alias_methods.rs b/crates/oxc_linter/src/rules/jest/no_alias_methods.rs index 72a74aa4fc9a9..672752b15d0e6 100644 --- a/crates/oxc_linter/src/rules/jest/no_alias_methods.rs +++ b/crates/oxc_linter/src/rules/jest/no_alias_methods.rs @@ -12,7 +12,7 @@ use crate::{ fn no_alias_methods_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { OxcDiagnostic::warn(format!("eslint-plugin-jest(no-alias-methods): Unexpected alias {x0:?}")) .with_help(format!("Replace {x0:?} with its canonical name of {x1:?}")) - .with_labels([span2.into()]) + .with_label(span2) } #[derive(Debug, Default, 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 5eb0b51f3cbf3..febcf9a055c9d 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 @@ -11,7 +11,7 @@ fn no_commented_out_tests_diagnostic(span0: Span) -> OxcDiagnostic { "eslint-plugin-jest(no-commented-out-tests): Some tests seem to be commented", ) .with_help("Remove or uncomment this comment") - .with_labels([span0.into()]) + .with_label(span0) } #[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 cd7bc2e6414a6..2ea0db2b92737 100644 --- a/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs +++ b/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs @@ -17,7 +17,7 @@ use crate::{ fn no_conditional_expect_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(no-conditional-expect): Unexpected conditional expect") .with_help("Avoid calling `expect` conditionally`") - .with_labels([span0.into()]) + .with_label(span0) } #[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 615369c51edea..af0941d7dbb1d 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 @@ -15,19 +15,19 @@ use crate::{ fn no_global_set_timeout_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(no-confusing-set-timeout)") .with_help("`jest.setTimeout` should be call in `global` scope") - .with_labels([span0.into()]) + .with_label(span0) } fn no_multiple_set_timeouts_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(no-confusing-set-timeout)") .with_help("Do not call `jest.setTimeout` multiple times, as only the last call will have an effect") - .with_labels([span0.into()]) + .with_label(span0) } fn no_unorder_set_timeout_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(no-confusing-set-timeout)") .with_help("`jest.setTimeout` should be placed before any other jest methods") - .with_labels([span0.into()]) + .with_label(span0) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_deprecated_functions.rs b/crates/oxc_linter/src/rules/jest/no_deprecated_functions.rs index 8cd773bf482a0..a93596fa4ea83 100644 --- a/crates/oxc_linter/src/rules/jest/no_deprecated_functions.rs +++ b/crates/oxc_linter/src/rules/jest/no_deprecated_functions.rs @@ -13,7 +13,7 @@ fn deprecated_function(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { "eslint-plugin-jest(no-deprecated-functions): Disallow use of deprecated functions", ) .with_help(format!("{x0:?} has been deprecated in favor of {x1:?}")) - .with_labels([span2.into()]) + .with_label(span2) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_disabled_tests.rs b/crates/oxc_linter/src/rules/jest/no_disabled_tests.rs index 0ae05ca4addaa..d7dd3b49b44f3 100644 --- a/crates/oxc_linter/src/rules/jest/no_disabled_tests.rs +++ b/crates/oxc_linter/src/rules/jest/no_disabled_tests.rs @@ -66,7 +66,7 @@ declare_oxc_lint!( fn no_disabled_tests_diagnostic(x0: &str, x1: &str, x2: &str, span3: Span) -> OxcDiagnostic { OxcDiagnostic::warn(format!("{x0}(no-disabled-tests): {x1:?}")) .with_help(format!("{x2:?}")) - .with_labels([span3.into()]) + .with_label(span3) } enum Message { 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 a735f11ce8ffb..b8ea6e1d40a65 100644 --- a/crates/oxc_linter/src/rules/jest/no_done_callback.rs +++ b/crates/oxc_linter/src/rules/jest/no_done_callback.rs @@ -20,7 +20,7 @@ fn no_done_callback(span0: Span) -> OxcDiagnostic { "eslint-plugin-jest(no-done-callback): Function parameter(s) use the `done` argument", ) .with_help("Return a Promise instead of relying on callback parameter") - .with_labels([span0.into()]) + .with_label(span0) } fn use_await_instead_of_callback(span0: Span) -> OxcDiagnostic { @@ -28,7 +28,7 @@ fn use_await_instead_of_callback(span0: Span) -> OxcDiagnostic { "eslint-plugin-jest(no-done-callback): Function parameter(s) use the `done` argument", ) .with_help("Use await instead of callback in async functions") - .with_labels([span0.into()]) + .with_label(span0) } #[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 0177f9424d752..73dd9de3d3290 100644 --- a/crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs +++ b/crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs @@ -20,7 +20,7 @@ fn no_duplicate_hooks_diagnostic(x0: &str, span0: Span) -> OxcDiagnostic { "eslint-plugin-jest(no-duplicate-hooks): Disallow duplicate setup and teardown hooks.", ) .with_help(format!("Duplicate {x0:?} in describe block.")) - .with_labels([span0.into()]) + .with_label(span0) } #[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 7496efbed2d0f..3a8f1738dfd36 100644 --- a/crates/oxc_linter/src/rules/jest/no_export.rs +++ b/crates/oxc_linter/src/rules/jest/no_export.rs @@ -7,7 +7,7 @@ use crate::{context::LintContext, rule::Rule, utils::is_jest_file}; fn no_export_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(no-export): 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_labels([span0.into()]) + .with_label(span0) } #[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 386e887f1e0b1..a5ab63dae3bc0 100644 --- a/crates/oxc_linter/src/rules/jest/no_focused_tests.rs +++ b/crates/oxc_linter/src/rules/jest/no_focused_tests.rs @@ -15,7 +15,7 @@ use crate::{ fn no_focused_tests_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(no-focused-tests): Unexpected focused test.") .with_help("Remove focus from test.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 820d3060e1432..ba0cb0f218860 100644 --- a/crates/oxc_linter/src/rules/jest/no_hooks.rs +++ b/crates/oxc_linter/src/rules/jest/no_hooks.rs @@ -14,7 +14,7 @@ use crate::{ fn unexpected_hook_diagonsitc(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(no-hooks): Disallow setup and teardown hooks.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 4a8d0d4783ba8..e6c29ff34d4d8 100644 --- a/crates/oxc_linter/src/rules/jest/no_identical_title.rs +++ b/crates/oxc_linter/src/rules/jest/no_identical_title.rs @@ -22,11 +22,11 @@ use crate::{ fn describe_repeat(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(no-identical-title): Describe block title is used multiple times in the same describe block.") .with_help("Change the title of describe block.") - .with_labels([span0.into()]) + .with_label(span0) } fn test_repeat(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("eslint-plugin-jest(no-identical-title): Test title is used multiple times in the same describe block.").with_help("Change the title of test.").with_labels([span0.into()]) + OxcDiagnostic::warn("eslint-plugin-jest(no-identical-title): Test title is used multiple times in the same describe block.").with_help("Change the title of test.").with_label(span0) } #[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 36e835cd37289..b435932a4dc1d 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 @@ -12,7 +12,7 @@ use crate::{ fn no_interpolation_in_snapshots_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(no-interpolation-in-snapshots): Do not use string interpolation inside of snapshots") .with_help("Remove string interpolation from snapshots") - .with_labels([span0.into()]) + .with_label(span0) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_jasmine_globals.rs b/crates/oxc_linter/src/rules/jest/no_jasmine_globals.rs index f6f70d603398e..3ed3ff259c053 100644 --- a/crates/oxc_linter/src/rules/jest/no_jasmine_globals.rs +++ b/crates/oxc_linter/src/rules/jest/no_jasmine_globals.rs @@ -13,7 +13,7 @@ use crate::{context::LintContext, rule::Rule}; fn no_jasmine_globals_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { OxcDiagnostic::warn(format!("eslint-plugin-jest(no-jasmine-globals): {x0:?}")) .with_help(format!("{x1:?}")) - .with_labels([span2.into()]) + .with_label(span2) } /// 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 738500a4d7292..1855bf5d33059 100644 --- a/crates/oxc_linter/src/rules/jest/no_large_snapshots.rs +++ b/crates/oxc_linter/src/rules/jest/no_large_snapshots.rs @@ -19,7 +19,7 @@ use crate::{ fn no_snapshot(x0: usize, span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(no-large-snapshots): Disallow large snapshots.") .with_help(format!("`{x0:?}`s should begin with lowercase")) - .with_labels([span0.into()]) + .with_label(span0) } fn too_long_snapshots(x0: usize, x1: usize, span0: Span) -> OxcDiagnostic { @@ -27,7 +27,7 @@ fn too_long_snapshots(x0: usize, x1: usize, span0: Span) -> OxcDiagnostic { .with_help(format!( "Expected Jest snapshot to be smaller than {x0:?} lines but was {x1:?} lines long" )) - .with_labels([span0.into()]) + .with_label(span0) } #[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 06a61949adb68..ecdbc2a2bba02 100644 --- a/crates/oxc_linter/src/rules/jest/no_mocks_import.rs +++ b/crates/oxc_linter/src/rules/jest/no_mocks_import.rs @@ -10,7 +10,7 @@ use crate::{context::LintContext, rule::Rule}; fn no_mocks_import_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(no-mocks-import): Mocks should not be manually imported from a `__mocks__` directory.") .with_help("Instead use `jest.mock` and import from the original module path.") - .with_labels([span0.into()]) + .with_label(span0) } /// diff --git a/crates/oxc_linter/src/rules/jest/no_restricted_jest_methods.rs b/crates/oxc_linter/src/rules/jest/no_restricted_jest_methods.rs index 66d641c0b3b62..c61d22aa3530d 100644 --- a/crates/oxc_linter/src/rules/jest/no_restricted_jest_methods.rs +++ b/crates/oxc_linter/src/rules/jest/no_restricted_jest_methods.rs @@ -18,7 +18,7 @@ fn restricted_jest_method(x0: &str, span1: Span) -> OxcDiagnostic { "eslint-plugin-jest(no-restricted-jest-methods): Disallow specific `jest.` methods", ) .with_help(format!("Use of `{x0:?}` is disallowed")) - .with_labels([span1.into()]) + .with_label(span1) } fn restricted_jest_method_with_message(x0: &str, span1: Span) -> OxcDiagnostic { @@ -26,7 +26,7 @@ fn restricted_jest_method_with_message(x0: &str, span1: Span) -> OxcDiagnostic { "eslint-plugin-jest(no-restricted-jest-methods): Disallow specific `jest.` methods", ) .with_help(format!("{x0:?}")) - .with_labels([span1.into()]) + .with_label(span1) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_restricted_matchers.rs b/crates/oxc_linter/src/rules/jest/no_restricted_matchers.rs index a701f3f491520..54bdd54a84d8f 100644 --- a/crates/oxc_linter/src/rules/jest/no_restricted_matchers.rs +++ b/crates/oxc_linter/src/rules/jest/no_restricted_matchers.rs @@ -21,7 +21,7 @@ fn restricted_chain(x0: &str, span1: Span) -> OxcDiagnostic { "eslint-plugin-jest(no-restricted-matchers): Disallow specific matchers & modifiers", ) .with_help(format!("Use of `{x0:?}` is disallowed`")) - .with_labels([span1.into()]) + .with_label(span1) } fn restricted_chain_with_message(x0: &str, span1: Span) -> OxcDiagnostic { @@ -29,7 +29,7 @@ fn restricted_chain_with_message(x0: &str, span1: Span) -> OxcDiagnostic { "eslint-plugin-jest(no-restricted-matchers): Disallow specific matchers & modifiers", ) .with_help(format!("{x0:?}")) - .with_labels([span1.into()]) + .with_label(span1) } #[derive(Debug, Default, Clone)] 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 1e2cbc9c790be..9496968e9a945 100644 --- a/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs +++ b/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs @@ -22,7 +22,7 @@ fn no_standalone_expect_diagnostic(span0: Span) -> OxcDiagnostic { "eslint-plugin-jest(no-standalone-expect): Expect must be inside of a test block.", ) .with_help("Did you forget to wrap `expect` in a `test` or `it` block?") - .with_labels([span0.into()]) + .with_label(span0) } /// diff --git a/crates/oxc_linter/src/rules/jest/no_test_prefixes.rs b/crates/oxc_linter/src/rules/jest/no_test_prefixes.rs index ae38cc3027bf5..ea101026f6bbe 100644 --- a/crates/oxc_linter/src/rules/jest/no_test_prefixes.rs +++ b/crates/oxc_linter/src/rules/jest/no_test_prefixes.rs @@ -14,7 +14,7 @@ use crate::{ fn no_test_prefixes_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { OxcDiagnostic::warn(format!("eslint-plugin-jest(no-test-prefixes): Use {x0:?} instead.")) - .with_labels([span1.into()]) + .with_label(span1) } #[derive(Debug, Default, Clone)] 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 ed552caed1ffb..faae4823a0f61 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 @@ -18,7 +18,7 @@ fn no_test_return_statement_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn( "eslint-plugin-jest(no-test-return-statement): Jest tests should not return a value", ) - .with_labels([span0.into()]) + .with_label(span0) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/no_untyped_mock_factory.rs b/crates/oxc_linter/src/rules/jest/no_untyped_mock_factory.rs index ef22cf67d22a1..e8b5031157f0a 100644 --- a/crates/oxc_linter/src/rules/jest/no_untyped_mock_factory.rs +++ b/crates/oxc_linter/src/rules/jest/no_untyped_mock_factory.rs @@ -15,7 +15,7 @@ use crate::{ fn add_type_parameter_to_module_mock_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(no-untyped-mock-factory): Disallow using `jest.mock()` factories without an explicit type parameter.") .with_help(format!("Add a type parameter to the mock factory such as `typeof import({x0:?})`")) - .with_labels([span1.into()]) + .with_label(span1) } #[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 832a197b158e5..33497460cb9ca 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_called_with.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_called_with.rs @@ -12,13 +12,13 @@ use crate::{ fn use_to_be_called_with(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-called-with): Suggest using `toBeCalledWith()` or `toHaveBeenCalledWith()`.") .with_help("Prefer toBeCalledWith(/* expected args */)") - .with_labels([span0.into()]) + .with_label(span0) } fn use_have_been_called_with(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-called-with): Suggest using `toBeCalledWith()` or `toHaveBeenCalledWith()`.") .with_help("Prefer toHaveBeenCalledWith(/* expected args */)") - .with_labels([span0.into()]) + .with_label(span0) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_comparison_matcher.rs b/crates/oxc_linter/src/rules/jest/prefer_comparison_matcher.rs index f7befeac7684e..39483dd14c762 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_comparison_matcher.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_comparison_matcher.rs @@ -20,7 +20,7 @@ use crate::{ fn use_to_be_comparison(x0: &str, span1: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-comparison-matcher): Suggest using the built-in comparison matchers") .with_help(format!("Prefer using `{x0:?}` instead")) - .with_labels([span1.into()]) + .with_label(span1) } #[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 4469d5148a983..8da97aceba290 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_equality_matcher.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_equality_matcher.rs @@ -16,7 +16,7 @@ use crate::{ fn use_equality_matcher_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-equality-matcher): Suggest using the built-in equality matchers.") .with_help("Prefer using one of the equality matchers instead") - .with_labels([span0.into()]) + .with_label(span0) } #[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 d36ddb567447f..65e89905a53fd 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_expect_resolves.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_expect_resolves.rs @@ -19,7 +19,7 @@ use crate::{ fn expect_resolves(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-expect-resolves): Prefer `await expect(...).resolves` over `expect(await ...)` syntax.") .with_help("Use `await expect(...).resolves` instead") - .with_labels([span0.into()]) + .with_label(span0) } #[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 bf7a8e9ce5c88..e395935d7bd46 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 @@ -20,7 +20,7 @@ fn no_hook_on_top(span0: Span) -> OxcDiagnostic { "eslint-plugin-jest(prefer-hooks-on-top): Suggest having hooks before any test cases.", ) .with_help("Hooks should come before test cases") - .with_labels([span0.into()]) + .with_label(span0) } #[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 51da7778b4723..994fc7042e94f 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_jest_mocked.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_jest_mocked.rs @@ -14,7 +14,7 @@ fn use_jest_mocked(span0: Span) -> OxcDiagnostic { "eslint-plugin-jest(prefer-jest-mocked): Prefer `jest.mocked()` over `fn as jest.Mock`.", ) .with_help("Prefer `jest.mocked()`") - .with_labels([span0.into()]) + .with_label(span0) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_lowercase_title.rs b/crates/oxc_linter/src/rules/jest/prefer_lowercase_title.rs index dc6fee41dfa51..0eeb1f45c5c4b 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_lowercase_title.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_lowercase_title.rs @@ -15,7 +15,7 @@ use crate::{ fn unexpected_lowercase(x0: &str, span1: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-lowercase-title): Enforce lowercase test names") .with_help(format!("`{x0:?}`s should begin with lowercase")) - .with_labels([span1.into()]) + .with_label(span1) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/prefer_mock_promise_shorthand.rs b/crates/oxc_linter/src/rules/jest/prefer_mock_promise_shorthand.rs index e463c6c6001e3..0dd918a60663c 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_mock_promise_shorthand.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_mock_promise_shorthand.rs @@ -9,7 +9,7 @@ use oxc_span::{Atom, Span}; use crate::{context::LintContext, fixer::RuleFixer, rule::Rule, utils::get_node_name}; fn use_mock_shorthand(x0: &str, span1: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("eslint-plugin-jest(prefer-mock-promise-shorthand): Prefer mock resolved/rejected shorthands for promises").with_help(format!("Prefer {x0:?}")).with_labels([span1.into()]) + OxcDiagnostic::warn("eslint-plugin-jest(prefer-mock-promise-shorthand): Prefer mock resolved/rejected shorthands for promises").with_help(format!("Prefer {x0:?}")).with_label(span1) } #[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 9514f076056bb..a85437d63be59 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_spy_on.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_spy_on.rs @@ -20,7 +20,7 @@ use crate::{ fn use_jest_spy_on(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-spy-on): Suggest using `jest.spyOn()`.") .with_help("Use jest.spyOn() instead") - .with_labels([span0.into()]) + .with_label(span0) } #[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 6bef9ab565398..b7546f719ac98 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_strict_equal.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_strict_equal.rs @@ -12,7 +12,7 @@ use crate::{ fn use_to_strict_equal(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-strict-equal): Suggest using `toStrictEqual()`.") .with_help("Use `toStrictEqual()` instead") - .with_labels([span0.into()]) + .with_label(span0) } #[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 814e11685a743..14d2e4c0bcf62 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_to_be.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_to_be.rs @@ -19,27 +19,27 @@ fn use_to_be(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn( "eslint-plugin-jest(prefer-to-be): Use `toBe` when expecting primitive literals.", ) - .with_labels([span0.into()]) + .with_label(span0) } fn use_to_be_undefined(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-to-be): Use `toBeUndefined` instead.") - .with_labels([span0.into()]) + .with_label(span0) } fn use_to_be_defined(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-to-be): Use `toBeDefined` instead.") - .with_labels([span0.into()]) + .with_label(span0) } fn use_to_be_null(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-to-be): Use `toBeNull` instead.") - .with_labels([span0.into()]) + .with_label(span0) } fn use_to_be_na_n(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-to-be): Use `toBeNaN` instead.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 6fd419872c314..3da01d40c1ac1 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_to_contain.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_to_contain.rs @@ -17,7 +17,7 @@ use crate::{ fn use_to_contain(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-to-contain): Suggest using `toContain()`.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 5100e171c05b4..3efdc90edff84 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 @@ -20,7 +20,7 @@ fn use_to_have_length(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn( "eslint-plugin-jest(prefer-to-have-length): Suggest using `toHaveLength()`.", ) - .with_labels([span0.into()]) + .with_label(span0) } #[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 f7c2dea8009e4..cc109f0563988 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_todo.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_todo.rs @@ -18,12 +18,12 @@ use crate::{ fn empty_test(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-todo): Suggest using `test.todo`.") - .with_labels([span0.into()]) + .with_label(span0) } fn un_implemented_test_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jest(prefer-todo): Suggest using `test.todo`.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 f04ca148aa5c4..cd63e678c4ea2 100644 --- a/crates/oxc_linter/src/rules/jest/require_hook.rs +++ b/crates/oxc_linter/src/rules/jest/require_hook.rs @@ -22,7 +22,7 @@ fn use_hook(span0: Span) -> OxcDiagnostic { "eslint-plugin-jest(require-hook): Require setup and teardown code to be within a hook.", ) .with_help("This should be done within a hook") - .with_labels([span0.into()]) + .with_label(span0) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/require_to_throw_message.rs b/crates/oxc_linter/src/rules/jest/require_to_throw_message.rs index ec14c1291459f..6085b204ca8e3 100644 --- a/crates/oxc_linter/src/rules/jest/require_to_throw_message.rs +++ b/crates/oxc_linter/src/rules/jest/require_to_throw_message.rs @@ -14,7 +14,7 @@ fn require_to_throw_message_diagnostic(x0: &str, span1: Span) -> OxcDiagnostic { "eslint-plugin-jest(require-to-throw-message): Require a message for {x0:?}." )) .with_help(format!("Add an error message to {x0:?}")) - .with_labels([span1.into()]) + .with_label(span1) } #[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 34a27dd251d20..d4d20f830ec25 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 @@ -20,7 +20,7 @@ fn too_many_describes(max: usize, repeat: &str, span0: Span) -> OxcDiagnostic { "eslint-plugin-jest(require-top-level-describe): 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_labels([span0.into()]) + .with_label(span0) } fn unexpected_test_case(span0: Span) -> OxcDiagnostic { @@ -28,7 +28,7 @@ fn unexpected_test_case(span0: Span) -> OxcDiagnostic { "eslint-plugin-jest(require-top-level-describe): Require test cases and hooks to be inside a `describe` block", ) .with_help("All test cases must be wrapped in a describe block.") - .with_labels([span0.into()]) + .with_label(span0) } fn unexpected_hook(span0: Span) -> OxcDiagnostic { @@ -36,7 +36,7 @@ fn unexpected_hook(span0: Span) -> OxcDiagnostic { "eslint-plugin-jest(require-top-level-describe): Require test cases and hooks to be inside a `describe` block", ) .with_help("All hooks must be wrapped in a describe block.") - .with_labels([span0.into()]) + .with_label(span0) } #[derive(Debug, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs b/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs index 81a65a409821b..5777e702b6611 100644 --- a/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs +++ b/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs @@ -18,7 +18,7 @@ use crate::{ fn valid_describe_callback_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { OxcDiagnostic::warn(format!("eslint-plugin-jest(valid-describe-callback): {x0:?}")) .with_help(format!("{x1:?}")) - .with_labels([span2.into()]) + .with_label(span2) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/valid_expect.rs b/crates/oxc_linter/src/rules/jest/valid_expect.rs index 1a3a5e2940e32..cf83a923cc9fe 100644 --- a/crates/oxc_linter/src/rules/jest/valid_expect.rs +++ b/crates/oxc_linter/src/rules/jest/valid_expect.rs @@ -18,7 +18,7 @@ use crate::{ fn valid_expect_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { OxcDiagnostic::warn(format!("eslint-plugin-jest(valid-expect): {x0:?}")) .with_help(format!("{x1:?}")) - .with_labels([span2.into()]) + .with_label(span2) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jest/valid_title.rs b/crates/oxc_linter/src/rules/jest/valid_title.rs index 5b2e565b2bdd8..8e8e8f48f22af 100644 --- a/crates/oxc_linter/src/rules/jest/valid_title.rs +++ b/crates/oxc_linter/src/rules/jest/valid_title.rs @@ -21,7 +21,7 @@ use crate::{ fn valid_title_diagnostic(x0: &str, x1: &str, span2: Span) -> OxcDiagnostic { OxcDiagnostic::warn(format!("eslint-plugin-jest(valid-title): {x0:?}")) .with_help(format!("{x1:?}")) - .with_labels([span2.into()]) + .with_label(span2) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsdoc/check_access.rs b/crates/oxc_linter/src/rules/jsdoc/check_access.rs index 3e84237b10602..562ff00447c8d 100644 --- a/crates/oxc_linter/src/rules/jsdoc/check_access.rs +++ b/crates/oxc_linter/src/rules/jsdoc/check_access.rs @@ -11,13 +11,13 @@ fn invalid_access_level(span0: Span) -> OxcDiagnostic { "eslint-plugin-jsdoc(check-access): Invalid access level is specified or missing.", ) .with_help("Valid access levels are `package`, `private`, `protected`, and `public`.") - .with_labels([span0.into()]) + .with_label(span0) } fn redundant_access_tags(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsdoc(check-access): 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_labels([span0.into()]) + .with_label(span0) } #[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 a2201c2d15f12..eebd842790321 100644 --- a/crates/oxc_linter/src/rules/jsdoc/check_property_names.rs +++ b/crates/oxc_linter/src/rules/jsdoc/check_property_names.rs @@ -14,7 +14,7 @@ fn no_root(span0: Span, x1: &str) -> OxcDiagnostic { "eslint-plugin-jsdoc(check-property-names): No root defined for @property path.", ) .with_help(format!("@property path declaration `{x1}` appears before any real property.")) - .with_labels([span0.into()]) + .with_label(span0) } #[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 59ae511b2741d..3f5fe3f97d5af 100644 --- a/crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs +++ b/crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs @@ -13,7 +13,7 @@ use crate::{ fn check_tag_names_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsdoc(check-tag-names): Invalid tag name found.") .with_help(x1.to_string()) - .with_labels([span0.into()]) + .with_label(span0) } #[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 eea05dd0cf7e7..6f9ac1b0f8291 100644 --- a/crates/oxc_linter/src/rules/jsdoc/empty_tags.rs +++ b/crates/oxc_linter/src/rules/jsdoc/empty_tags.rs @@ -11,7 +11,7 @@ fn empty_tags_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { "eslint-plugin-jsdoc(empty-tags): Expects the void tags to be empty of any content.", ) .with_help(format!("`@{x1}` tag should not have body.")) - .with_labels([span0.into()]) + .with_label(span0) } #[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 039d288954f79..0d9d3043e47c0 100644 --- a/crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs +++ b/crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs @@ -14,7 +14,7 @@ use crate::{ fn implements_on_classes_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsdoc(implements-on-classes): `@implements` used on a non-constructor function") .with_help("Add `@class` tag or use ES6 class syntax.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 9c98d3d808e07..6c47426904e08 100644 --- a/crates/oxc_linter/src/rules/jsdoc/no_defaults.rs +++ b/crates/oxc_linter/src/rules/jsdoc/no_defaults.rs @@ -14,7 +14,7 @@ use crate::{ fn no_defaults_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsdoc(no-defaults): Defaults are not permitted.") .with_help(x1.to_string()) - .with_labels([span0.into()]) + .with_label(span0) } #[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 1c3d386988128..6251b631f0662 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_param_description.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_param_description.rs @@ -18,7 +18,7 @@ fn missing_type_diagnostic(span0: Span) -> OxcDiagnostic { "eslint-plugin-jsdoc(require-param-description): Missing JSDoc `@param` description.", ) .with_help("Add description to `@param` tag.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 71f8224f92baa..63ab1548014be 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_param_name.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_param_name.rs @@ -13,7 +13,7 @@ use crate::{ fn missing_name_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsdoc(require-param-name): Missing JSDoc `@param` name.") .with_help("Add name to `@param` tag.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 a190d8d8794f5..e09f41148defc 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_param_type.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_param_type.rs @@ -16,7 +16,7 @@ use crate::{ fn missing_type_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsdoc(require-param-type): Missing JSDoc `@param` type.") .with_help("Add {type} to `@param` tag.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 e43d95f97999e..45357ab6fb4fc 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_property_description.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_property_description.rs @@ -13,7 +13,7 @@ fn require_property_description_diagnostic(span0: Span) -> OxcDiagnostic { "eslint-plugin-jsdoc(require-property-description): Missing description in @property tag.", ) .with_help("Add a description to this @property tag.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 a5ea83c3b5ce0..5b4e5528bf46e 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_property_name.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_property_name.rs @@ -13,7 +13,7 @@ fn require_property_name_diagnostic(span0: Span) -> OxcDiagnostic { "eslint-plugin-jsdoc(require-property-name): Missing name in @property tag.", ) .with_help("Add a type name to this @property tag.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 5ae920963750d..f83afb2f5f5c8 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_property_type.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_property_type.rs @@ -13,7 +13,7 @@ fn require_property_type_diagnostic(span0: Span) -> OxcDiagnostic { "eslint-plugin-jsdoc(require-property-type): Missing type in @property tag.", ) .with_help("Add a {type} to this @property tag.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 05763a6bb9fd2..4ed710c127614 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_returns.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_returns.rs @@ -24,12 +24,12 @@ fn missing_returns_diagnostic(span0: Span) -> OxcDiagnostic { "eslint-plugin-jsdoc(require-returns): Missing JSDoc `@returns` declaration for function.", ) .with_help("Add `@returns` tag to the JSDoc comment.") - .with_labels([span0.into()]) + .with_label(span0) } fn duplicate_returns_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsdoc(require-returns): Duplicate `@returns` tags.") .with_help("Remove redundunt `@returns` tag.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 e1c109d58e808..1a81c97ac9d1d 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs @@ -15,7 +15,7 @@ fn missing_description_diagnostic(span0: Span) -> OxcDiagnostic { "eslint-plugin-jsdoc(require-returns-description): Missing JSDoc `@returns` description.", ) .with_help("Add description comment to `@returns` tag.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 c82f2f78dee73..55793f442cbfd 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_returns_type.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_returns_type.rs @@ -13,7 +13,7 @@ use crate::{ fn missing_type_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsdoc(require-returns-type): Missing JSDoc `@returns` type.") .with_help("Add {type} to `@returns` tag.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 58c6db4bca49a..ec3ddab811c66 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_yields.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_yields.rs @@ -19,19 +19,19 @@ use crate::{ fn missing_yields(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsdoc(require-yields): Missing JSDoc `@yields` declaration for generator function.") .with_help("Add `@yields` tag to the JSDoc comment.") - .with_labels([span0.into()]) + .with_label(span0) } fn duplicate_yields(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsdoc(require-yields): Duplicate `@yields` tags.") .with_help("Remove redundunt `@yields` tag.") - .with_labels([span0.into()]) + .with_label(span0) } fn missing_yields_with_generator(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsdoc(require-yields): `@yields` tag is required when using `@generator` tag.") .with_help("Add `@yields` tag to the JSDoc comment.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 a6995f32b8246..273248ff0e58a 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs @@ -19,7 +19,7 @@ use crate::{ fn missing_alt_prop(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(alt-text): Missing `alt` attribute.") .with_help("Must have `alt` prop, either with meaningful text, or an empty string for decorative images.") - .with_labels([span0.into()]) + .with_label(span0) } fn missing_alt_value(span0: Span) -> OxcDiagnostic { @@ -27,13 +27,13 @@ fn missing_alt_value(span0: Span) -> OxcDiagnostic { .with_help( "Must have meaningful value for `alt` prop. Use alt=\"\" for presentational images.", ) - .with_labels([span0.into()]) + .with_label(span0) } fn aria_label_value(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(alt-text): Missing value for aria-label attribute.") .with_help("The aria-label attribute must have a value. The alt attribute is preferred over aria-label for images.") - .with_labels([span0.into()]) + .with_label(span0) } fn aria_labelled_by_value(span0: Span) -> OxcDiagnostic { @@ -41,31 +41,31 @@ fn aria_labelled_by_value(span0: Span) -> OxcDiagnostic { "eslint-plugin-jsx-a11y(alt-text): Missing value for aria-labelledby attribute.", ) .with_help("The alt attribute is preferred over aria-labelledby for images.") - .with_labels([span0.into()]) + .with_label(span0) } fn prefer_alt(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(alt-text): 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_labels([span0.into()]) + .with_label(span0) } fn object(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(alt-text): Missing alternative text.") .with_help("Embedded elements must have a text alternative through the `alt`, `aria-label`, or `aria-labelledby` prop.") - .with_labels([span0.into()]) + .with_label(span0) } fn area(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(alt-text): 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_labels([span0.into()]) + .with_label(span0) } fn input_type_image(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(alt-text): Missing alternative text.") .with_help(" elements with type=\"image\" must have a text alternative through the `alt`, `aria-label`, or `aria-labelledby` prop.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 10164c9696dd7..464d1b970c2d1 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 @@ -16,13 +16,13 @@ use crate::{ fn missing_content(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(anchor-has-content): Missing accessible content when using `a` elements.") .with_help("Provide screen reader accessible content when using `a` elements.") - .with_labels([span0.into()]) + .with_label(span0) } fn remove_aria_hidden(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(anchor-has-content): Missing accessible content when using `a` elements.") .with_help("Remove the `aria-hidden` attribute to allow the anchor element and its content visible to assistive technologies.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 048aa42fb1294..1ea1b096c8fb0 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 @@ -18,7 +18,7 @@ fn missing_href_attribute(span0: Span) -> OxcDiagnostic { "eslint-plugin-jsx-a11y(anchor-is-valid): Missing `href` attribute for the `a` element.", ) .with_help("Provide an href for the `a` element.") - .with_labels([span0.into()]) + .with_label(span0) } fn incorrect_href(span0: Span) -> OxcDiagnostic { @@ -26,7 +26,7 @@ fn incorrect_href(span0: Span) -> OxcDiagnostic { "eslint-plugin-jsx-a11y(anchor-is-valid): Use an incorrect href for the 'a' element.", ) .with_help("Provide a correct href for the `a` element.") - .with_labels([span0.into()]) + .with_label(span0) } fn cant_be_anchor(span0: Span) -> OxcDiagnostic { @@ -34,7 +34,7 @@ fn cant_be_anchor(span0: Span) -> OxcDiagnostic { "eslint-plugin-jsx-a11y(anchor-is-valid): The a element has `href` and `onClick`.", ) .with_help("Use a `button` element instead of an `a` element.") - .with_labels([span0.into()]) + .with_label(span0) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs b/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs index 7121b3b79caf0..4e21a515815aa 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs @@ -17,7 +17,7 @@ use crate::{ fn aria_activedescendant_has_tabindex_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(aria-activedescendant-has-tabindex): Enforce elements with aria-activedescendant are tabbable.") .with_help("An element that manages focus with `aria-activedescendant` must have a tabindex.") - .with_labels([span0.into()]) + .with_label(span0) } #[derive(Debug, Default, Clone)] diff --git a/crates/oxc_linter/src/rules/jsx_a11y/aria_props.rs b/crates/oxc_linter/src/rules/jsx_a11y/aria_props.rs index f06b1eed475ba..b6b1ee69c9f0a 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_props.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_props.rs @@ -11,7 +11,7 @@ use crate::{ fn aria_props_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(aria-props): Invalid ARIA prop.") .with_help(format!("`{x1}` is an invalid ARIA attribute.")) - .with_labels([span0.into()]) + .with_label(span0) } #[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 c394511061d99..6e80f1131df70 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs @@ -17,7 +17,7 @@ use crate::{ fn aria_role_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(aria-role): 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_labels([span0.into()]) + .with_label(span0) } #[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 b5282fa9346a0..851cd9c0faef9 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 @@ -36,7 +36,7 @@ pub struct AriaUnsupportedElements; fn aria_unsupported_elements_diagnostic(span0: Span, x1: &str) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(aria-unsupported-elements): This element does not support ARIA roles, states and properties.") .with_help(format!("Try removing the prop `{x1}`.")) - .with_labels([span0.into()]) + .with_label(span0) } 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 e2f2b3682bf43..1ecd9427460c0 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 @@ -17,7 +17,7 @@ use crate::{ fn click_events_have_key_events_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(click-events-have-key-events): 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_labels([span0.into()]) + .with_label(span0) } #[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 2d76b3b663067..a14f31021bfb2 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 @@ -13,7 +13,7 @@ use crate::{ fn heading_has_content_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint(heading-has-content): 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_labels([span0.into()]) + .with_label(span0) } #[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 ed3b21f77f8be..619a371a345de 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 @@ -16,13 +16,13 @@ use crate::{ fn missing_lang_prop(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(html-has-lang): Missing lang attribute.") .with_help("Add a lang attribute to the html element whose value represents the primary language of document.") - .with_labels([span0.into()]) + .with_label(span0) } fn missing_lang_value(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(html-has-lang): Missing value for lang attribute") .with_help("Must have meaningful value for `lang` prop.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 b5a1274f2aea0..948961d12f782 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 @@ -16,7 +16,7 @@ use crate::{ fn iframe_has_title_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(iframe-has-title): Missing `title` attribute for the `iframe` element.") .with_help("Provide title property for iframe element.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 e9cfd78c0dd3a..8d9f7f7a129ec 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,7 +17,7 @@ use crate::{ }; fn img_redundant_alt_diagnostic(span0: Span) -> OxcDiagnostic { - OxcDiagnostic::warn("eslint-plugin-jsx-a11y(img-redundant-alt): 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_labels([span0.into()]) + OxcDiagnostic::warn("eslint-plugin-jsx-a11y(img-redundant-alt): 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) } #[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 877cd1236a5e6..46c1d7da295ea 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/lang.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/lang.rs @@ -17,7 +17,7 @@ use crate::{ fn lang_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(lang): Lang attribute must have a valid value.") .with_help("Set a valid value for lang attribute.") - .with_labels([span0.into()]) + .with_label(span0) } #[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 0838d23fc9dca..8b224cbfbe4b9 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,7 +11,7 @@ use crate::{context::LintContext, rule::Rule, utils::get_element_type, AstNode}; fn media_has_caption_diagnostic(span0: Span) -> OxcDiagnostic { OxcDiagnostic::warn("eslint-plugin-jsx-a11y(media-has-caption): Missing element with captions inside