Skip to content

Add support to ClassExpressions in the prop-types rule#1400

Merged
yannickcr merged 4 commits intojsx-eslint:masterfrom
jseminck:flow-53-hoc
Sep 5, 2017
Merged

Add support to ClassExpressions in the prop-types rule#1400
yannickcr merged 4 commits intojsx-eslint:masterfrom
jseminck:flow-53-hoc

Conversation

@jseminck
Copy link
Copy Markdown
Contributor

I'm not super happy with the solution, perhaps others have a better idea?

It turns out that ESLint visits ClassExpression before it visits TypeParameterDeclaration, but I want it the other way around.

I tried using the ClassExpression:exit key, but it doesn't change anything.

Therefore, I needed a way to defer class expressions evaluations util after TypeParameterDeclaration has been visited, by storing the nodes in an array and looping through it in Program:exit.

This fixes #1376 (comment) and several other cases which we didn't catch before.

I'm not sure it will cover all of the issues related to Flow Props yet.

I'll add the same support to no-unused-prop-types in #1393

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Flow 0.53 prop types

4 participants