From f13594280b13b2c2c321c33893d83e76dd73d5dc Mon Sep 17 00:00:00 2001 From: Sathya Gunasekaran Date: Thu, 9 Nov 2023 08:38:00 +0000 Subject: [PATCH] [ez] Use BabelFn type --- .../src/Entrypoint/Program.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts b/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts index ba43dfd2d8..fb66c66f1e 100644 --- a/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts +++ b/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts @@ -213,13 +213,7 @@ export function compileProgram( let hasCriticalError = lintError != null; const compiledFns: CompileResult[] = []; - const traverseFunction = ( - fn: - | NodePath - | NodePath - | NodePath, - pass: CompilerPass - ): void => { + const traverseFunction = (fn: BabelFn, pass: CompilerPass): void => { if (!shouldVisitNode(fn, pass) || ALREADY_COMPILED.has(fn.node)) { return; } @@ -365,12 +359,7 @@ export function compileProgram( } } -function shouldVisitNode( - fn: NodePath< - t.FunctionDeclaration | t.ArrowFunctionExpression | t.FunctionExpression - >, - pass: CompilerPass -): boolean { +function shouldVisitNode(fn: BabelFn, pass: CompilerPass): boolean { if (hasUseMemoCacheCall(fn)) { return false; }