Skip to content

Commit

Permalink
removed filter(boolean)
Browse files Browse the repository at this point in the history
  • Loading branch information
V2dha committed Aug 12, 2022
1 parent 9b595b9 commit f9937e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rules/jsx-no-target-blank.js
Expand Up @@ -103,13 +103,13 @@ function hasSecureRel(node, allowReferrer, warnOnSpreadAttributes, spreadAttribu

const relAttribute = node.attributes[relIndex];
const value = getStringFromValue(relAttribute.value);
return [].concat(value).filter(Boolean).every((item) => {
const tags = typeof item === 'string' && item.toLowerCase().split(' ');
return [].concat(value).every((item) => {
const tags = typeof item === 'string' ? item.toLowerCase().split(' ') : false;
const noreferrer = tags && tags.indexOf('noreferrer') >= 0;
const noopener = tags && tags.indexOf('noopener') >= 0;
if (noreferrer) {
return true;
}
const noopener = tags && tags.indexOf('noopener') >= 0;
return allowReferrer && noopener;
});
}
Expand Down

0 comments on commit f9937e2

Please sign in to comment.