Registry / testing / jest-runner-eslint

jest-runner-eslint

JSON →
library2.3.0jsnpmunverified

An ESLint runner for Jest v2.3.0 that integrates ESLint linting as a Jest test runner. It supports ESLint 7/8 and Jest 27-30, with flat config support since v2.1.0. Released under the jest-community organization, it is actively maintained with a release cadence of several times per year. Key differentiators include watch mode with fix toggling via a watch plugin, multi-project support, and cosmiconfig configuration.

npm install jest-runner-eslint
INSTALL
IMPORT
SIG · JEST-RUNNER-ESLINT
J
jest-runner-eslint
testingjavascriptv2.3.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

jest-runner-eslint
// In Jest config: runner: 'jest-runner-eslint'
const JestRunnerEslint = require('jest-runner-eslint'); // Not a direct import
Configure as a Jest runner, not imported directly.
jest-runner-eslint/watch-fix
watchPlugins: ['jest-runner-eslint/watch-fix']
Watch plugin to toggle --fix in watch mode.
default (cosmiconfig)
// In jest-runner-eslint.config.js: module.exports = { cliOptions: { fix: true } }
require('jest-runner-eslint').config(...) // No such export
Configuration via cosmiconfig, not programmatic import.

Sets up jest-runner-eslint as a project alongside Jest tests, with watch fix plugin.

// jest-eslint.config.js module.exports = { runner: 'jest-runner-eslint', displayName: 'lint', testMatch: ['<rootDir>/src/**/*.js'], // Optional: add watch plugin watchPlugins: ['jest-runner-eslint/watch-fix'], }; // jest.config.js (or package.json) module.exports = { projects: [ { displayName: 'test' }, '<rootDir>/jest-eslint.config.js', ], };
Debug
Known issues
breakingDropped support for Node 10, ESLint 6, Jest 25/26 in v2.0.0
fix
Upgrade Node to >=12.13.0, ESLint to >=7, Jest to >=27
affects: >=2.0.0
breakingFlat config support requires ESLint >=8.57.0 or ESLint 9 with flat config
fix
Use eslint.config.js and ensure ESLint version is compatible
affects: >=2.1.0
deprecatedJest 27-30 supported; older Jest versions are not supported
fix
Upgrade Jest to version 27 or later
affects: >=2.0.0
gotchaUse projects configuration to run alongside other Jest runners; otherwise testMatch must be scoped
fix
Use projects array in Jest config, or set testMatch to only lint files
affects: >=0
gotchacliOptions.fix was ignored until v2.1.1
fix
Upgrade to v2.1.1 or later
affects: <2.1.1
gotchaQuiet mode may not suppress warnings correctly before v2.1.2
fix
Upgrade to v2.1.2 or later
affects: <2.1.2
Errors
Common errors & fixes
Could not locate jest-runner-eslint config file
Missing cosmiconfig configuration file
fix
Create jest-runner-eslint.config.js or add jest-runner-eslint key in package.json
Jest: Test match is not scoped correctly
testMatch includes test files or includes all files
fix
Set testMatch to only include source files you want linted, e.g., '<rootDir>/src/**/*.js'
ESLint: Failed to load config 'eslint:recommended'
ESLint config not found or incompatible
fix
Ensure ESLint is installed and config file is correct; for flat config, use v2.1.0+
Cannot find module 'jest-runner-eslint'
Package not installed or not in correct node_modules
fix
Run npm install --save-dev jest-runner-eslint
Upgrade
Version history
2.3.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency, required to lint files
jestrequiredpeer dependency, required as the test framework
Agent activity
10 hits · last 30 days
node
10
Resources
jest-runner-eslint — npm install jest-runner-eslint · libregistry