# max-nested-describe

Rule `vitest/max-nested-describe`. Require describe block to be less than set max value or default value

- Source: vitest
- Technologies: Testing
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1682 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `vitest/max-nested-describe` | no | no | package `@vitest/eslint-plugin` | [docs](https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-nested-describe.md) |
| Oxlint | `vitest/max-nested-describe` | no | no | plugin `vitest`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/vitest/max-nested-describe.html) |
| Biome | `complexity/noExcessiveNestedTestSuites` | no | no | group complexity, since 1.6.0 | [docs](https://biomejs.dev/linter/rules/no-excessive-nested-test-suites/) |

## Code examples

### Incorrect: the rule reports this

```js
describe('outer', () => {
  describe('inner', () => {
    // ...
  })
})
```

### Correct: the rule accepts this

```js
describe('inner', () => {
  // ...
})
```

Examples from the ESLint documentation.

## Enable it

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

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

export default [
  {
    plugins: { vitest },
    rules: {
      "vitest/max-nested-describe": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "vitest"
  ],
  "rules": {
    "vitest/max-nested-describe": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "complexity": {
        "noExcessiveNestedTestSuites": "error"
      }
    }
  }
}
```

## Related rules

- [jest/max-nested-describe](https://lintradar.dev/rules/jest/max-nested-describe.md): Enforces a maximum depth to nested describe calls
- [vitest/no-duplicate-hooks](https://lintradar.dev/rules/vitest/no-duplicate-hooks.md): Disallow duplicate hooks and teardown hooks
- [vitest/no-hooks](https://lintradar.dev/rules/vitest/no-hooks.md): Disallow setup and teardown hooks
- [vitest/no-test-return-statement](https://lintradar.dev/rules/vitest/no-test-return-statement.md): Disallow return statements in tests
- [vitest/prefer-called-times](https://lintradar.dev/rules/vitest/prefer-called-times.md): Enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)`
- [vitest/prefer-called-with](https://lintradar.dev/rules/vitest/prefer-called-with.md): Enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()`

---

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