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

[jsx-no-target-blank]TypeError: Cannot read property 'type' of null #1949

Closed
yoyo837 opened this issue Aug 21, 2018 · 2 comments
Closed

[jsx-no-target-blank]TypeError: Cannot read property 'type' of null #1949

yoyo837 opened this issue Aug 21, 2018 · 2 comments

Comments

@yoyo837
Copy link
Contributor

yoyo837 commented Aug 21, 2018

<a href="">
  <Icon type="download" style={this.iconStyle} />
</a>

When I typed the end of the target word, it crashed.

<a href="" target>
  <Icon type="download" style={this.iconStyle} />
</a>
    "eslint": "^5.3.0",
    "eslint-config-airbnb": "^17.0.0",
    "eslint-config-prettier": "^2.9.0",
    "eslint-plugin-babel": "^5.1.0",
    "eslint-plugin-compat": "^2.5.1",
    "eslint-plugin-import": "^2.13.0",
    "eslint-plugin-jsx-a11y": "^6.1.1",
    "eslint-plugin-react": "^7.11.1",
[Error - 4:45:20 PM] ESLint stack trace:
[Error - 4:45:20 PM] TypeError: Cannot read property 'type' of null
    at isTargetBlank (/Users/tanghui/git/ydmap/ydmap-web-cloud/node_modules/eslint-plugin-react/lib/rules/jsx-no-target-blank.js:15:16)
    at JSXAttribute (/Users/tanghui/git/ydmap/ydmap-web-cloud/node_modules/eslint-plugin-react/lib/rules/jsx-no-target-blank.js:67:47)
    at listeners.(anonymous function).forEach.listener (/Users/tanghui/git/ydmap/ydmap-web-cloud/node_modules/eslint/lib/util/safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (/Users/tanghui/git/ydmap/ydmap-web-cloud/node_modules/eslint/lib/util/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/Users/tanghui/git/ydmap/ydmap-web-cloud/node_modules/eslint/lib/util/node-event-generator.js:251:26)
    at NodeEventGenerator.applySelectors (/Users/tanghui/git/ydmap/ydmap-web-cloud/node_modules/eslint/lib/util/node-event-generator.js:280:22)
    at NodeEventGenerator.enterNode (/Users/tanghui/git/ydmap/ydmap-web-cloud/node_modules/eslint/lib/util/node-event-generator.js:294:14)
    at CodePathAnalyzer.enterNode (/Users/tanghui/git/ydmap/ydmap-web-cloud/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:632:23)
    at nodeQueue.forEach.traversalInfo (/Users/tanghui/git/ydmap/ydmap-web-cloud/node_modules/eslint/lib/linter.js:860:28)

@ljharb
Copy link
Member

ljharb commented Aug 21, 2018

Altho a boolean is an invalid value for target, the rule shouldn’t be crashing.

@yoyo837
Copy link
Contributor Author

yoyo837 commented Aug 21, 2018

Yes,I'm going to type the next ‘=’ sign

@ljharb ljharb closed this as completed in 72a71b3 Aug 21, 2018
This was referenced Dec 28, 2018
This was referenced Jan 4, 2019
@ghost ghost mentioned this issue Jan 12, 2019
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants