-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[Fix] jsx-no-target-blank
: Improve readme
#3169
[Fix] jsx-no-target-blank
: Improve readme
#3169
Conversation
See https://web.dev/external-anchors-use-rel-noopener/, https://chromestatus.com/feature/6140064063029248 and https://caniuse.com/mdn-html_elements_a_implicit_noopener for some background information on this change.
@@ -123,6 +123,8 @@ This rule supports the ability to use custom components for forms. To enable thi | |||
|
|||
## When To Override It | |||
|
|||
Modern browsers (Chrome ≥ 88, Edge ≥ 88, Firefox ≥ 79 and Safari ≥ 12.2) automatically imply `rel="noopener"`. Therefore this rule is no longer needed, if legacy browsers are not supported. See https://web.dev/external-anchors-use-rel-noopener/ and https://caniuse.com/mdn-html_elements_a_implicit_noopener for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this interact with the browser support paragraph on line 130?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least to my knowledge there are three stages regarding empty ref
:
- legacy:
noreferrer
is needed (e.g. because of IE11).noopener
is not good enough. - in-between: In non IE11 browsers
noopener
is good enough (e.g. with Chrome 49 and newer) - modern: In modern browser there is no need to specify
noopener
because it is automatically implied (e.g. with Chrome 88).
So basically: If you still support IE11 use the default of this eslint-rule. If you're not supporting IE11 but old versions of chrome or safari use the allowReferrer
rule. If you're using modern browsers you don't need this rule at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, i see, thanks.
f966191
to
5d0e932
Compare
Codecov Report
@@ Coverage Diff @@
## master #3169 +/- ##
=======================================
Coverage 97.55% 97.55%
=======================================
Files 120 120
Lines 8288 8288
Branches 2982 2982
=======================================
Hits 8085 8085
Misses 203 203 Continue to review full report at Codecov.
|
See https://web.dev/external-anchors-use-rel-noopener/, https://chromestatus.com/feature/6140064063029248 and https://caniuse.com/mdn-html_elements_a_implicit_noopener for some background information on this change.