Skip to content

PERF006 · Responsive image

Severity: info

Flags an <img> without a srcset attribute. This rule runs in static (CLI) analysis only.

An <img> without srcset ships one fixed-size asset to every device, wasting bytes on small screens. Static analysis cannot measure the intended display size, so this is advisory.

Add a srcset (and sizes) so the browser can pick a right-sized image:

<img
src="/hero.jpg"
srcset="/hero-800.jpg 800w, /hero-1600.jpg 1600w"
sizes="100vw"
width="1600"
height="900"
alt=""
/>