
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
eslint-plugin-zod-x
Advanced tools
ESLint plugin that adds custom linting rules to enforce best practices when using Zod
ESLint plugin that adds custom linting rules to enforce best practices when using Zod
💼 Configurations enabled in.
✅ Set in the recommended configuration.
🔧 Automatically fixable by the --fix CLI option.
💡 Manually fixable by editor suggestions.
| Name | Description | 💼 | 🔧 | 💡 |
|---|---|---|---|---|
| array-style | Enforce consistent Zod array style | ✅ | 🔧 | |
| consistent-import-source | Enforce consistent source from Zod imports | |||
| no-any | Disallow usage of z.any() in Zod schemas | ✅ | 💡 | |
| no-empty-custom-schema | Disallow usage of z.custom() without arguments | ✅ | ||
| no-number-schema-with-int | Disallow usage of z.number().int() as it is considered legacy | ✅ | 🔧 | |
| no-optional-and-default-together | Disallow using both .optional() and .default() on the same Zod schema | ✅ | 🔧 | |
| no-throw-in-refine | Disallow throwing errors directly inside Zod refine callbacks | ✅ | ||
| prefer-meta | Enforce usage of .meta() over .describe() | ✅ | 🔧 | |
| prefer-meta-last | Enforce .meta() as last method | ✅ | 🔧 | |
| prefer-namespace-import | Enforce importing zod as a namespace import (import * as z from 'zod') | ✅ | 🔧 | |
| prefer-strict-object | Enforce usage of .strictObject() over .object() and/or .looseObject() | |||
| require-error-message | Enforce that custom refinements include an error message | ✅ | 🔧 | |
| require-schema-suffix | Require schema suffix when declaring a Zod schema | ✅ | 🔧 |
Install eslint and eslint-plugin-zod-x using your preferred package manager:
npm i --save-dev eslint eslint-plugin-zod-x
yarn add --dev eslint eslint-plugin-zod-x
pnpm add --save-dev eslint eslint-plugin-zod-x
Import the plugin
import eslintPluginZodX from 'eslint-plugin-zod-x';
Add recommended config to your ESLint setup
eslintPluginZodX.configs.recommended,
Here’s a minimal example using the flat config format:
// eslint.config.js
import { defineConfig } from 'eslint/config';
import eslint from '@eslint/js';
import eslintPluginZodX from 'eslint-plugin-zod-x';
export default defineConfig(
eslint.configs.recommended,
eslintPluginZodX.configs.recommended,
);
FAQs
ESLint plugin that adds custom linting rules to enforce best practices when using Zod
We found that eslint-plugin-zod-x demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.