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

3.13.0 jsx-keys Errors #373

Closed
craigklem opened this issue Dec 24, 2015 · 0 comments
Closed

3.13.0 jsx-keys Errors #373

craigklem opened this issue Dec 24, 2015 · 0 comments

Comments

@craigklem
Copy link
Contributor

Using latest version 3.13.0, I see several issues when exceptions in jsx-keys when running eslint with our code. Errors 2 & 3 happen after adding if checks to avoid the exceptions. Could not identify code that made 3 happen - no WebStorm call stack :(

  1. TypeError: Cannot read property 'name' of undefined
    line 49 - if (node.callee.property.name !== 'map') {
  2. TypeError: Cannot read property 'type' of undefined
    line 54 - var isFn = fn.type === 'FunctionExpression';
  3. TypeError: Cannot read property 'argument' of undefined
    line 64 - getReturnStatement(fn.body.body).argument

Code that caused issues:

class MyComponent extends React.Component {
constructor(props) {
    super(props);//number 1 happens here
}
var IconRenderer= function() {
  this.fontsLoaded = false;
  this.checkFonts = function(loadedCallback) {
    this.fontsLoaded = lib.fontsLoaded();

    if (this.fontsLoaded) {
      if (loadedCallback) {
        loadedCallback();//number 2 happens here
      }
}

WebStorm watches below:
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant