[ez] Use BabelFn type
Sathya Gunasekaran committed
Nov 9, 2023 at 08:38 UTC
f13594280b13b2c2c321c33893d83e76dd73d5dc
1 file changed
+2
-13
compiler/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts
+2
-13
@@ -213,13 +213,7 @@ export function compileProgram(
213
let hasCriticalError = lintError != null;
214
const compiledFns: CompileResult[] = [];
215
216
- const traverseFunction = (
217
- fn:
218
- | NodePath<t.FunctionDeclaration>
219
- | NodePath<t.FunctionExpression>
220
- | NodePath<t.ArrowFunctionExpression>,
221
- pass: CompilerPass
222
- ): void => {
216
+ const traverseFunction = (fn: BabelFn, pass: CompilerPass): void => {
217
if (!shouldVisitNode(fn, pass) || ALREADY_COMPILED.has(fn.node)) {
218
return;
219
}
@@ -365,12 +359,7 @@ export function compileProgram(
359
}
360
}
361
368
-function shouldVisitNode(
369
- fn: NodePath<
370
- t.FunctionDeclaration | t.ArrowFunctionExpression | t.FunctionExpression
371
- >,
372
- pass: CompilerPass
373
-): boolean {
362
+function shouldVisitNode(fn: BabelFn, pass: CompilerPass): boolean {
363
if (hasUseMemoCacheCall(fn)) {
364
return false;
365
}