Skip to content

Commit

Permalink
change literal to string
Browse files Browse the repository at this point in the history
  • Loading branch information
V2dha committed Jul 13, 2022
1 parent 8a6cf3a commit 30039fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rules/jsx-no-target-blank.js
Expand Up @@ -77,7 +77,7 @@ function getStringFromValue(value) {
const expr = value.expression;
if (expr.type === 'ConditionalExpression') {
if (
expr.consequent.type === 'Literal'
typeof expr.consequent.value === 'string'
&& (
(expr.consequent.value && expr.consequent.value.toLowerCase() === 'noreferrer')
|| (expr.consequent.value && expr.consequent.value.toLowerCase() === 'noopener noreferrer')
Expand All @@ -87,7 +87,7 @@ function getStringFromValue(value) {
return expr.consequent.value;
}
if (
expr.alternate.type === 'Literal'
typeof expr.alternate.value === 'string'
&& (
(expr.alternate.value && expr.alternate.value.toLowerCase() === 'noreferrer')
|| (expr.alternate.value && expr.alternate.value.toLowerCase() === 'noopener noreferrer')
Expand Down

0 comments on commit 30039fc

Please sign in to comment.