Skip to content

Rule · Lint

Raw <img> in a Next.js app

lint/img-rawwarnvoid lintupdated

Why it matters

skips Next's image pipeline: no responsive srcset, no AVIF/WebP, no lazy loading by default and no intrinsic size reservation, so it is usually the largest LCP and CLS cost on the page.

How to fix it

Use next/image with width/height (or fill + sizes). Raw is fine for SVG icons, data URIs and ImageResponse OG images.

Example

tsx
import Image from 'next/image'
<Image src={hero} alt="Dashboard overview" sizes="(min-width: 1024px) 50vw, 100vw" />

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.