Skip to content

Commit

Permalink
fix variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
V2dha committed Jul 5, 2022
1 parent 20e029d commit 5285b91
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/rules/no-static-element-interactions.js
Expand Up @@ -101,12 +101,12 @@ export default ({
&& isNonLiteralProperty(attributes, 'role')
) {
// Special case if role is assigned using ternary with literals on both side
const rolePropVal = getProp(attributes, 'role');
if (rolePropVal && rolePropVal.type === 'JSXAttribute' && rolePropVal.value.type === 'JSXExpressionContainer') {
if (rolePropVal.value.expression.type === 'ConditionalExpression') {
const roleProp = getProp(attributes, 'role');
if (roleProp && roleProp.type === 'JSXAttribute' && roleProp.value.type === 'JSXExpressionContainer') {
if (roleProp.value.expression.type === 'ConditionalExpression') {
if (
rolePropVal.value.expression.consequent.type === 'Literal'
&& rolePropVal.value.expression.alternate.type === 'Literal'
roleProp.value.expression.consequent.type === 'Literal'
&& roleProp.value.expression.alternate.type === 'Literal'
) {
return;
}
Expand Down

0 comments on commit 5285b91

Please sign in to comment.