Skip to content

Commit 16e57ff

Browse files
committed
Fix crash in prop-types test with UnionTypeAnnotation
1 parent 4eb9259 commit 16e57ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/rules/prop-types.js

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

729+
if (annotation.type === 'UnionTypeAnnotation') {
730+
return true;
731+
}
732+
729733
const typeNode = typeScope(annotation.id.name);
730734

731735
if (!typeNode) {

0 commit comments

Comments
 (0)