Skip to content

[prop-types] It crash eslint when using spread operator in a flow type #1178

Closed
@lgraziani2712

Description

Hello! This code crashs eslint:

type RawMazeData = {|
  ...MazeData,
  path: Array<[string, ActivePathBorders]>,
|};
Cannot read property 'type' of undefined
TypeError: Cannot read property 'type' of undefined
    at buildTypeAnnotationDeclarationTypes (C:\dev\repos\codimo\node_modules\eslint-plugin-react\lib\rules\prop-types.js:452:25)
    at C:\dev\repos\codimo\node_modules\eslint-plugin-react\lib\rules\prop-types.js:464:54
    at iterateProperties (C:\dev\repos\codimo\node_modules\eslint-plugin-react\lib\rules\prop-types.js:333:11)
    at buildTypeAnnotationDeclarationTypes (C:\dev\repos\codimo\node_modules\eslint-plugin-react\lib\rules\prop-types.js:463:11)
    at buildTypeAnnotationDeclarationTypes (C:\dev\repos\codimo\node_modules\eslint-plugin-react\lib\rules\prop-types.js:455:20)
    at C:\dev\repos\codimo\node_modules\eslint-plugin-react\lib\rules\prop-types.js:464:54
    at iterateProperties (C:\dev\repos\codimo\node_modules\eslint-plugin-react\lib\rules\prop-types.js:333:11)
    at buildTypeAnnotationDeclarationTypes (C:\dev\repos\codimo\node_modules\eslint-plugin-react\lib\rules\prop-types.js:463:11)
    at C:\dev\repos\codimo\node_modules\eslint-plugin-react\lib\rules\prop-types.js:681:38
    at iterateProperties (C:\dev\repos\codimo\node_modules\eslint-plugin-react\lib\rules\prop-types.js:333:11)

Edit: disabling this rules does not happen.

Thank you!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions