Skip to content

Commit

Permalink
Fix crash in no-unused-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 077e017 commit dd10851
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rules/no-unused-prop-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,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 dd10851

Please sign in to comment.