Rslint
Rslint is an ESLint-compatible linter for JavaScript and TypeScript. Its built-in rstestPlugin adds rules for common mistakes in Rstest test definitions, assertions, mocks, and snapshots.
Install @rslint/core in your project, then enable the recommended preset in rslint.config.ts:
Dedicated test files
If your tests use filenames such as *.test.ts or *.spec.ts, scope the preset to the same file pattern that Rstest discovers by default:
This pattern covers JavaScript and TypeScript files with .js, .jsx, .ts, .tsx, .cjs, .cjsx, .cts, .ctsx, .mjs, .mjsx, .mts, and .mtsx extensions. The recommended preset does not declare a files pattern, so adding one keeps Rstest-specific rules focused on test files and leaves production files to your other Rslint configuration items.
In-source tests
With in-source testing, tests live alongside production code and use import.meta.rstest. Apply the preset to every linted file so it can check both in-source tests and dedicated test files:
No additional Rslint globals are required for import.meta.rstest.
Run Rslint
Run Rslint from your project root:
A successful run prints a summary similar to this:
When Rslint finds a problem, it reports the rule name, source location, code frame, and failure summary:
You can also add the command to the scripts section of package.json and run it through your package manager's lint script.
Explore the rules
The Rslint rstestPlugin preset documents the available configuration and usage patterns. To see which rules are included in the recommended preset, open the Rstest rules list.