Skip to content

boolean-prop-naming triggers "Cannot read property 'properties' of undefined" #1452

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
roubaobaozi opened this issue Sep 27, 2017 · 0 comments

Comments

@roubaobaozi
Copy link

Hi,

I think this is similar to: #1369

I’m running 7.4.0 and still getting this error:

package.json:
"eslint-plugin-react": "^7.4.0"

eslint is 4.7.2

.eslintrc.js:

"react/boolean-prop-naming": [
    "error",
    { "rule": "^(is|has)[A-Z]([A-Za-z0-9]?)+" }
],

Error:

Cannot read property 'properties' of undefined
TypeError: Cannot read property 'properties' of undefined
    at EventEmitter.MemberExpression (/Users/user/repos/myrepo/node_modules/eslint-plugin-react/lib/rules/boolean-prop-naming.js:183:45)
    at emitOne (events.js:120:20)
    at EventEmitter.emit (events.js:210:7)
    at NodeEventGenerator.applySelector (/Users/user/repos/myrepo/node_modules/eslint/lib/util/node-event-generator.js:265:26)
    at NodeEventGenerator.applySelectors (/Users/user/repos/myrepo/node_modules/eslint/lib/util/node-event-generator.js:294:22)
    at NodeEventGenerator.enterNode (/Users/user/repos/myrepo/node_modules/eslint/lib/util/node-event-generator.js:308:14)
    at CodePathAnalyzer.enterNode (/Users/user/repos/myrepo/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:606:23)
    at Traverser.enter (/Users/user/repos/myrepo/node_modules/eslint/lib/linter.js:962:32)
    at Traverser.__execute (/Users/user/repos/myrepo/node_modules/estraverse/estraverse.js:397:31)
    at Traverser.traverse (/Users/user/repos/myrepo/node_modules/estraverse/estraverse.js:501:28)

The issue is stemming from this code:

Card.propTypes = merge({}, Card.propTypes, {
    showScore: propTypes.bool
});
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