Skip to content

Commit

Permalink
[Fix] jsx-no-target-blank: further improve error messages
Browse files Browse the repository at this point in the history
State that `rel="noreferrer"` is preferred and implies `rel="noopener"`.
  • Loading branch information
cutiful committed Sep 29, 2021
1 parent aa670df commit 4cd5543
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 @@ -97,8 +97,8 @@ function hasSecureRel(node, allowReferrer, warnOnSpreadAttributes, spreadAttribu
}

const messages = {
noTargetBlankWithoutNoreferrer: 'Using target="_blank" without rel="noreferrer" is a security risk in older browsers: see https://mathiasbynens.github.io/rel-noopener/#recommendations',
noTargetBlankWithoutNoopener: 'Using target="_blank" without rel="noopener" is a security risk: see https://mathiasbynens.github.io/rel-noopener/#recommendations'
noTargetBlankWithoutNoreferrer: 'Using target="_blank" without rel="noreferrer" (which implies rel="noopener") is a security risk in older browsers: see https://mathiasbynens.github.io/rel-noopener/#recommendations',
noTargetBlankWithoutNoopener: 'Using target="_blank" without rel="noreferrer" or rel="noopener" (the former implies the latter and is preferred due to wider support) is a security risk: see https://mathiasbynens.github.io/rel-noopener/#recommendations'
};

module.exports = {
Expand Down

0 comments on commit 4cd5543

Please sign in to comment.