For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt, and this page is available as Markdown at https://rslint.rs/rules/rstest/no-focused-tests.md.
close

no-focused-tests

Added in v0.8.1

Configuration

PresetConfigured Value
✅ rstestPlugin.configs.all"warn"
✅ rstestPlugin.configs.recommended"error"
rslint.config.ts
import { defineConfig, rstestPlugin } from '@rslint/core';

export default defineConfig([
  rstestPlugin.configs.recommended,
  {
    rules: {
      'rstest/no-focused-tests': 'error',
    },
  },
]);

Rule Details

Disallows focused tests and suites. Leaving .only in committed code prevents the rest of the suite from running.

The rule recognizes .only on Rstest tests and suites, including aliases, parameterized registrations, fixtures, and Playwright integrations.

Incorrect

describe.only('user service', () => {
  test('creates a user', () => {});
});

Correct

describe('user service', () => {
  test('creates a user', () => {});
});

Suggestions

Offers a suggestion to remove .only when the focused modifier is unambiguous.