-
Notifications
You must be signed in to change notification settings - Fork 198
Open
Description
Given the following code:
export const FooFoo = buildFoo('Foo') as unknown as (foo: any) => Foo | FooLegacy;
What ast-explorer shows is that the TSUnionType node is on the returnType attribute of the TSFunctionType node:

However when using jscodeshift with recast/ast-types it's being parsed as the following:

instead of being on the tsFunctionTypeNode.returnType.typeAnnotation attribute, it's actually structured as tsFunctionTypeNode.typeAnnotation.typeAnnotation
Metadata
Metadata
Assignees
Labels
No labels