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

Guard against 0 length specifiers for proptypes #2435

Closed
wants to merge 1 commit into from

Conversation

dmkato
Copy link

@dmkato dmkato commented Oct 2, 2019

My co-worker was entered import {} from "prop-types in preparation to declare the prop types for his component.
Upon doing this, eslint crashed as it could not find local on undefined.

My co-worker was entered `import {} from "prop-types` in preparation to declare the prop types for his component. 
Upon doing this, eslint crashed as it could not find `local` on undefined.
@ljharb
Copy link
Member

ljharb commented Oct 4, 2019

@dmkato thanks! could you try to add a test that covers this?

propTypesPackageName = node.specifiers[0].local.name;
if (node.specifiers.length > 0) {
propTypesPackageName = node.specifiers[0].local.name;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

@ljharb ljharb marked this pull request as draft May 9, 2020 22:51
@ljharb
Copy link
Member

ljharb commented May 9, 2020

I've converted this to a draft pending @dmkato's response

@ljharb
Copy link
Member

ljharb commented Sep 20, 2021

This was fixed in f34ee91, to close #2899.

@ljharb ljharb closed this Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants