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

[Fix] jsx-no-target-blank: Improve readme #3169

Merged

Conversation

apepper
Copy link
Contributor

@apepper apepper commented Jan 6, 2022

@@ -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.
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, i see, thanks.

@ljharb ljharb force-pushed the jsx-no-target-blank_improved_readme branch from f966191 to 5d0e932 Compare January 27, 2022 17:38
@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2022

Codecov Report

Merging #3169 (5d0e932) into master (2dfe98f) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2dfe98f...5d0e932. Read the comment docs.

@ljharb ljharb merged commit 5d0e932 into jsx-eslint:master Jan 27, 2022
@apepper apepper deleted the jsx-no-target-blank_improved_readme branch January 28, 2022 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants