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.

Bug in jsx-no-target-blank eslint rule

See original GitHub issue

Is 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

  1. node -v: 7.8.0
  2. npm -v: 4.2.0
  3. yarn --version (if you use Yarn): 0.27.5
  4. npm ls react-scripts (if you haven’t ejected): 1.0.10

Then, specify:

  1. Operating system: macOS Sierra
  2. Browser and version (if relevant): Not relevant

Steps to Reproduce

  1. Insert an a tag with target="_blank" rel="noopener noreferrer" and some styles from glamor
  2. 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:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
green-arrowcommented, Jul 14, 2017

This should be resolved once yannickcr/eslint-plugin-react#1298 is released.

0reactions
gaearoncommented, Oct 30, 2017
Read more comments on GitHub >

github_iconTop 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 >

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