Skip to content

prefer-tag-over-role false positives on React components #1057

@mihkeleidast

Description

@mihkeleidast

For example:

<Image role="img" />

From the docs, it seems like it's supposed to only target HTML elements, but currently it also reports failures on React components.

Just because a component has a role prop with values that happen to match one of the ARIA roles, it is not enough to suggest replacing such a component with a native HTML element. There is no way of knowing what the component does with the prop internally, or if it even makes it to a HTML element role attribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions