being interpreted as having a generic role despite the as="a" and the presence of an href. This is because the href for getLiteralPropValue returns undefined, so the linter thinks that <Foo /> is an anchor tag without an href.
We do care about the literal value of role so we want to call getLiteralPropValue, but for the other attributes like this href, we only care about the presence of the attribute.
Therefore, I've updated the logic accordingly and added tests which would fail without this change.
In https://github.com/github/eslint-plugin-github/pull/461, we switched to use
getLiteralPropValue
in thegetRole
definition. However, this is resulting in:being interpreted as having a
generic
role despite theas="a"
and the presence of an href. This is because thehref
forgetLiteralPropValue
returns undefined, so the linter thinks that<Foo />
is an anchor tag without an href.We do care about the literal value of
role
so we want to callgetLiteralPropValue
, but for the other attributes like thishref
, we only care about the presence of the attribute.Therefore, I've updated the logic accordingly and added tests which would fail without this change.