# no-large-snapshots

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

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

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
exports[`a large snapshot 1`] = `
line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
line 11
line 12
line 13
line 14
line 15
line 16
line 17
line 18
line 19
line 20
line 21
line 22
line 23
line 24
line 25
line 26
line 27
line 28
line 29
line 30
line 31
// …
```

### Correct: the rule accepts this

```js
exports[`a more manageable and readable snapshot 1`] = `
line 1
line 2
line 3
line 4
`;
```

Examples from the ESLint documentation.

## Enable it

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

```js
import jest from "eslint-plugin-jest";

export default [
  {
    plugins: { jest },
    rules: {
      "jest/no-large-snapshots": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

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

## Related rules

- [vitest/no-large-snapshots](https://lintradar.dev/rules/vitest/no-large-snapshots.md): Disallow large snapshots
- [jest/no-confusing-set-timeout](https://lintradar.dev/rules/jest/no-confusing-set-timeout.md): Disallow confusing usages of jest.setTimeout
- [jest/no-restricted-jest-methods](https://lintradar.dev/rules/jest/no-restricted-jest-methods.md): Disallow specific `jest.` methods
- [jest/no-conditional-in-test](https://lintradar.dev/rules/jest/no-conditional-in-test.md): Disallow conditional logic in tests
- [jest/no-restricted-matchers](https://lintradar.dev/rules/jest/no-restricted-matchers.md): Disallow specific matchers & modifiers
- [jest/max-expects](https://lintradar.dev/rules/jest/max-expects.md): Enforces a maximum number assertion calls in a test body

---

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