noctcore-code-quality/no-focused-tests
Ban
.only/fdescribe/fitso a focused test never silently lands in CI.
Recommended preset: error · Autofix: no · Suggestions: no · Type information: not needed
A focused test (it.only, fdescribe, …) silences the rest of the suite. Committed by accident it
turns a green CI run into a lie — the suite “passes” because almost none of it ran. This rule makes a
focused test a lint error so it can’t merge.
What it flags
Section titled “What it flags”.onlyresolved back to ait/describe/testrunner, including chained modifiers (test.concurrent.only,describe.concurrent.only).- The Jest/Jasmine focused-call forms
fdescribe(...),fit(...),ddescribe(...)— but only as a bare-identifier callee, so an unrelatedobj.fit(...)method is not flagged.
it.only('runs', () => {});test.concurrent.only('case', () => {});fdescribe('suite', () => {});it('runs', () => {});layout.fit('contain'); // not a test runnerWhat it does not flag
Section titled “What it does not flag”.onlyon something that is not a test runner (queue.only(...),db.batch.only(...)), and a plain variable namedonly.- A method named
fiton some object (layout.fit('contain')): only the bare global counts. - Skipped tests (
it.skip,xit): seeskipped-tests-need-tracking.
When not to use it
Section titled “When not to use it”You almost always want this on. Disable only in throwaway scratch suites.