`src` is no longer required (if there's a `srcset`)
https://github.com/whatwg/html/pull/11300
The wording for that check is currently: “Older browsers or other user agents which don’t understand the srcset attribute should get a fallback image.”
Would you consider that to still be true?
Good question!
As for browsers, Can I Use says the last browser to support srcset was Edge 16, released in Oct 2017. The most-used browser that doesn't support srcset is IE 11, which still has 0.43% market share.
So we're talking tens of millions of people, who are at least occasionally browsing the web with software that doesn't understand srcset. Hopefully they get alt text (IIRC Picturefill decided that alt text was an acceptable fallback in no-JS contexts a very long time ago).
"Other user agents" is more difficult to wrap my head around. The spec change appears to have been blocked for a couple of years while Googlebot learned to look in srcsets; I'm sure there are many other things (crawlers/indexers, RSS readers, extensions...) that still rely on src, but I don't know how to get data on that, and I don't know enough about the use cases to know whether alt text is any kind of useful fallback, in these cases.
TL;DR might be worth being stricter than the spec itself and keeping the src requirement in, but it seemed worth a discussion.
If the linter would have levels like error, warning, notice I’d downgrade this to a notice I think.
For now we could soften the text like this: “Very old browsers or other user agents which don’t understand the srcset attribute could benefit from a fallback image. However, as of 2025 this is no longer required by the HTML specification.”
WDYT?
Sounds good to me!