Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

target="_blank" rel="noreferrer" implies noopener #571

Closed
simonhaenisch opened this issue Oct 22, 2018 · 1 comment
Closed

target="_blank" rel="noreferrer" implies noopener #571

simonhaenisch opened this issue Oct 22, 2018 · 1 comment
Labels
Difficulty: Easy Someone with little to no experience in TSLint should be able to send a pull request for this issue. Good First Issue 🙌 Howdy, neighbor! Status: Accepting PRs Type: Rule Feature Adding a feature to an existing rule.
Milestone

Comments

@simonhaenisch
Copy link

<a href="#" target="_blank" rel="noreferrer"></a>

[tslint] Anchor tags with target="_blank" should also include rel="noopener noreferrer"

But, as pointed out here: https://twitter.com/_developit/status/1054422343609655296

<a rel="noreferrer"> implies noopener. Specifying both is redundant.

jsx-eslint/eslint-plugin-react#2022

@JoshuaKGoldberg JoshuaKGoldberg added Status: Accepting PRs Good First Issue 🙌 Howdy, neighbor! Difficulty: Easy Someone with little to no experience in TSLint should be able to send a pull request for this issue. Type: Rule Feature Adding a feature to an existing rule. Hacktoberfest labels Oct 23, 2018
@JoshuaKGoldberg
Copy link

Thanks for pointing this out @simonhaenisch!

As ljharb mentioned in the eslint-plugin-react reference, it's unclear which browsers support that behavior. It wouldn't be surprising if IE behaved wrongly here. We could add an option for this rule to allow not enforcing noopener if noreferrer is there.

JoshuaKGoldberg pushed a commit that referenced this issue Oct 25, 2018
…574)

* Fix #571: avoid redundant rel attribute

* #574 Add option to force redundancy

* Fix #571: avoid redundant rel attribute

* #574 Add option to force redundancy

* #574 Update 'react-anchor-blank-noopener' doc to introduce option
@JoshuaKGoldberg JoshuaKGoldberg added this to the 6.0.0-beta0 milestone Nov 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Difficulty: Easy Someone with little to no experience in TSLint should be able to send a pull request for this issue. Good First Issue 🙌 Howdy, neighbor! Status: Accepting PRs Type: Rule Feature Adding a feature to an existing rule.
Projects
None yet
Development

No branches or pull requests

2 participants