Effect with no cleanup for a subscription or timer
Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 8 points from that category, once per scan, no matter how many places it turns up.
What it detects
A useEffect that registers an event listener, interval, animation frame, or subscription but returns no cleanup function leaks that handler on every re-run and on unmount. Heuristic: it cannot see cleanups performed outside the effect body.
Why it matters
An effect that adds an event listener, starts an interval, requests animation frames, or opens a subscription but returns no cleanup function leaves that handler running after the component unmounts and stacks a new one every time the effect re-runs. The result is memory leaks, duplicate handlers firing, and "set state on an unmounted component" warnings. This is a heuristic and does not see cleanups done outside the effect body.
How to fix it
Return a cleanup function from the effect that tears down whatever it set up: removeEventListener, clearInterval, cancelAnimationFrame, or subscription.unsubscribe(). The cleanup runs before each re-run and on unmount, so the setup and teardown stay balanced.
The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing
Does your repo trip this check?
Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.
Scan your repo