diff --git a/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Options.ts b/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Options.ts index 41ea2d98e0..a7eea2d4c7 100644 --- a/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Options.ts +++ b/compiler/packages/babel-plugin-react-forget/src/Entrypoint/Options.ts @@ -114,7 +114,7 @@ export type PluginOptions = { enableUseMemoCachePolyfill: boolean; }; -export type CompilationMode = +const CompilationModeSchema = z.enum([ /* * Compiles functions annotated with "use forget" or component/hook-like functions. * This latter includes: @@ -125,11 +125,14 @@ export type CompilationMode = * false positives, since compilation has a greater impact than linting. * This is the default mode */ - | "infer" + "infer", // Compile only functions which are explicitly annotated with "use forget" - | "annotation" + "annotation", // Compile all top-level functions - | "all"; + "all", +]); + +export type CompilationMode = z.infer; /** * Represents 'events' that may occur during compilation. Events are only