Skip to content

no-typos crash #1639

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

Closed
alexlrobertson opened this issue Jan 11, 2018 · 1 comment
Closed

no-typos crash #1639

alexlrobertson opened this issue Jan 11, 2018 · 1 comment

Comments

@alexlrobertson
Copy link

I encountered a crash when linting a file with a bad prop type while using the latest version of the plugin:

MyComponent.propTypes = {
  item: PropTypes.shape()
};
Cannot read property 'type' of undefined
TypeError: Cannot read property 'type' of undefined
    at checkValidPropObject (/Users/alex/project/node_modules/eslint-plugin-react/lib/rules/no-typos.js:76:15)
    at checkValidProp (/Users/alex/project/node_modules/eslint-plugin-react/lib/rules/no-typos.js:65:11)
    at node.properties.forEach.prop (/Users/alex/project/node_modules/eslint-plugin-react/lib/rules/no-typos.js:77:41)
    at Array.forEach (native)
    at checkValidPropObject (/Users/alex/project/node_modules/eslint-plugin-react/lib/rules/no-typos.js:77:25)
    at reportErrorIfClassPropertyCasingTypo (/Users/alex/project/node_modules/eslint-plugin-react/lib/rules/no-typos.js:85:9)
    at MemberExpression (/Users/alex/project/node_modules/eslint-plugin-react/lib/rules/no-typos.js:135:11)
    at listeners.(anonymous function).forEach.listener (/Users/alex/project/node_modules/eslint/lib/util/safe-emitter.js:47:58)
    at Array.forEach (native)
    at Object.emit (/Users/alex/project/node_modules/eslint/lib/util/safe-emitter.js:47:38)
@ljharb
Copy link
Member

ljharb commented Jan 12, 2018

This is a duplicate of #1471 and is fixed in the next release.

@ljharb ljharb closed this as completed Jan 12, 2018
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

2 participants