coding-standards icon indicating copy to clipboard operation
coding-standards copied to clipboard

react/jsx-no-target-blank message is not strictly correct

Open pdewouters opened this issue 4 years ago • 0 comments

The following wil trigger a warning: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener

<a href="" target="_blank" rel="noreferrer">link text</a>
Screenshot 2021-06-22 at 09 07 36

However, checking the MDN docs, ( https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/noreferrer ), we can see that noreferrer implies noopener unless I'm misunderstanding.

Additionally, if only noopener is required, then we only need target="_blank" as this will now imply it by default in major browsers

pdewouters avatar Jun 22 '21 08:06 pdewouters