prefer-zod-field-bounds
Declare a pure integer field range on its Zod field schema instead of an object refinement.
Why
An object-level refinement can hide one field's domain range from generated JSON Schema. A native field bound states the range beside the integer contract without a custom predicate.
Fix
Consider the equivalent min/gte/gt/max/lte/lt field constraint. Review error paths, issue codes and validation order before replacing the refinement; no automatic fix is offered.
Examples
import { z } from "zod";const CountSchema = z .object({ value: z.number().int() }) .refine((row) => row.value >= 1);import { z } from "zod";const CountSchema = z.object({ value: z.number().int().min(1) });