Announcing v5.6.0
A major release featuring core API refactoring, kit API simplification, new rules, and class component support deprecation
This release consolidates all changes since v4.2.1.
Core API Refactoring
The @eslint-react/core package underwent a large-scale flattening refactor. Modules previously scattered across subdirectories like component/, function/, hook/, semantic/, and api/ have been merged into the root directory. Several core APIs have been renamed:
| Before | After |
|---|---|
isReactAPI | isAPI |
isReactAPICall | isAPICall |
isInitializedFromReact | isAPIFromReact |
isInitializedFromReactNative | isAPIFromReactNative |
ComponentDetectionHint | FunctionComponentDetectionHint |
ComponentFlag | FunctionComponentFlag |
getComponentCollector | getFunctionComponentCollector |
getComponentCollectorLegacy | getClassComponentCollector |
Type utilities (type-is, type-name, type-variant) have been migrated from eslint-plugin-react-x to @eslint-react/core, and the Toolkit interface in @eslint-react/kit has been updated to reflect these naming changes.
Kit API Simplification
The @eslint-react/kit package has been streamlined:
- Simplified
RuleToolkit.isAPI: Pre-built identifier predicates (memo,lazy,forwardRef, etc.) have been removed. Only*Callvariants andAPI/APICallfactories remain. - Renamed initialization checkers:
| Before | After |
|---|---|
initializedFromReact | APIFromReact |
initializedFromReactNative | APIFromReactNative |
Code using is.memo(node), is.lazy(node), etc. must migrate to is.memoCall(node) or use is.API("memo")(node).
Removed Rules
The following rules have been removed from their respective packages:
| Rule | Package | Notes |
|---|---|---|
component-hook-factories | react-x | Removed from all configs |
no-redundant-should-component-update | react-x | Removed from all configs |
no-unnecessary-use-callback | react-x | Removed from all configs |
no-unnecessary-use-memo | react-x | Removed from all configs |
no-unused-state | react-x | Removed from all configs |
prefer-destructuring-assignment | react-x | Removed from all configs |
prefer-namespace-import | react-x | Removed from all configs |
prefer-namespace-import | react-dom | Removed from all configs |
debug/class-component | react-debug | Removed from all configs |
Class Component Support Deprecation
All Class Component-related detection functions in the core package (such as isClassComponent, isPureComponent, and various lifecycle checkers) have been marked as @deprecated, retaining only minimal compatibility support for existing rules.
Rules in eslint-plugin-react-web-api, including no-leaked-event-listener, no-leaked-interval, and no-leaked-timeout, have removed detection for Class Component lifecycles (componentDidMount / componentWillUnmount) and now only report on Hook Effects (useEffect, etc.).
New Rules
react-x/globals: Restricts usage of global variables in React components.react-x/static-components: Enforces static component definitions. Enhanced with variable reference tracking and acreatedHerediagnostic to reduce false positives.react-web-api/no-leaked-fetch: Detects leakedfetchcalls in effects, closing #1714.
Kit Enhancements
- Added
ast.findParentutility for traversing AST ancestors. - Added support for Universally Unique Lexicographically Sortable Identifiers (ULID) for anonymous rules (later migrated to
node:crypto randomBytes).
Bug Fixes
react-x/error-boundaries: Fixed false positives on non-React code and resolved catch block over-reporting.react-x/set-state-in-effect: Improved validation accuracy.react-x/use-memo: Added reassignment check, aligned message IDs, and added support forfor-of/for-inloops.- Configs: Added missing rules to presets, cleaned up experimental disables, and updated documentation.
- Type expressions: Added missing
Extract.unwrapfor type expressions and chain expressions; unwrapped type expressions before inspecting AST node types.
Improvements
ast: Normalized API naming conventions; renamedisJSXLike→isJSXElementOrFragmentandisMethodOrProperty→isPropertyOrMethod; rewrote Check helpers.- Extracted ESLint types and utilities into the
@eslint-react/eslintpackage. - Extracted
@eslint-react/jsxfrom@eslint-react/coreinto a standalone utility package for static analysis of JSX patterns. - Migrated to
@and#path aliases and replacedtsxwithvite-node. - Moved pattern utilities to rule directories and extracted rule helpers into co-located
lib.tsmodules across multiple plugins. - Replaced
RuleConfigwithLinter.RulesRecordfrom ESLint. - Restructured monorepo packages directory layout.
react-rsc/function-definition: Added directive position and quote checks.- Website: Added inline TOCs, improved navigation, enabled twoslash type-checking for code examples, improved accessibility, and unified layout configuration.
- Testing: Expanded compiler fixture coverage across 9 rules; added comprehensive unit tests for component/hook detection utilities.
Migration Guide
Core API migration (for custom rule authors)
- Replace
isReactAPIwithisAPI. - Replace
isReactAPICallwithisAPICall. - Replace
isInitializedFromReactwithisAPIFromReact. - Replace
isInitializedFromReactNativewithisAPIFromReactNative. - Replace
ComponentDetectionHintwithFunctionComponentDetectionHint. - Replace
ComponentFlagwithFunctionComponentFlag. - Replace
getComponentCollectorwithgetFunctionComponentCollector. - Replace
getComponentCollectorLegacywithgetClassComponentCollector.
Kit API migration
- Replace
is.memo(node),is.lazy(node), etc. withis.memoCall(node)oris.API("memo")(node). - Replace
initializedFromReactwithAPIFromReact. - Replace
initializedFromReactNativewithAPIFromReactNative. - Replace
RuleDefinitiontype withRuleFunction.
Removed rules
- Remove
react-x/component-hook-factories. - Remove
react-x/no-redundant-should-component-update. - Remove
react-x/no-unnecessary-use-callback. - Remove
react-x/no-unnecessary-use-memo. - Remove
react-x/no-unused-state(re-added as a no-op rule in v5.6.6). - Remove
react-x/prefer-destructuring-assignment. - Remove
react-x/prefer-namespace-importandreact-dom/prefer-namespace-import. - Remove
react-debug/class-component.
Class Component deprecation
- Review any reliance on Class Component lifecycle detection in
react-web-api/no-leaked-event-listener,react-web-api/no-leaked-interval, andreact-web-api/no-leaked-timeout. These rules now only report on Hook Effects.
References
- Changelog: v5.6.0
- Full Changelog: v4.2.1...v5.6.0