Registry / testing / eslint-plugin-react-jsx

eslint-plugin-react-jsx

JSON →
library4.2.3jsnpmunverified

An ESLint plugin for React JSX rules, part of the eslint-react monorepo. The current stable version is v4.2.3, requiring Node.js >=22.0.0 and ESLint ^10.0.0 with TypeScript. It provides fine-grained control over JSX syntax and patterns beyond what eslint-plugin-react offers, with strong TypeScript support and custom rule examples. Note: the project has moved to v5.x beta releases with breaking changes – stick to v4.x for stability.

npm install eslint-plugin-react-jsx
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-REAC
E
eslint-plugin-react-jsx
testingjavascriptv4.2.3
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

default
✓ import plugin from 'eslint-plugin-react-jsx'
✗ const plugin = require('eslint-plugin-react-jsx')
ESM-only; CJS require() fails in Node >=22. Use dynamic import() if needed.
rules
✓ import { rules } from 'eslint-plugin-react-jsx'
✗ const { rules } = require('eslint-plugin-react-jsx')
Named export for accessing individual rule definitions.
configs
✓ import { configs } from 'eslint-plugin-react-jsx'
Exported config presets like 'recommended'.

Flat ESLint config using the plugin with two recommended JSX rules.

import plugin from 'eslint-plugin-react-jsx'; export default [ { plugins: { 'react-jsx': plugin, }, rules: { 'react-jsx/no-unstable-nested-components': 'error', 'react-jsx/no-leaked-conditional-rendering': 'warn', }, }, ];
Debug
Known issues
breakingv5.x drops support for Node <22.0.0 and ESLint <10.0.0.
fix
Upgrade Node to >=22.0.0 and ESLint to ^10.0.0.
affects: >=5.0.0
deprecatedRule `component-hook-factories` removed in v5.5.0-beta.0.
fix
Remove the rule from your config; use eslint-plugin-react-hooks equivalent instead.
affects: >=5.5.0-beta.0
gotchaESM-only package – CJS require() throws in Node >=22 with ESM resolution.
fix
Use `import()` or ensure your project is ESM.
affects: >=4.0.0
gotchaSome rules (e.g., `no-unstable-nested-components`) require type checking and fail silently if TypeScript is not installed or configured.
fix
Install TypeScript as a peer dependency and enable linting with `parserOptions.project`.
affects: >=4.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-plugin-react-jsx'
Package not installed or not in node_modules.
fix
Run `npm install eslint-plugin-react-jsx --save-dev`.
TypeError: plugin is not a function
Using CJS `require()` with ESM-only package.
fix
Use `import plugin from 'eslint-plugin-react-jsx'` or `const plugin = (await import('eslint-plugin-react-jsx')).default`.
Parsing error: The keyword 'import' is reserved
ESLint is not configured for ES modules.
fix
Set `"type": "module"` in package.json or use `.mjs` extension for config file.
Upgrade
Version history
4.2.3latest on npm
Audit
Dependencies
eslintrequiredPeer dependency; plugin works as an ESLint rule harness.
typescriptoptionalPeer dependency; required for type-checking rules.
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-react-jsx — npm install eslint-plugin-react-jsx · libregistry