question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automatic "noopener noreferrer"?

See original GitHub issue

While it’s a smart rule to have, one of our small annoyances has been the jsx-no-target-blank rule. I work on a large project that makes use of target="_blank" fairly often, and requiring rel="noopener noreferrer all over the place adds noise that I’m not sure is necessary for a dev to care about.

We created a custom component <A/> with the logic to add the attribute values whenever target="_blank". This works great, but it adds a little bit of overhead, and since eslint no longer sees it as an anchor tag, we don’t get other possible warnings targeted at anchor tags.

So that’s the background, here’s the ask:

Would CRA be welcome to the idea of making this security fix automatic via babel plugin (found babel-plugin-jsx-target-blank) instead of warning the user by eslint?

I’m not sure of the implications of this (i.e. does anyone have valid use-cases for ignoring this rule? would it break their apps?), so I wanted to open it up for discussion before creating a PR.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
mrmckebcommented, Jan 13, 2019

This is actually a pretty good idea.

I have only two questions/concerns:

  1. As you’ve stated, could there be cases where someone needs to have target blank and not "noopener noreferrer"?
  2. By removing this warning, we do lose the benefit of educating developers on why it’s important. This may not be important.
0reactions
stale[bot]commented, Mar 7, 2019

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What rel="noreferrer noopener" Mean and How it Affects SEO
“Noreferrer noopener”, are HTML attributes that can be added to outgoing links. What do these tags do and how they can impact your...
Read more >
Use jQuery to automatically add noopener, noreferrer and ...
Use jQuery to automatically add noopener, noreferrer and nofollow to links w/target="_blank". - Sanitize_Target_Blank.htm.
Read more >
Link types: noopener - HTML: HyperText Markup Language
The noopener keyword for the rel attribute of the , , and elements instructs the browser to navigate to the target resource without...
Read more >
What Does the rel="noopener noreferrer" Tag Mean? (& Does ...
Do you know what the noopener noreferrer tag attributes mean? In this post, we'll walk you through its meaning and how it affects...
Read more >
How to automatically add rel="noopener" to a target="_blank ...
I have a little JS that include target="_blank" to all external link. For security reasons I need to append also rel="noopener". Any help...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found