prefer-multi-value-zod-literal
Use the Zod 4 multi-value literal API instead of a union of literal schemas.
Why
One multi-value literal expresses the same closed value domain without repeated schema wrappers.
Fix
Use z.literal([value1, value2, ...]) for a modern Zod 4 value-domain contract. Preserve required union introspection or error-shape contracts with an explained local exception.
Examples
import { z } from "zod/v4";export const Version = z.union([z.literal(1), z.literal(2), z.literal(3)]);import { z } from "zod/v4";export const Version = z.literal([1, 2, 3]);