jsx-eslint/eslint-plugin-react

Don't warn about react/jsx-no-target-blank when referrerPolicy is used

Open

#2398 opened on Sep 2, 2019

View on GitHub
 (7 comments) (1 reaction) (0 assignees)JavaScript (8,630 stars) (2,797 forks)batch import
enhancementhelp wanted

Description

We have in our code:

<a rel="noopener" referrerPolicy="no-referrer" target="_blank" href={fooURL}>foo</a>

But react/jsx-no-target-blank is complaining about it with:

 Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener  react/jsx-no-target-blank

Isn't it the same to have rel="noopener" and referrerPolicy="no-referrer" as having rel="noopener noreferrer"?

eslint-plugin-react@7.14.3

Contributor guide