Skip to content

🎥 Make videos programmatically with React

Fix lint errors for zod v4 upgrade

Jonny Burger2465b873cae7
diff --git a/packages/studio/src/components/RenderModal/SchemaEditor/ZodNumberEditor.tsx b/packages/studio/src/components/RenderModal/SchemaEditor/ZodNumberEditor.tsx
index 48ba438686..66c1c650a8 100644
--- a/packages/studio/src/components/RenderModal/SchemaEditor/ZodNumberEditor.tsx
+++ b/packages/studio/src/components/RenderModal/SchemaEditor/ZodNumberEditor.tsx
@@ -14,7 +14,7 @@ const fullWidth: React.CSSProperties = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const getMinValue = (schema: any) => {
- const checks = schema._def.checks;
+ const {checks} = schema._def;
if (!checks) return -Infinity;
if (isZodV3Schema(schema)) {
@@ -37,7 +37,7 @@ const getMinValue = (schema: any) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const getMaxValue = (schema: any) => {
- const checks = schema._def.checks;
+ const {checks} = schema._def;
if (!checks) return Infinity;
if (isZodV3Schema(schema)) {
@@ -60,7 +60,7 @@ const getMaxValue = (schema: any) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const getStep = (schema: any): number | undefined => {
- const checks = schema._def.checks;
+ const {checks} = schema._def;
if (!checks) return undefined;
if (isZodV3Schema(schema)) {
diff --git a/packages/studio/src/visual-controls/VisualControls.tsx b/packages/studio/src/visual-controls/VisualControls.tsx
index ef865fbcfa..519bdfd707 100644
--- a/packages/studio/src/visual-controls/VisualControls.tsx
+++ b/packages/studio/src/visual-controls/VisualControls.tsx
@@ -115,8 +115,7 @@ export const VisualControlsProvider: React.FC<{
const env = useRemotionEnvironment();
const visualControl = useCallback(
- // eslint-disable-next-line prefer-arrow-callback
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ // eslint-disable-next-line prefer-arrow-callback, @typescript-eslint/no-explicit-any
function <T>(key: string, value: T, schema?: any): T {
// eslint-disable-next-line no-constant-condition
if (handles && false) {
diff --git a/packages/template-prompt-to-video/cli/service.ts b/packages/template-prompt-to-video/cli/service.ts
index 35fbfad337..654630a108 100644
--- a/packages/template-prompt-to-video/cli/service.ts
+++ b/packages/template-prompt-to-video/cli/service.ts
@@ -16,7 +16,7 @@ export const openaiStructuredCompletion = async <T>(
schema: z.ZodType<T>,
): Promise<T> => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
- const jsonSchema = zodToJsonSchema(schema) as any;
+ const jsonSchema = zodToJsonSchema(schema as any) as any;
const res = await fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",