
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
eslint-plugin-zod-openapi
Advanced tools
This is a set of Eslint rules created for use with zod-openapi. This aims to optimise the overall developer experience with a little sprinkle of magic ✨.
To install simply run on yarn, npm or pnpm
yarn add -D eslint-plugin-zod-openapi
# or
npm i -D eslint-plugin-zod-openapi
# or
pnpm i -D eslint-plugin-zod-openapi
Add the following configuration to your .eslintrc file
{
"plugins": ["zod-openapi"]
}
{
"rules": {
"zod-openapi/require-meta": "error"
"zod-openapi/require-comment": "error",
"zod-openapi/prefer-zod-default": "warn",
}
}
You may wish to use overrides as this plugin by default will assume that all Zod Objects are using zod-openapi.
"overrides": [
{
"files": ["src/api-types/*.ts"],
"rules": {
"zod-openapi/require-meta": "error"
}
}
]
🔧 This rule is automatically fixable by the --fix CLI option.
| Name | Description | 🔧 |
|---|---|---|
| require-meta | Requires that all ZodTypes have an .meta() method. | |
| require-comment | Requires that all ZodTypes have a description and matching JSDoc comment. | ✅ |
| require-example | Requires that all ZodTypes have an example or examples field. | |
| prefer-meta-last | Prefers that the .meta() method be the last method in the ZodType chain. | |
| prefer-zod-default | Provides an error when default in .meta() is used |
pnpm test
# Fix issues
pnpm format
# Check for issues
pnpm lint
To release a new version
🏷️ Choose a tag, enter a version number. eg. v1.2.0 and click + Create new tag: vX.X.X on publish.Generate release notes button and adjust the description.Set as the latest release box and click Publish release. This will trigger the Release workflow.Pull Requests tab for a PR labelled Release vX.X.X.Merge Pull Request on that Pull Request to update master with the new package version.To release a new beta version
🏷️ Choose a tag, enter a version number with a -beta.X suffix eg. v1.2.0-beta.1 and click + Create new tag: vX.X.X-beta.X on publish.Generate release notes button and adjust the description.Set as a pre-release box and click Publish release. This will trigger the Prerelease workflow.FAQs
Eslint rules for zod-openapi
The npm package eslint-plugin-zod-openapi receives a total of 1,315 weekly downloads. As such, eslint-plugin-zod-openapi popularity was classified as popular.
We found that eslint-plugin-zod-openapi 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.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.