Skip to content

Commit

Permalink
Role assignment using ternary with literals on both side
Browse files Browse the repository at this point in the history
  • Loading branch information
V2dha committed Jul 1, 2022
1 parent a2c198e commit 4ff4a95
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/rules/no-static-element-interactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ export default ({
allowExpressionValues === true
&& isNonLiteralProperty(attributes, 'role')
) {
//Special Case if role assignment is done using ternary operator
//with literals on both side
//Special case if role is assigned using ternary with literals on both side
const rolePropVal = getPropValue(getProp(attributes, 'role'));
if (rolePropVal && rolePropVal.type === 'JSXExpressionContainer') {
if (rolePropVal.expression.type === 'ConditionalExpression') {
Expand Down

0 comments on commit 4ff4a95

Please sign in to comment.