prefer-zod-parse-output-type
Derive a function's return contract from the local Zod schema whose parsed output it returns.
Why
A hand-written contract can drift from the runtime-validated value even while each declaration remains locally valid.
Fix
Export or colocate the schema and derive the contract with z.output<typeof Schema>.
Examples
export interface ParsedRow { id: string;}import { z } from "zod";import type { ParsedRow } from "./contracts.js";const RowSchema = z.object({ id: z.string() });function load(): ParsedRow { return RowSchema.parse({});}import { z } from "zod";const RowSchema = z.object({ id: z.string() });type Row = z.output<typeof RowSchema>;function load(): Row { return RowSchema.parse({});}