prefer-zod-infer
Derive a type from its Zod schema with z.infer instead of hand-writing a twin declaration beside it.
Why
A derived type stays synchronized when the runtime schema changes.
Fix
Replace the hand-written twin with z.infer<typeof Schema>.
Examples
import { z } from "zod";const UserSchema = z.object({ id: z.string() });interface User { id: string;}import { z } from "zod";const UserSchema = z.object({ id: z.string() });type User = z.infer<typeof UserSchema>;