github Rel1cx/eslint-react v4.0.0-beta.0
v4.0.0-beta.0 (2026-03-24)

pre-release6 hours ago

What's Changed

💥 Breaking Changes

New eslint-plugin-react-jsx package

A new dedicated plugin for React Flavored JSX rules has been introduced. Several rules have been migrated from eslint-plugin-react-x and eslint-plugin-react-dom to this new package:

Old Rule (react-x/) New Rule (react-jsx/) Change
jsx-key-before-spread no-deoptimization relocated, renamed
jsx-no-comment-textnodes no-comment-textnodes relocated, renamed
no-children-prop no-children-prop relocated
no-useless-fragment no-useless-fragment relocated
Old Rule (react-dom/) New Rule (react-jsx/) Change
no-namespace no-namespace relocated

Rule prefix changes in @eslint-react/eslint-plugin

Rules from individual plugins now use a flattened naming convention when accessed through the unified @eslint-react/eslint-plugin package:

  • @eslint-react/<rule> -> @eslint-react/<rule> (no changes)
  • @eslint-react-jsx-<rule> -> @eslint-react-jsx-<rule> (no changes)
  • @eslint-react/rsc/<rule> -> @eslint-react/rsc-<rule>
  • @eslint-react/dom/<rule> -> @eslint-react/dom-<rule>
  • @eslint-react/web-api/<rule> -> @eslint-react/web-api-<rule>
  • @eslint-react/naming-convention/<rule> -> @eslint-react/naming-convention-<rule>
  • @eslint-react/debug/<rule> -> @eslint-react/debug-<rule>

Removed Rules from eslint-plugin-react-x

The following rules have been removed from eslint-plugin-react-x:

Rule Replaced by
react-x/jsx-dollar @eslint-react/kit (custom rule)
react-x/jsx-shorthand-boolean @eslint-react/kit (custom rule)
react-x/jsx-shorthand-fragment @eslint-react/kit (custom rule)

JSX utilities extracted from @eslint-react/core to @eslint-react/jsx

The JSX module has been extracted from @eslint-react/core into a new standalone @eslint-react/jsx package. The following exports are no longer available from @eslint-react/core:

  • JsxInspector class — removed, replaced with standalone utility functions from @eslint-react/jsx (e.g. findAttribute, hasAttribute, getChildren, isElement, isFragmentElement, isHostElement, isJsxLike, etc.)
  • JsxConfig, JsxDetectionHint, JsxAttributeValue — moved to @eslint-react/jsx
  • getElementType — renamed to getElementFullType in @eslint-react/jsx
  • getElementSelfName — renamed to getElementSelfType in @eslint-react/jsx

Removed ref APIs from @eslint-react/core

The following ref-related APIs have been removed from @eslint-react/core without replacement:

  • isRefId
  • isInitializedFromRef
  • getRefInit
  • isRefLikeName

Core collector API renames

The collector APIs in @eslint-react/core have been renamed:

Before After
useComponentCollector() getComponentCollector()
useComponentCollectorLegacy() getComponentCollectorLegacy()
useHookCollector() getHookCollector()
Collector return property .ctx Collector return property .api

✨ New

  • @eslint-react/kit: New utility module for building custom ESLint rules with React awareness. Provides defineConfig(), merge(), and a RuleToolkit interface with pre-bound context helpers for component/hook analysis.
  • @eslint-react/jsx: New utility package for static analysis of JSX patterns in TSESTree ASTs, extracted from @eslint-react/core.
  • eslint-plugin-react-jsx: New plugin dedicated to React Flavored JSX rules. Ships with recommended and strict config presets.
  • react-jsx/no-namespace: New rule that disallows JSX namespace syntax, as React does not support them.
  • react-jsx/no-deoptimization: New rule that prevents patterns causing deoptimization when using the automatic JSX runtime (e.g. placing key after spread props).
  • react-jsx/no-children-prop-with-children: New rule that disallows passing children as a prop when children are also passed as nested content.
  • New jsx and disable-jsx config presets in @eslint-react/eslint-plugin.
  • New react-dom-with-custom-rules example project demonstrating custom rule creation with @eslint-react/kit.

🪄 Improvements

  • react-jsx/no-children-prop: Add suggestion-fix feature to move children from prop to element content.

✅ Upgrade Checklist

Use this checklist to upgrade from v3.x to v4.0.0:

Package changes

  • Install the new eslint-plugin-react-jsx package — this is a new dedicated plugin for React Flavored JSX rules.
  • If you depend on JSX utilities from @eslint-react/core, install @eslint-react/jsx and update imports accordingly.

ESLint configuration

  • Replace react-x/jsx-key-before-spread with react-jsx/no-deoptimization in your ESLint config.
  • Replace react-x/jsx-no-comment-textnodes with react-jsx/no-comment-textnodes in your ESLint config.
  • Replace react-x/no-children-prop with react-jsx/no-children-prop in your ESLint config.
  • Replace react-x/no-useless-fragment with react-jsx/no-useless-fragment in your ESLint config.
  • Replace react-dom/no-namespace with react-jsx/no-namespace in your ESLint config.

Rule prefix changes in @eslint-react/eslint-plugin

If you use the unified @eslint-react/eslint-plugin package, update the following rule prefixes (slash \/ -> dash -):

  • Replace @eslint-react/rsc/<rule> with @eslint-react/rsc-<rule> in your ESLint config.
  • Replace @eslint-react/dom/<rule> with @eslint-react/dom-<rule> in your ESLint config.
  • Replace @eslint-react/web-api/<rule> with @eslint-react/web-api-<rule> in your ESLint config.
  • Replace @eslint-react/naming-convention/<rule> with @eslint-react/naming-convention-<rule> in your ESLint config.
  • Replace @eslint-react/debug/<rule> with @eslint-react/debug-<rule> in your ESLint config.

Review new rules

  • react-jsx/no-children-prop-with-children — new rule that disallows passing children as a prop when children are also passed as nested content. Review your codebase for new reports if using presets.

Removed rules

  • react-x/jsx-dollar
  • react-x/jsx-shorthand-boolean
  • react-x/jsx-shorthand-fragment

If you still need these rules, you can enforce them using the new @eslint-react/kit by creating custom rules that implement the desired checks.

Core API changes (for custom rule authors)

  • Replace useComponentCollector() with getComponentCollector().
  • Replace useComponentCollectorLegacy() with getComponentCollectorLegacy().
  • Replace useHookCollector() with getHookCollector().
  • Replace collector return property .ctx with .api.
  • Replace JsxInspector.from(context) usage with standalone utility functions from @eslint-react/jsx.
  • Replace getElementType() with getElementFullType() from @eslint-react/jsx.
  • Replace getElementSelfName() with getElementSelfType() from @eslint-react/jsx.
  • Remove usage of deleted ref APIs (isRefId, isInitializedFromRef, getRefInit, isRefLikeName).
  • Update JSX-related imports from @eslint-react/core to @eslint-react/jsx.

Full Changelog: v3.0.0...v4.0.0-beta.0

Don't miss a new eslint-react release

NewReleases is sending notifications on new releases.