💅 False positive for a11y/noInteractiveElementToNoninteractiveRole
#4228
Labels
A-Linter
Area: linter
good first issue
Good for newcomers
L-JavaScript
Language: JavaScript and super languages
Environment information
Rule name
a11y/noInteractiveElementToNoninteractiveRole
Playground link
https://biomejs.dev/playground/?code=PABwAGkAYwB0AHUAcgBlAD4ACgAgACAAPABzAG8AdQByAGMAZQAKACAAIAAgACAAcwByAGMAUwBlAHQAPQB7ACcALwBhAHMAcwBlAHQAcwAvAGgAZQBhAGQALgB3AGUAYgBwACcAfQAKACAAIAAgACAAcgBvAGwAZQA9ACcAaQBtAGcAJwAKACAAIAAgACAAdAB5AHAAZQA9ACcAaQBtAGEAZwBlAC8AdwBlAGIAcAAnAAoAIAAgAC8APgAKACAAIAA8AGkAbQBnAAoAIAAgACAAIABzAHIAYwA9AHsAJwAvAGEAcwBzAGUAdABzAC8AaABlAGEAZAAuAHAAbgBnACcAfQAKACAAIAAgACAAYQBsAHQAPQAnAEEAbgAgAEEAUwBDAEkASQAtAHMAdAB5AGwAZQAgAGgAZQBhAGQAcwBoAG8AdAAnAAoAIAAgAC8APgAKADwALwBwAGkAYwB0AHUAcgBlAD4A
Expected result
No error is produced. According to the MDN Web Docs,
<picture>
,<source>
,<img>
(with the exception of an<img>
tag with theusemap
attribute) are not considered interactive elements. Plus therole=img
is stating the true nature of the content.role=img
is set due to a long-term bug where SVGs are not always identified as images by screen readers.Code of Conduct
The text was updated successfully, but these errors were encountered: