TRPC002infoPro

trpc-inline-zod-schema

Inline Zod schema in .input() — use shared schema in monorepo.

Applies to: Project-level

Why this matters

In monorepos, inline Zod schemas in .input() calls drift independently from what clients expect. Extract schemas to a shared package so both server and client reference the same validation contract.

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, TRPC002 includedstablestack explain TRPC002

TRPC002 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.

False positive in your codebase? Suppress a single line with # noqa: TRPC002