What's Changed
🐞 Fixes
- Lifecycle methods defined as class properties (ex:
componentDidMount = () => { this.setState(...) }, including type-expression-wrapped values) are now reported just like the method shorthand form. (#2039) Affected rules:react-x/no-set-state-in-component-did-mountreact-x/no-set-state-in-component-did-updatereact-x/no-set-state-in-component-will-update
- Effect cleanups are now recognized when the
useEffectcall is nested in an outerreturn(ex:return useEffect(() => () => { ... })), so resources released there are no longer reported as leaked. (#2039) Affected rules:react-web-api/no-leaked-event-listenerreact-web-api/no-leaked-fetchreact-web-api/no-leaked-intersection-observerreact-web-api/no-leaked-intervalreact-web-api/no-leaked-resize-observerreact-web-api/no-leaked-timeout
🏗️ Internal
@eslint-react/ast: added theCheck.isFunctionOrClassandCheck.isTypeOrChainExpressionhelpers; parent lookups acrossast,core, and the rules are now bounded at enclosing function/class boundaries. (#2039)@eslint-react/core:isUseEffectSetupCallbackandisUseEffectCleanupCallbackreimplemented on bounded parent lookups. (#2039)
Full Changelog: v5.27.0...v5.27.1
Attestation
https://github.com/Rel1cx/eslint-react/attestations/56083726