eslint-plugin-zod
Zod linting rules for ESLint.
Last updated 2 years ago by gajus .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ npm install eslint-plugin-zod 
SYNC missed versions from official npm registry.

eslint-plugin-zod

Canonical Code Style NPM version Twitter Follow

Zod linting rules for ESLint.

Installation

  1. Install ESLint.
  2. Install eslint-plugin-zod plugin.
npm install eslint --save-dev
npm install eslint-plugin-zod --save-dev

Configuration

  1. Add plugins section and specify eslint-plugin-zod as a plugin.
  2. Enable rules.
{
  "plugins": [
    "zod"
  ],
  "rules": {
    "zod/prefer-enum": 2,
    "zod/require-strict": 2
  }
}

Rules

prefer-enum

The --fix option on the command line automatically fixes problems reported by this rule.

Prefers z.enum over a union of literals.

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().

Current Tags

  • 1.4.0                                ...           latest (2 years ago)

7 Versions

  • 1.4.0                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Total 2
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (14)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE