Skip to content

Rule · Lint

wheel / touchstart / touchmove listener without { passive: true }

lint/scroll-listener-nonpassivewarnvoid lintupdated

Why it matters

Non-passive wheel/touch listeners force the browser to wait for JavaScript before scrolling, which causes visible scroll jank on mobile.

How to fix it

Pass { passive: true }. If you truly need preventDefault(), pass { passive: false } explicitly and scope the listener to the smallest element. For scroll-linked effects prefer IntersectionObserver or CSS scroll-driven animations.

Example

ts
el.addEventListener('touchmove', onMove, { passive: true })

References

void lint reports 67 rules in this category. Static source checks with no browser: Tailwind v4 silent failures, Next.js 16 API traps, React render-body bugs, accessibility markup, SEO files and motion hygiene.