Socket
Socket
Sign inDemoInstall

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.


Version published
Weekly downloads
7.2K
increased by22.05%
Maintainers
1
Weekly downloads
 
Created
Source

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
configurationformatdefaultdescription
allowPassthroughbooleantrueIgnores objects explicitly set to allowPassthrough().

Keywords

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc