# no-large-snapshots

Rule `vitest/no-large-snapshots`. Disallow large snapshots

- 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: #1779 by reach

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
test('large snapshot', () => {
  expect('a'.repeat(100)).toMatchSnapshot()
})
```

### Correct: the rule accepts this

```js
test('large snapshot', () => {
  expect('a'.repeat(50)).toMatchSnapshot()
})
```

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-large-snapshots": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

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

## Related rules

- [jest/no-large-snapshots](https://lintradar.dev/rules/jest/no-large-snapshots.md): Disallow large snapshots
- [vitest/no-importing-vitest-globals](https://lintradar.dev/rules/vitest/no-importing-vitest-globals.md): Disallow importing Vitest globals
- [vitest/no-restricted-matchers](https://lintradar.dev/rules/vitest/no-restricted-matchers.md): Disallow the use of certain matchers
- [vitest/no-conditional-tests](https://lintradar.dev/rules/vitest/no-conditional-tests.md): Disallow conditional tests
- [vitest/no-restricted-vi-methods](https://lintradar.dev/rules/vitest/no-restricted-vi-methods.md): Disallow specific `vi.` methods
- [vitest/no-conditional-in-test](https://lintradar.dev/rules/vitest/no-conditional-in-test.md): Disallow conditional tests

---

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