Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsx-no-target-blank] Allow either noopener or noreferrer #1391

Conversation

ngyikp
Copy link

@ngyikp ngyikp commented Aug 23, 2017

I use noreferrer for my external links which also disables window.opener, but the rule insists on requiring noopener even though it's redundant.

According to the HTML5 Standard spec:

For historical reasons, the noreferrer keyword implies the behavior associated with the noopener keyword when present on a hyperlink that creates a new browsing context. That is, <a href="..." rel="noreferrer" target="_blank"> has the same behavior as <a href="..." rel="noreferrer noopener" target="_blank">.

Also fixes #776

See also GoogleChrome/lighthouse#2482 and GoogleChrome/lighthouse#2485

According to the HTML5 Standard spec:

> `<a href="..." rel="noreferrer" target="_blank">`
> has the same behavior as
> `<a href="..." rel="noreferrer noopener" target="_blank”>`

https://html.spec.whatwg.org/multipage/links.html#link-type-noreferrer
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The discussion at GoogleChrome/lighthouse#2485 is still unresolved; personally, I prefer the explicitness of requiring both.

Prior to the outcome of that discussion, I'd want the default to be "both", and a configurable option to allow "only noreferrer".

@Hypnosphi
Copy link
Contributor

The discussion at GoogleChrome/lighthouse#2485 is still unresolved

It is now: GoogleChrome/lighthouse#2485 (comment)

@ngyikp
Copy link
Author

ngyikp commented May 25, 2020

Closing PR as it's already done #2043

@ngyikp ngyikp closed this May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

enable configuration for jsx-no-target-blank
3 participants