Releases: Rel1cx/eslint-react
Releases · Rel1cx/eslint-react
v2.0.0 (2025-09-26)
What's Changed
💥 Breaking Changes
Target Environment Updates: Now ESM and ESLint Flat Config Only
- Drop support for CommonJS (CJS) module format, packages are now distributed only as ECMAScript Modules (ESM)
- Drop support for ESLint legacy config system, packages now support only ESLint Flat Config (
eslint.config.js
) - Drop support for Node.js 16 and 18, minimum required version is now Node.js 20
- Drop support for ESLint 8, minimum required version is now ESLint 9.3.6
- Drop support for TypeScript 4, minimum required version is now TypeScript 5.9.2
Removed Rules
Rule | Replaced by | Reason |
---|---|---|
react-x/avoid-shorthand-boolean |
react-x/jsx-shorthand-boolean |
consolidated |
react-x/avoid-shorthand-fragment |
react-x/jsx-shorthand-fragment |
consolidated |
react-x/ensure-forward-ref-using-ref |
react-x/no-useless-forward-ref |
renamed |
react-x/jsx-no-duplicate-props |
react-x/jsx-no-duplicate-props |
renamed |
react-x/no-comment-textnodes |
react-x/jsx-no-comment-textnodes |
renamed |
react-x/no-complicated-conditional-rendering |
discontinued | |
react-x/no-nested-components |
react-x/no-nested-component-definitions |
renamed |
react-x/prefer-react-namespace-import |
react-x/prefer-namespace-import |
renamed |
react-x/prefer-shorthand-boolean |
react-x/jsx-shorthand-boolean |
consolidated |
react-x/prefer-shorthand-fragment |
react-x/jsx-shorthand-fragment |
consolidated |
react-x/use-jsx-vars |
react-x/jsx-uses-vars |
renamed |
react-dom/no-children-in-void-dom-elements |
react-dom/no-void-elements-with-children |
renamed |
react-hooks-extra/no-direct-set-state-in-use-layout-effect |
react-hooks-extra/no-direct-set-state-in-use-effect |
consolidated |
react-hooks-extra/no-unnecessary-use-callback |
react-x/no-unnecessary-use-callback |
relocated |
react-hooks-extra/no-unnecessary-use-memo |
react-x/no-unnecessary-use-memo |
relocated |
react-hooks-extra/no-unnecessary-use-prefix |
react-x/no-unnecessary-use-prefix |
relocated |
react-hooks-extra/prefer-use-state-lazy-initialization |
react-x/prefer-use-state-lazy-initialization |
relocated |
Removed Presets
Preset | Replaced by | Reason |
---|---|---|
core |
x |
renamed |
core-legacy |
discontinued | |
off-dom |
disable-dom |
renamed |
off-dom-legacy |
discontinued | |
x-legacy |
discontinued | |
dom-legacy |
discontinued | |
web-api-legacy |
discontinued | |
recommended-legacy |
discontinued | |
recommended-typescript-legacy |
discontinued | |
recommended-type-checked-legacy |
discontinued |
Removed Settings
Setting | Replaced by | Reason |
---|---|---|
additionalComponents |
discontinued | |
additionalHooks |
discontinued | |
skipImportCheck |
discontinued |
The rule implementations have been refactored to improve performance and maintainability.
✨ New
Added the following new rules:
react-x/jsx-shorthand-boolean
: Enforces a consistent style for boolean attributes by @Rel1cxreact-x/jsx-shorthand-fragment
: Enforces a consistent style for React Fragments by @Rel1cxreact-x/no-forbidden-props
: Disallows specific props on components by @retepsreact-x/no-unnecessary-key
: Reports unnecessarykey
props on elements by @Rel1cx @kachkaevreact-x/no-unused-props
: Reports unused props in components by @ulrichstarkreact-dom/no-string-style-prop
: Disallows string values for thestyle
prop by @Rel1cx @karlhorkyreact-dom/prefer-namespace-import
: Enforces using a namespace import forreact-dom
by @Rel1cx
Added the following new rule to the recommended-type-checked
preset:
react-x/no-unused-props
: Reports unused props in components
The following rules now support Codemod features:
react-x/no-component-did-update
by @Rel1cxreact-x/no-component-will-receive-props
by @Rel1cxreact-x/no-component-will-update
by @Rel1cxreact-x/no-context-provider
by @Rel1cxreact-x/no-forward-ref
by @Rel1cxreact-x/no-string-refs
by @Rel1cx
The following rules now support auto-fix:
react-x/no-missing-context-display-name
by @k-yle
The following rules now support suggestion fixes:
react-dom/no-missing-button-type
by @Rel1cxreact-dom/no-missing-iframe-sandbox
by @Rel1cxreact-dom/no-unsafe-target-blank
by @Rel1cx
New configuration preset added:
disable-conflict-eslint-plugin-react
: Disable rules ineslint-plugin-react
that conflict with rules in our plugins by @reteps
🐞 Fixes
- fix(react-x/no-unnecessary-use-prefix): fix false positive of React Hooks defined within the callback function of
vi.mock(...)
in Vitest test files by @Rel1cx - fix(react-web-api/no-leaked-event-listener): fix
useEffect
setup function check to handleReact.useEffect()
calls correctly by @Rel1cx - fix(react-naming-convention/filename): fix false positive on well-known filenames like
404.tsx
,_app.tsx
,[slug].tsx
by @Rel1cx
🪄 Improvements
- refactor: simplify React APIs detection logic by @Rel1cx
- refactor: cleanup utilities and simplify rule implementations by @Rel1cx
- docs: add comparison table between
eslint-plugin-react
andeslint-react
rules by @reteps - docs: replace
tseslint.config
withdefineConfig
in all examples by @Rel1cx - build: migrate build system from
tsup
totsdown
for better performance by @Rel1cx
Full Changelog: v1.53.1...v2.0.0
Thanks to all contributors who made this release possible!
v1.53.1 (2025-09-11)
What's Changed
🐞 Fixes
- fix: fix
useEffect
setup function check inweb-api/no-leaked-event-listener
, closes #1228 by @Rel1cx in #1229
Full Changelog: v1.53.0...v1.53.1
v1.53.0 (2025-09-04)
v1.52.9 (2025-08-31)
What's Changed
🐞 Fixes
- fix: issue introduced in version v1.52.7 where the
react-hooks-extra
rules were not exported, closes #1207 by @Rel1cx in #1208
Full Changelog: v1.52.8...v1.52.9
v1.52.8 (2025-08-29)
v1.52.7 (2025-08-29)
v1.52.6 (2025-08-18)
What's Changed
🐞 Fixes
- fix: correct logic in
naming-convention/component-name
validation to continue on valid names, closes #1176 by @Rel1cx in #1177
Full Changelog: v1.52.5...v1.52.6
v1.52.5 (2025-08-15)
What's Changed
🐞 Fixes
- fix: refactor
is-from-react
utility inreact-debug/is-from-react
rule and improvereact-x/no-forward-ref
rule autofix handling, closes #1172 by @Rel1cx in #1173
Full Changelog: v1.52.4...v1.52.5
v1.52.4 (2025-08-13)
What's Changed
🐞 Fixes
- fix: improve logic for detecting significant children in JSX elements, closes #1163 by @Rel1cx in #1165
Full Changelog: v1.52.3...v1.52.4