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 c924a0152a973..17fd3a6eda1a5 100644 --- a/crates/oxc_linter/src/rules/jest/no_disabled_tests.rs +++ b/crates/oxc_linter/src/rules/jest/no_disabled_tests.rs @@ -4,7 +4,7 @@ use oxc_diagnostics::{ thiserror::Error, }; use oxc_macros::declare_oxc_lint; -use oxc_span::Span; +use oxc_span::{GetSpan, Span}; use crate::{ context::LintContext, @@ -109,7 +109,7 @@ impl Rule for NoDisabledTests { } else { Message::DisabledTestWithX.details() }; - ctx.diagnostic(NoDisabledTestsDiagnostic(error, help, call_expr.span)); + ctx.diagnostic(NoDisabledTestsDiagnostic(error, help, call_expr.callee.span())); return; } @@ -121,7 +121,7 @@ impl Rule for NoDisabledTests { } else { Message::DisabledTestWithSkip.details() }; - ctx.diagnostic(NoDisabledTestsDiagnostic(error, help, call_expr.span)); + ctx.diagnostic(NoDisabledTestsDiagnostic(error, help, call_expr.callee.span())); } } else if let Expression::Identifier(ident) = &call_expr.callee { if ident.name.as_str() == "pending" diff --git a/crates/oxc_linter/src/snapshots/no_disabled_tests.snap b/crates/oxc_linter/src/snapshots/no_disabled_tests.snap index f26b49b267c4a..7ef8e28f442d0 100644 --- a/crates/oxc_linter/src/snapshots/no_disabled_tests.snap +++ b/crates/oxc_linter/src/snapshots/no_disabled_tests.snap @@ -5,140 +5,140 @@ expression: no_disabled_tests ⚠ eslint(jest/no-disabled-tests): "Disabled test suite" ╭─[no_disabled_tests.tsx:1:1] 1 │ describe.skip('foo', function () {}) - · ──────────────────────────────────── + · ───────────── ╰──── help: "Remove the appending `.skip`" ⚠ eslint(jest/no-disabled-tests): "Disabled test suite" ╭─[no_disabled_tests.tsx:1:1] 1 │ describe.skip.each([1, 2, 3])('%s', (a, b) => {}); - · ───────────────────────────────────────────────── + · ───────────────────────────── ╰──── help: "Remove the appending `.skip`" ⚠ eslint(jest/no-disabled-tests): "Disabled test suite" ╭─[no_disabled_tests.tsx:1:1] 1 │ xdescribe.each([1, 2, 3])('%s', (a, b) => {}); - · ───────────────────────────────────────────── + · ───────────────────────── ╰──── help: "Remove x prefix" ⚠ eslint(jest/no-disabled-tests): "Disabled test suite" ╭─[no_disabled_tests.tsx:1:1] 1 │ describe[`skip`]('foo', function () {}) - · ─────────────────────────────────────── + · ──────────────── ╰──── help: "Remove the appending `.skip`" ⚠ eslint(jest/no-disabled-tests): "Disabled test suite" ╭─[no_disabled_tests.tsx:1:1] 1 │ describe['skip']('foo', function () {}) - · ─────────────────────────────────────── + · ──────────────── ╰──── help: "Remove the appending `.skip`" ⚠ eslint(jest/no-disabled-tests): "Disabled test" ╭─[no_disabled_tests.tsx:1:1] 1 │ it.skip('foo', function () {}) - · ────────────────────────────── + · ─────── ╰──── help: "Remove the appending `.skip`" ⚠ eslint(jest/no-disabled-tests): "Disabled test" ╭─[no_disabled_tests.tsx:1:1] 1 │ it['skip']('foo', function () {}) - · ───────────────────────────────── + · ────────── ╰──── help: "Remove the appending `.skip`" ⚠ eslint(jest/no-disabled-tests): "Disabled test" ╭─[no_disabled_tests.tsx:1:1] 1 │ test.skip('foo', function () {}) - · ──────────────────────────────── + · ───────── ╰──── help: "Remove the appending `.skip`" ⚠ eslint(jest/no-disabled-tests): "Disabled test" ╭─[no_disabled_tests.tsx:1:1] 1 │ it.skip.each``('foo', function () {}) - · ───────────────────────────────────── + · ────────────── ╰──── help: "Remove the appending `.skip`" ⚠ eslint(jest/no-disabled-tests): "Disabled test" ╭─[no_disabled_tests.tsx:1:1] 1 │ test.skip.each``('foo', function () {}) - · ─────────────────────────────────────── + · ──────────────── ╰──── help: "Remove the appending `.skip`" ⚠ eslint(jest/no-disabled-tests): "Disabled test" ╭─[no_disabled_tests.tsx:1:1] 1 │ it.skip.each([])('foo', function () {}) - · ─────────────────────────────────────── + · ──────────────── ╰──── help: "Remove the appending `.skip`" ⚠ eslint(jest/no-disabled-tests): "Disabled test" ╭─[no_disabled_tests.tsx:1:1] 1 │ test.skip.each([])('foo', function () {}) - · ───────────────────────────────────────── + · ────────────────── ╰──── help: "Remove the appending `.skip`" ⚠ eslint(jest/no-disabled-tests): "Disabled test" ╭─[no_disabled_tests.tsx:1:1] 1 │ test['skip']('foo', function () {}) - · ─────────────────────────────────── + · ──────────── ╰──── help: "Remove the appending `.skip`" ⚠ eslint(jest/no-disabled-tests): "Disabled test suite" ╭─[no_disabled_tests.tsx:1:1] 1 │ xdescribe('foo', function () {}) - · ──────────────────────────────── + · ───────── ╰──── help: "Remove x prefix" ⚠ eslint(jest/no-disabled-tests): "Disabled test" ╭─[no_disabled_tests.tsx:1:1] 1 │ xit('foo', function () {}) - · ────────────────────────── + · ─── ╰──── help: "Remove x prefix" ⚠ eslint(jest/no-disabled-tests): "Disabled test" ╭─[no_disabled_tests.tsx:1:1] 1 │ xtest('foo', function () {}) - · ──────────────────────────── + · ───── ╰──── help: "Remove x prefix" ⚠ eslint(jest/no-disabled-tests): "Disabled test" ╭─[no_disabled_tests.tsx:1:1] 1 │ xit.each``('foo', function () {}) - · ───────────────────────────────── + · ────────── ╰──── help: "Remove x prefix" ⚠ eslint(jest/no-disabled-tests): "Disabled test" ╭─[no_disabled_tests.tsx:1:1] 1 │ xtest.each``('foo', function () {}) - · ─────────────────────────────────── + · ──────────── ╰──── help: "Remove x prefix" ⚠ eslint(jest/no-disabled-tests): "Disabled test" ╭─[no_disabled_tests.tsx:1:1] 1 │ xit.each([])('foo', function () {}) - · ─────────────────────────────────── + · ──────────── ╰──── help: "Remove x prefix" ⚠ eslint(jest/no-disabled-tests): "Disabled test" ╭─[no_disabled_tests.tsx:1:1] 1 │ xtest.each([])('foo', function () {}) - · ───────────────────────────────────── + · ────────────── ╰──── help: "Remove x prefix"