# Vitest recommended

The Vitest counterpart of the Jest set: valid titles, real assertions and no accidentally skipped tests.

- Linter: ESLint
- Package: `@vitest/eslint-plugin` (https://github.com/vitest-dev/eslint-plugin-vitest#recommended)
- Author: Vitest (official)
- Rules: 17
- Weekly downloads: 5.9M, +61.5% last quarter
- Technologies: testing (17)

## Install

```sh
npm install -D eslint @vitest/eslint-plugin
pnpm add -D eslint @vitest/eslint-plugin
yarn add -D eslint @vitest/eslint-plugin
bun add -d eslint @vitest/eslint-plugin
```

## Config: `eslint.config.js`

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

export default [
  vitest.configs.recommended,
];
```

## Rules it enables

| Rule | Severity | Description | Reach |
| --- | --- | --- | --- |
| [vitest/no-identical-title](https://lintradar.dev/rules/vitest/no-identical-title.md) | error | Disallow identical titles | 6.6M |
| [vitest/no-import-node-test](https://lintradar.dev/rules/vitest/no-import-node-test.md) | error | Disallow importing `node:test` | 6.6M |
| [vitest/expect-expect](https://lintradar.dev/rules/vitest/expect-expect.md) | error | Enforce having expectation in test body | 5.9M |
| [vitest/no-conditional-expect](https://lintradar.dev/rules/vitest/no-conditional-expect.md) | error | Disallow conditional expects | 5.9M |
| [vitest/no-disabled-tests](https://lintradar.dev/rules/vitest/no-disabled-tests.md) | warn | Disallow disabled tests | 5.9M |
| [vitest/no-focused-tests](https://lintradar.dev/rules/vitest/no-focused-tests.md) | error | Disallow focused tests | 5.9M |
| [vitest/no-standalone-expect](https://lintradar.dev/rules/vitest/no-standalone-expect.md) | error | Disallow using `expect` outside of `it` or `test` blocks | 5.9M |
| [vitest/valid-title](https://lintradar.dev/rules/vitest/valid-title.md) | error | Enforce valid titles | 5.9M |
| [vitest/no-commented-out-tests](https://lintradar.dev/rules/vitest/no-commented-out-tests.md) | error | Disallow commented out tests | 5.9M |
| [vitest/no-interpolation-in-snapshots](https://lintradar.dev/rules/vitest/no-interpolation-in-snapshots.md) | error | Disallow string interpolation in snapshots | 5.9M |
| [vitest/no-mocks-import](https://lintradar.dev/rules/vitest/no-mocks-import.md) | error | Disallow importing from __mocks__ directory | 5.9M |
| [vitest/no-unneeded-async-expect-function](https://lintradar.dev/rules/vitest/no-unneeded-async-expect-function.md) | error | Disallow unnecessary async function wrapper for expected promises | 5.9M |
| [vitest/prefer-called-exactly-once-with](https://lintradar.dev/rules/vitest/prefer-called-exactly-once-with.md) | error | Prefer `toHaveBeenCalledExactlyOnceWith` over `toHaveBeenCalledOnce` and `toHaveBeenCalledWith` | 5.9M |
| [vitest/require-local-test-context-for-concurrent-snapshots](https://lintradar.dev/rules/vitest/require-local-test-context-for-concurrent-snapshots.md) | error | Require local Test Context for concurrent snapshot tests | 5.9M |
| [vitest/valid-describe-callback](https://lintradar.dev/rules/vitest/valid-describe-callback.md) | error | Enforce valid describe callback | 5.9M |
| [vitest/valid-expect](https://lintradar.dev/rules/vitest/valid-expect.md) | error | Enforce valid `expect()` usage | 5.9M |
| [vitest/valid-expect-in-promise](https://lintradar.dev/rules/vitest/valid-expect-in-promise.md) | error | Require promises that have expectations in their chain to be valid | 5.9M |

---

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