What's Changed
🐞 Fixes
react-x/set-state-in-effect: the ref-derived value exemption now also applies tosetStatecalls reached indirectly — via a function or hook callback invoked from the effect setup (ex: ameasureOverflowuseCallbackcalled from the setup whosesetStatecarries DOM measurements) — previously onlysetStatewritten directly in the setup body was exempted. (#1982)react-x/set-state-in-effect: more ref read shapes are recognized as ref-derived values: a<ref-named>.currentlink anywhere in a member chain (ex:const surface = popover.contentRef.current), locals rooted at another ref-derived local (ex:scroller.clientWidthwhereconst scroller = scrollerRef.current), and reads through a parameter namedref/xxxRef(ex:function useDetect(ref) { ... ref.current ... }). (#1982)react-web-api/no-leaked-event-listener: aremoveEventListenerinside a function called from the effect cleanup now pairs with itsaddEventListener, fixing false positives for listeners added in event handlers but removed on unmount; cleanup calls are resolved to the actual functions they refer to, so shadowed same-named functions no longer pair by name coincidence. (#1982)
🏗️ Internal
- Bumped
effectto4.0.0and migrated the repo scripts to the v4 APIs. (#1981)
Full Changelog: v5.23.4...v5.23.5
Attestation
https://github.com/Rel1cx/eslint-react/attestations/52275386