Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upPrevent usage of unsafe target='_blank' (react/jsx-no-target-blank) #1367
Comments
feross
added
enhancement
accepted
labels
Aug 15, 2019
feross
added this to the standard 14 milestone
Aug 15, 2019
This comment has been minimized.
This comment has been minimized.
|
Shipped in |
feross
closed this
in
c852a11
Aug 15, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
feross commentedAug 15, 2019
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
When creating a JSX element that has an
atag, it is often desired to havethe link open in a new tab using the
target='_blank'attribute. Using thisattribute unaccompanied by
rel='noreferrer noopener', however, is a severesecurity vulnerability (see here for more details)
This rules requires that you accompany
target='_blank'attributes withrel='noreferrer noopener'.Rule Details
This rule aims to prevent user generated links from creating security vulnerabilities by requiring
rel='noreferrer noopener'for external links, and optionally any dynamically generated links.The following patterns are considered errors:
The following patterns are not considered errors: