Skip to content

react/boolean-prop-naming error #1700

Closed
@JamyGolden

Description

When using react/boolean-prop-naming I get an error when I assign the values given in boolean-prop-naming.md as an example. /~https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/boolean-prop-naming.md#rule

Error

user@User-MacBook-Pro /V/p/some-project> npm run lint

> some-project@1.0.0 lint /Volumes/projects/some-project
> eslint ./

Cannot read property 'name' of undefined
TypeError: Cannot read property 'name' of undefined
    at Program:exit.Object.keys.forEach.component (/Volumes/projects/some-project/node_modules/eslint-plugin-react/lib/rules/boolean-prop-naming.js:229:83)
    at Array.forEach (<anonymous>)
    at Program:exit (/Volumes/projects/some-project/node_modules/eslint-plugin-react/lib/rules/boolean-prop-naming.js:220:27)
    at listeners.(anonymous function).forEach.listener (/Volumes/projects/some-project/node_modules/eslint/lib/util/safe-emitter.js:47:58)
    at Array.forEach (<anonymous>)
    at Object.emit (/Volumes/projects/some-project/node_modules/eslint/lib/util/safe-emitter.js:47:38)
    at NodeEventGenerator.applySelector (/Volumes/projects/some-project/node_modules/eslint/lib/util/node-event-generator.js:251:26)
    at NodeEventGenerator.applySelectors (/Volumes/projects/some-project/node_modules/eslint/lib/util/node-event-generator.js:280:22)
    at NodeEventGenerator.leaveNode (/Volumes/projects/some-project/node_modules/eslint/lib/util/node-event-generator.js:303:14)
    at CodePathAnalyzer.leaveNode (/Volumes/projects/some-project/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:630:23)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! some-project@1.0.0 lint: `eslint ./`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the some-project@1.0.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/user/.npm/_logs/2018-02-21T12_05_37_865Z-debug.log

.eslintrc

{
    "parser": "babel-eslint",
    "plugins": ["react"],
    "rules": {
        "react/boolean-prop-naming": ["error", { "rule": "^is[A-Z]([A-Za-z0-9]?)+" }]
    }
}

Versions of tools I'm using

  • eslint: v4.18.1
  • MacOS 10.13.3
  • node v9.5.0

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions