Registry / testing / eslint-plugin-zod-v4

eslint-plugin-zod-v4

JSON →
library0.3.0jsnpmunverified

ESLint plugin for Zod v4 best practices and migration from v3. Current stable version 0.3.0. Actively maintained, with breaking change detection and auto-fix support. Differentiator: educational rule messages, React-aware for memoization, and flat config support for ESLint 9+. Covers all major breaking changes from Zod v3 to v4, such as string format methods, record signature, error handling, and object methods.

testingdevops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Plugin is ESM-only; CommonJS require is not supported.

import zodPlugin from 'eslint-plugin-zod-v4'

Named import for configs; also ESM-only.

import { configs } from 'eslint-plugin-zod-v4'

Can access individual rules via the rules object.

import { rules } from 'eslint-plugin-zod-v4'

Minimal flat config for ESLint 9+ using recommended config and custom rules.

// eslint.config.js import zodPlugin from 'eslint-plugin-zod-v4' export default [ zodPlugin.configs.recommended, { rules: { 'zod-v4/prefer-safeParse': 'warn', 'zod-v4/no-throw-in-refine': 'error', }, }, ]
Debug
Known footguns
breakingz.string().email() is removed in Zod v4; use z.email() instead.
breakingz.record(singleArg) is removed; require two arguments.
breakingerror.errors is removed; use error.issues instead.
breaking.merge() is removed; use .extend() instead.
breaking.superRefine() is removed; use .check() instead.
breakingz.nativeEnum() is removed; use z.enum() instead.
deprecatedinvalid_type_error/required_error params are deprecated; use 'error' param.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
8 hits · last 30 days
gptbot
3
ahrefsbot
2
Resources