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

Fix crash for no-typos: Cannot read property 'name' of undefined #1406

Merged
merged 3 commits into from Aug 30, 2017

Conversation

jseminck
Copy link
Contributor

There was another report of a crash with no-typos rule: #1373 (comment)

Fixed this one 2 ways:

  • Added a null check around the code that was causing this crash
  • Added an extra validation on the `MemberExpression" visitor to make sure we are dealing with one of the supported properties

The second point may not be needed, but I think it's a nice addition to the rule... currently we visit all MemberExpressions, including those outside of React-related code. There are probably a whole bunch of these in any given code-base, and it's not needed to find the related component for that MemberExpression if we're not going to report a typo issue for the property name.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me.

@ljharb ljharb merged commit 99d8ad8 into jsx-eslint:master Aug 30, 2017
@jseminck jseminck deleted the no-typos-bug branch November 19, 2017 07:53
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