0.1.2 • Published 6 months ago

eslint-plugin-z v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

eslint-plugin-z

GitHub Actions License NPM version GitHub release

!CAUTION This project is in the early stages of development. Please report any issues you encounter.

An ESLint plugin for linting Zod schemas.

Installation

npm install eslint-plugin-z --save-dev

Configuration

// eslint.config.mjs
import pluginZ from "eslint-plugin-z";

export default [pluginZ.configs.recommended];
// .eslintrc.json
{
  "extends": ["plugin:z/recommendedLegacy"]
}

Rules

  • ✅ ️Set in the recommended configuration.
  • 🖼️ Layout, ⚠️ problem, 💡 Suggestion
  • 🔧 Automatically fixable by the --fix CLI option.
  • ❌ Deprecated.
RulesDescriptionType🔧
no-duplicate-enum-valuesDisallow duplicate enum member values.⚠️
no-throw-in-refineBan throwing in refinement function.⚠️
prefer-enumEnforce usage of z.enum() instead of z.union([z.literal(""),...])💡🔧
prefer-nullishEnforce usage of z.nullish() instead of z.null().optional() or z.optional().null().💡🔧
prefer-tupleEnforce usage of z.tuple([z.schema()]) instead of z.schema().array().length(1)💡

License

This project is licensed under the MIT license.

0.1.2

6 months ago

0.1.1

6 months ago

0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago

0.0.0

6 months ago

1.0.0-security

6 months ago