> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# no-import-node-test

[Added in v0.8.1](https://github.com/web-infra-dev/rslint/releases/tag/v0.8.1)
## Configuration

| Preset                             | Configured Value |
| ---------------------------------- | ---------------- |
| ✅ rstestPlugin.configs.all         | `"warn"`         |
| ✅ rstestPlugin.configs.recommended | `"error"`        |


```ts title=rslint.config.ts
import { defineConfig, rstestPlugin } from '@rslint/core';

export default defineConfig([
  rstestPlugin.configs.recommended,
  {
    rules: {
      'rstest/no-import-node-test': 'error',
    },
  },
]);
```

## Rule Details

Disallows importing Node's test runner in an Rstest test file. Editor auto-import can otherwise select `node:test` instead of Rstest.

The rule reports static imports, `require()`, and TypeScript `import = require` forms for `node:test` and paths beneath it.

## Incorrect

```ts
import { test } from 'node:test';

test('creates a user', () => {});
```

## Correct

```ts
import { test } from '@rstest/core';

test('creates a user', () => {});
```

## Autofix

Changes an exact named import from `node:test` to an Rstest module when it imports only `test`, `it`, or `describe`.

The test API is reachable as both `@rstest/core` and `rstack/test`, and the fix writes whichever of the two the file already uses — in another import, a `require`, or a `/// <reference types="..." />` directive — so that the rewritten import resolves in the project it was written for. A file that names both, or names neither, gets `@rstest/core`.
