ESLint rules for Jest tests
open sourceMITfree
eslint-plugin-jest adds about 70 rules for Jest test files to ESLint: catching focused or disabled tests, duplicate test titles and invalid expect calls, and preferring clearer matchers. It ships recommended and style configs for flat and legacy configuration, some rules use TypeScript type information, and it can be pointed at other test frameworks such as Vitest or Bun's test runner, though its rules assume Jest's semantics.
Problems it solves
- stop a focused or skipped Jest test from being committed
- lint Jest test files for common mistakes
- enforce consistent Jest matchers across a JavaScript project
Features
- about 70 lint rules for Jest test files
- recommended, style and all configs for flat and legacy ESLint configuration
- rules that use TypeScript type information
- configurable for other test frameworks such as Vitest and Bun
Limitations
Alternatives
The same job
These do what eslint-plugin-jest does.
- RuboCop RSpec RuboCop extension with cops for RSpec test files
- actionlint Static checker for GitHub Actions workflow files
- eslint-plugin-react React-specific linting rules for ESLint
- yamllint A linter for YAML files
- ESLint Find and fix problems in your JavaScript code.
- Credo Static code analysis for Elixir, with a focus on teaching and code consistency
