Skip to content

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

Open
@pdewouters

Description

@pdewouters

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions