Skip to content

feat(linter): implement jsx-a11y/no-noninteractive-element-to-interactive-role #21195

@pedrotainha

Description

@pedrotainha

This rule enforces that non-interactive HTML elements are not assigned interactive roles (e.g., button, link, menuitem).

Non-interactive elements such as <div>, <li>, or <h1> should not be given interactive ARIA roles, as this creates accessibility issues — assistive technologies expect interactive elements to support focus and keyboard interaction.

Example

// Bad
<h1 role="button">Click me</h1>
<li role="link">Navigate</li>

// Good
<button>Click me</button>
<a href="/page">Navigate</a>

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions