where we would not expect the a11y-role-supports-props to raise anything, the code might assume that the implicit role is that of a <div> and is generic, and will flag an error.
Instead, when role is explicitly set but is NOT a literal prop, we should return undefined.
Currently, when
role
is set to anything other than a literal prop, the rest of the code runs and grabs the implicit role.As a result, even with something like:
where we would not expect the
a11y-role-supports-props
to raise anything, the code might assume that the implicit role is that of a<div>
and is generic, and will flag an error.Instead, when
role
is explicitly set but is NOT a literal prop, we should returnundefined
.