Skip to content

Commit

Permalink
Fix crash in prop-types test with UnionTypeAnnotation
Browse files Browse the repository at this point in the history
  • Loading branch information
justinanastos committed Nov 22, 2017
1 parent 4eb9259 commit 16e57ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rules/prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,10 @@ module.exports = {
return declarePropTypesForObjectTypeAnnotation(annotation, declaredPropTypes);
}

if (annotation.type === 'UnionTypeAnnotation') {
return true;
}

const typeNode = typeScope(annotation.id.name);

if (!typeNode) {
Expand Down

0 comments on commit 16e57ff

Please sign in to comment.