useeffect-timer-no-cleanup
useEffect schedules setInterval/setTimeout without returning a cleanup function that clears it.
Applies to: JavaScript, TypeScript
Why this matters
React calls your useEffect on every dependency change and once more on unmount. If the effect starts a setInterval without returning a cleanup that calls clearInterval, each re-render layers a new timer on top of the old ones. The old timers still hold closures over props/state/refs, so React cannot garbage-collect the associated component trees. Over long-lived dev sessions — or production dashboards that rarely unmount — this accumulates into a visible memory leak. Return () => clearInterval(id) / clearTimeout(id) from the effect so every re-run releases the previous timer.
Catch it before it ships
pip install stablestack # or: npx stablestackstablestack # scans your project, FRONT010 includedstablestack explain FRONT010FRONT010 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.
False positive in your codebase? Suppress a single line with # noqa: FRONT010
More Frontend checks
tabs-url-routing
MUI Tabs should use URL routing via useSearchParams for bookmarkable/shareable tabs.
FRONT002window-ssr-unsafe
Accessing window/document without SSR check causes server-side errors
FRONT003inline-jsx-handler
Inline arrow functions in JSX cause unnecessary re-renders
FRONT004nextjs-redirect-request-url
Redirect uses request.url as URL base, which is wrong behind a reverse proxy.
FRONT005useeffect-side-effect-unguarded
useEffect contains a mutating HTTP call without a guard against double-firing.
FRONT006stale-time-dependent-ui
Time-dependent filtering without a re-render timer will show stale data.
FRONT007unbounded-ai-output
AI/LLM output rendered in JSX without truncation or overflow handling.
FRONT008loading-returns-null
Returning null during loading causes layout shift and flash of empty content.