# no-export

Rule `jest/no-export`. Disallow using `exports` in files containing tests

- Source: jest
- Technologies: Testing
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 47.3M weekly downloads of presets that enable it
- Trend: +58.7% last quarter
- Rank: #263 by reach, #721 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `jest/no-export` | yes | no | package `eslint-plugin-jest` | [docs](https://github.com/jest-community/eslint-plugin-jest/blob/v29.17.2/docs/rules/no-export.md) |
| Oxlint | `jest/no-export` | no | no | plugin `jest`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/jest/no-export.html) |
| Biome | `suspicious/noExportsInTest` | yes | no | group suspicious, since 1.6.0 | [docs](https://biomejs.dev/linter/rules/no-exports-in-test/) |

## Code examples

### Incorrect: the rule reports this

```js
export function myHelper() {}

module.exports = function () {};

module.exports = {
  something: 'that should be moved to a non-test file',
};

describe('a test', () => {
  expect(1).toBe(1);
});
```

### Correct: the rule accepts this

```js
function myHelper() {}

const myThing = {
  something: 'that can live here',
};

describe('a test', () => {
  expect(1).toBe(1);
});
```

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

### Oxlint: `.oxlintrc.json`

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

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "suspicious": {
        "noExportsInTest": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Jest recommended](https://lintradar.dev/presets/jest-recommended.md) | ESLint | `eslint-plugin-jest` | 19 | 16.7M | +10.1% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [jest/no-identical-title](https://lintradar.dev/rules/jest/no-identical-title.md): Disallow identical titles
- [jest/no-focused-tests](https://lintradar.dev/rules/jest/no-focused-tests.md): Disallow focused tests
- [jest/no-duplicate-hooks](https://lintradar.dev/rules/jest/no-duplicate-hooks.md): Disallow duplicate setup and teardown hooks
- [jest/no-test-return-statement](https://lintradar.dev/rules/jest/no-test-return-statement.md): Disallow explicitly returning from tests
- [jest/no-disabled-tests](https://lintradar.dev/rules/jest/no-disabled-tests.md): Disallow disabled tests
- [jest/valid-expect](https://lintradar.dev/rules/jest/valid-expect.md): Enforce valid `expect()` usage

---

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