eslint-plugin-zod
Zod linting rules for ESLint.
Installation
- Install ESLint.
- Install
eslint-plugin-zod
plugin.
npm install eslint --save-dev
npm install eslint-plugin-zod --save-dev
Configuration
- Add
plugins
section and specify eslint-plugin-zod
as a plugin. - Enable rules.
{
"plugins": [
"zod"
],
"rules": {
"zod/require-strict": [
2,
],
}
}
Rules
require-strict
The --fix
option on the command line automatically fixes problems reported by this rule.
Requires that objects are initialized with .strict()
.
Options
configuration | format | default | description |
---|
allowPassthrough | boolean | true | Ignores objects explicitly set to allowPassthrough() . |