Skip to content

prop-types failing to parse flow type annotations #1631

Closed
@RobinClowers

Description

@RobinClowers

This presents in a very similar way to #1446, but it's happening in the prop-types rule, rather than no-unused-prop-types. It's related to flow type annotations, but unfortunately I don't have a good repro right now, I'll work on finding one. In the mean time, here it the stacktrace:

Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
    at iterateProperties (/node_modules/eslint-plugin-react/lib/rules/prop-types.js:343:21)
    at declarePropTypesForObjectTypeAnnotation (/node_modules/eslint-plugin-react/lib/rules/prop-types.js:702:7)
    at propTypes.types.some.annotation (/node_modules/eslint-plugin-react/lib/rules/prop-types.js:737:16)
    at Array.some (native)
    at declarePropTypesForIntersectionTypeAnnotation (/node_modules/eslint-plugin-react/lib/rules/prop-types.js:724:30)
    at markPropTypesAsDeclared (/node_modules/eslint-plugin-react/lib/rules/prop-types.js:818:35)
    at Object.ClassDeclaration (/node_modules/eslint-plugin-react/lib/rules/prop-types.js:943:11)
    at Linter.updatedRuleInstructions.(anonymous function) (/node_modules/eslint-plugin-react/lib/util/Components.js:654:75)
    at emitOne (events.js:101:20)
    at Linter.emit (events.js:188:7)
    at NodeEventGenerator.applySelector (/node_modules/eslint/lib/util/node-event-generator.js:265:26)
    at NodeEventGenerator.applySelectors (/node_modules/eslint/lib/util/node-event-generator.js:294:22)
    at NodeEventGenerator.enterNode (/node_modules/eslint/lib/util/node-event-generator.js:308:14)
    at CodePathAnalyzer.enterNode (/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:602:23)
    at Traverser.enter (/node_modules/eslint/lib/linter.js:925:36)
    at Traverser.__execute (/node_modules/estraverse/estraverse.js:397:31)
    at Traverser.traverse (/node_modules/estraverse/estraverse.js:501:28)

Metadata

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