Bug in jsx-no-target-blank eslint rule
See original GitHub issueIs this a bug report?
Yes
Can you also reproduce the problem with npm 4.x?
Yes
Which terms did you search for in User Guide?
N/A
Environment
node -v
: 7.8.0npm -v
: 4.2.0yarn --version
(if you use Yarn): 0.27.5npm ls react-scripts
(if you haven’t ejected): 1.0.10
Then, specify:
- Operating system: macOS Sierra
- Browser and version (if relevant): Not relevant
Steps to Reproduce
- Insert an
a
tag withtarget="_blank" rel="noopener noreferrer"
and some styles fromglamor
- Run via
yarn start
Expected Behavior
No errors.
Actual Behavior
Unexpected error in console: TypeError: Cannot read property 'name' of undefined
in the jsx-no-target-blank
eslint rule.
Additional Comments
I filed a bug in the eslint repo: yannickcr/eslint-plugin-react#1296
I am unable to reproduce this with a fresh app. This started occurring after upgrading from 1.0.4 to 1.0.10. I’ve tried removing node_modules
and yarn.lock
and installing from scratch, but still get the same error.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
eslint-plugin-react/jsx-no-target-blank.md at master - GitHub
This rule aims to prevent user generated link hrefs and form actions from creating security vulnerabilities by requiring rel='noreferrer' for external link ...
Read more >react/jsx-no-target-blank - Magestore Dev Docs - GitLab
This rule aims to prevent user generated links from creating security vulnerabilities by requiring rel='noreferrer noopener' for external links, and optionally ...
Read more >standard - NPM Package Versions - Socket - Socket.dev
eslint -config-node has been replaced with the up to date fork ... unsafe target='_blank' on any component named Link (react/jsx-no-target-blank) #1576 [0%] ...
Read more >@thibaudcolas/eslint-plugin-cookbook - Package Manager
Fast, reliable, and secure dependency management.
Read more >ESLint configuration for JSX - reactjs - Stack Overflow
In order to lint JSX files configuration alone is not enough. Your configuration looks fine (although you probably don't need babel-eslint ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This should be resolved once yannickcr/eslint-plugin-react#1298 is released.
Should be fixed in
react-scripts@1.0.15
.https://github.com/facebookincubator/create-react-app/releases/tag/v1.0.15