🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

eslint-plugin-zod

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-zod

Zod linting rules for ESLint.

1.4.0
latest
Source
npm
Version published
Weekly downloads
8.6K
-7.73%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-zod

Canonical Code Style NPM version Twitter Follow

Zod linting rules for ESLint.

Installation

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/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

configurationformatdefaultdescription
allowPassthroughbooleantrueIgnores objects explicitly set to allowPassthrough().

Keywords

eslint

FAQs

Package last updated on 17 Nov 2022

Did you know?

Socket

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.

Install

Related posts