make isReferenced() recognise ObjectTypeProperty (#8060)

fixes #8057
This commit is contained in:
Peter Leonov
2018-05-31 00:07:56 +02:00
committed by Nicolò Ribaudo
parent d83d141e00
commit ab62a94399
2 changed files with 24 additions and 0 deletions

View File

@@ -116,6 +116,11 @@ export default function isReferenced(node: Object, parent: Object): boolean {
// no: NODE.target
case "MetaProperty":
return false;
// yes: type X = { somePropert: NODE }
// no: type X = { NODE: OtherType }
case "ObjectTypeProperty":
return parent.key !== node;
}
return true;