no-export
July 2, 2026 Β· View on GitHub
π Disallow exports from test files.
πΌπ« This rule is enabled in the β
recommended config. This rule is disabled in the βοΈ unopinionated config.
A test file is run by the test runner for its side effects (registering and running tests); it is not a module meant to be imported elsewhere. Exporting from it is almost always a mistake β for example, leaving an export on a helper that should live in a separate file, or accidentally exporting test internals.
This rule reports export declarations (including re-exports and default exports) in a file that imports node:test.
Examples
import test from 'node:test';
// β
export function helper() {}
// β
test('title', () => {});