infer mode only compiles component/hook decls

Forks the logic from Program.ts, letting us customize what
gets compiled.
This commit is contained in:
Joe Savona
2024-02-17 17:37:00 -08:00
parent ca3d16c5ef
commit a4234bcfbf
2 changed files with 2 additions and 1 deletions
@@ -374,7 +374,7 @@ export function compileProgram(
}
}
export function shouldVisitNode(fn: BabelFn, pass: CompilerPass): boolean {
function shouldVisitNode(fn: BabelFn, pass: CompilerPass): boolean {
if (hasUseMemoCacheCall(fn)) {
return false;
}
@@ -437,6 +437,7 @@ const skipFilter = new Set([
"forest/forest-object-type-valid.flow",
"forest/forest-partial-reassignment-type-annotation.flow",
"forest/todo-forest-phi-type-unused-initializer.flow",
"forest/forest-hook.flow",
// TODO: we probably want to always skip these
"rules-of-hooks/rules-of-hooks-0592bd574811",