Add support to ClassExpressions in the prop-types rule#1400
Merged
yannickcr merged 4 commits intojsx-eslint:masterfrom Sep 5, 2017
Merged
Add support to ClassExpressions in the prop-types rule#1400yannickcr merged 4 commits intojsx-eslint:masterfrom
yannickcr merged 4 commits intojsx-eslint:masterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm not super happy with the solution, perhaps others have a better idea?
It turns out that ESLint visits
ClassExpressionbefore it visitsTypeParameterDeclaration, but I want it the other way around.I tried using the
ClassExpression:exitkey, but it doesn't change anything.Therefore, I needed a way to defer class expressions evaluations util after
TypeParameterDeclarationhas been visited, by storing the nodes in an array and looping through it inProgram: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-typesin #1393