# no-test-prefixes

Rule `vitest/no-test-prefixes`. Disallow using the `f` and `x` prefixes in favour of `.only` and `.skip`

- Source: vitest
- Technologies: Testing
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1782 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vitest/no-test-prefixes` | no | safe | package `@vitest/eslint-plugin` | [docs](https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-prefixes.md) |
| Oxlint | `vitest/no-test-prefixes` | no | safe | plugin `vitest`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/vitest/no-test-prefixes.html) |

## Code examples

### Incorrect: the rule reports this

```js
xdescribe.each([])('foo', function () {})
```

### Correct: the rule accepts this

```js
describe.skip.each([])('foo', function () {})
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import vitest from "@vitest/eslint-plugin";

export default [
  {
    plugins: { vitest },
    rules: {
      "vitest/no-test-prefixes": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "vitest"
  ],
  "rules": {
    "vitest/no-test-prefixes": "error"
  }
}
```

## Related rules

- [jest/no-test-prefixes](https://lintradar.dev/rules/jest/no-test-prefixes.md): Require using `.only` and `.skip` over `f` and `x`
- [vitest/no-restricted-vi-methods](https://lintradar.dev/rules/vitest/no-restricted-vi-methods.md): Disallow specific `vi.` methods
- [vitest/padding-around-after-all-blocks](https://lintradar.dev/rules/vitest/padding-around-after-all-blocks.md): Enforce padding around `afterAll` blocks
- [vitest/no-restricted-matchers](https://lintradar.dev/rules/vitest/no-restricted-matchers.md): Disallow the use of certain matchers
- [vitest/padding-around-after-each-blocks](https://lintradar.dev/rules/vitest/padding-around-after-each-blocks.md): Enforce padding around `afterEach` blocks
- [vitest/no-large-snapshots](https://lintradar.dev/rules/vitest/no-large-snapshots.md): Disallow large snapshots

---

Web page: https://lintradar.dev/rules/vitest/no-test-prefixes. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
