Skip to content

Commit dd10851

Browse files
committed
Fix crash in no-unused-prop-types test with UnionTypeAnnotation
1 parent 077e017 commit dd10851

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/rules/no-unused-prop-types.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,10 @@ module.exports = {
780780
return declarePropTypesForObjectTypeAnnotation(annotation, declaredPropTypes);
781781
}
782782

783+
if (annotation.type === 'UnionTypeAnnotation') {
784+
return true;
785+
}
786+
783787
const typeNode = typeScope(annotation.id.name);
784788

785789
if (!typeNode) {

0 commit comments

Comments
 (0)