Skip to content

Commit

Permalink
Update lib/rules/jsx-no-target-blank.js
Browse files Browse the repository at this point in the history
Co-authored-by: Jordan Harband <ljharb@gmail.com>
  • Loading branch information
V2dha and ljharb committed Jul 22, 2022
1 parent 97e8800 commit edd8812
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/rules/jsx-no-target-blank.js
Expand Up @@ -111,15 +111,15 @@ function hasSecureRel(node, allowReferrer, warnOnSpreadAttributes, spreadAttribu
const relAttribute = node.attributes[relIndex];
const value = getStringFromValue(relAttribute.value);
if (Array.isArray(value)) {
for (let index = 0; index < value.length; index++) {
const tags = value[index] && typeof value[index] === 'string' && value[index].toLowerCase().split(' ');
return [].concat(value).filter(Boolean).some((item) => {
const tags = typeof item === 'string' && item.toLowerCase().split(' ');
const noreferrer = tags && tags.indexOf('noreferrer') >= 0;
const noopener = tags && tags.indexOf('noopener') >= 0;
if (!noreferrer) {
return allowReferrer && noopener;
}
}
return true;
return false;
});
}
const tags = value && typeof value === 'string' && value.toLowerCase().split(' ');
const noreferrer = tags && tags.indexOf('noreferrer') >= 0;
Expand Down

0 comments on commit edd8812

Please sign in to comment.