Registry / testing / eslint-plugin-jest-react

eslint-plugin-jest-react

JSON →
library0.1.0jsnpmunverified

An ESLint plugin providing linting rules for Jest tests in React projects. Current stable version is 0.1.0, with low release cadence (last update likely stale). Key differentiator: combines Jest and React specific rules. However, the official community ESLint Jest plugin (eslint-plugin-jest) is more actively maintained and recommended; this plugin may have niche value only for the `no-mocking-react` rule.

npm install eslint-plugin-jest-react
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-JEST
E
eslint-plugin-jest-react
testingjavascriptv0.1.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.

plugin:jest-react/recommended
extends: ['plugin:jest-react/recommended']
plugins: ['jest-react'] without extends
Use the recommended config to enable all rules with sensible defaults.
Rules (e.g., jest-react/no-mocking-react)
{ "rules": { "jest-react/no-mocking-react": "warn" } }
plugins: ['jest-react'] but not adding rules
Rules are prefixed with 'jest-react/' in ESLint configs.
Plugin declaration
plugins: ['jest-react']
plugins: ['eslint-plugin-jest-react']
ESLint automatically shortens the plugin name; you only need 'jest-react'.

Shows how to install and configure the plugin in ESLint to lint Jest tests in React projects.

// Install: yarn add --dev eslint eslint-plugin-jest-react // .eslintrc.js module.exports = { plugins: ['jest-react'], extends: ['plugin:jest-react/recommended'], rules: { 'jest-react/no-mocking-react': 'error' } };
Debug
Known issues
breakingPlugin is not maintained; last update over 2 years ago. Consider using active alternatives like eslint-plugin-jest.
fix
Switch to eslint-plugin-jest and eslint-plugin-testing-library for React testing patterns.
affects: all
deprecatedeslint-plugin-jest-react may not work with ESLint >= 9 due to config changes (flat config).
fix
Use ESLint 8 with .eslintrc format, or migrate to flat config with compatible plugins.
affects: 0.1.0
gotchaThe recommended config 'plugin:jest-react/recommended' may enable rules that conflict with Jest's environment or other ESLint rules.
fix
Review each rule after extending the recommended config, and disable/override as needed.
affects: all
Errors
Common errors & fixes
Error: Failed to load plugin 'jest-react'
Missing peer dependency 'eslint' or plugin not installed.
fix
Run: yarn add --dev eslint eslint-plugin-jest-react
Configuration for rule 'jest-react/no-mocking-react' is invalid
Rule configured with wrong severity or extra options.
fix
Use standard severity: 'off', 'warn', or 'error'.
Parsing error: 'import' and 'export' may only appear at the top level
ESLint parser does not support ES modules by default.
fix
Add 'parserOptions: { sourceType: 'module' }' in ESLint config.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required as the plugin integrates with ESLint
Agent activity
5 hits · last 30 days
node
4
Resources
eslint-plugin-jest-react — npm install eslint-plugin-jest-react · libregistry