-
-
Notifications
You must be signed in to change notification settings - Fork 0
chore: add eslint-plugin-zod and migrate to Zod v4 idioms #337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
boneskull
commented
Jan 15, 2026
- Add eslint-plugin-zod v3.0.1 with project-appropriate configuration
- Migrate .describe() to .meta() (Zod v4 recommended approach)
- Migrate z.number().int() to z.int() (Zod v4 native integer schema)
- Fix imports from zod/v4 to zod in iterable assertions
- Add type parameters to .brand() calls for compile-time safety
- Disable no-any-schema and no-unknown-schema (intentional for assertion lib)
- Add eslint-plugin-zod v3.0.1 with project-appropriate configuration - Migrate .describe() to .meta() (Zod v4 recommended approach) - Migrate z.number().int() to z.int() (Zod v4 native integer schema) - Fix imports from zod/v4 to zod in iterable assertions - Add type parameters to .brand() calls for compile-time safety - Disable no-any-schema and no-unknown-schema (intentional for assertion lib)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the codebase to Zod v4 idioms by adding eslint-plugin-zod v3.0.1 and enforcing best practices through ESLint rules. The migration ensures consistency with Zod v4's recommended patterns while maintaining backward compatibility.
Changes:
- Added
eslint-plugin-zodv3.0.1 with comprehensive rule configuration - Migrated
.describe()calls to.meta({ description: ... })(Zod v4 idiom) - Replaced
z.number().int()withz.int()(Zod v4 native integer schema) - Fixed incorrect imports from
zod/v4tozod - Added type parameters to
.brand()calls for type safety - Disabled
no-any-schemaandno-unknown-schemarules (intentional for assertion library design)
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Added eslint-plugin-zod v3.0.1 dependency |
| package-lock.json | Added eslint-plugin-zod v3.0.1 with dependencies |
| eslint.config.js | Configured zod plugin rules with project-appropriate settings |
| packages/bupkis/src/schema.ts | Migrated .describe() to .meta(), z.number().int() to z.int() |
| packages/bupkis/src/metadata.ts | Migrated .describe() to .meta() |
| packages/bupkis/src/internal-schema.ts | Migrated .describe() to .meta() |
| packages/bupkis/src/assertion/slotify.ts | Migrated .describe() to .meta(), added type parameters to .brand() |
| packages/bupkis/src/assertion/impl/sync-iterable.ts | Fixed import from 'zod/v4' to 'zod' |
| packages/bupkis/src/assertion/impl/sync-basic.ts | Migrated .describe() to .meta() |
| packages/bupkis/src/assertion/impl/async-iterable.ts | Fixed import from 'zod/v4' to 'zod' |
| packages/property-testing/src/config.ts | Added eslint-disable comments for intentional custom schema usage |
Comments suppressed due to low confidence (6)
packages/bupkis/src/internal-schema.ts:111
- This
.describe()call was not migrated to.meta()as part of the Zod v4 migration. According to the PR description and thezod/prefer-metaESLint rule configured in eslint.config.js, all.describe()calls should be migrated to.meta({ description: ... }).
schema: SchemaSchema.describe('The sync schema to validate against'),
packages/bupkis/src/internal-schema.ts:115
- This
.describe()call was not migrated to.meta()as part of the Zod v4 migration. According to the PR description and thezod/prefer-metaESLint rule configured in eslint.config.js, all.describe()calls should be migrated to.meta({ description: ... }).
asyncSchema: SchemaSchema.describe('The async schema to validate against'),
packages/bupkis/src/schema.ts:459
- This
.describe()call was not migrated to.meta()as part of the Zod v4 migration. According to the PR description and thezod/prefer-metaESLint rule configured in eslint.config.js, all.describe()calls should be migrated to.meta({ description: ... }).
.describe('Function declared with the `async` keyword')
packages/bupkis/src/schema.ts:1013
- This
.describe()call was not migrated to.meta()as part of the Zod v4 migration. According to the PR description and thezod/prefer-metaESLint rule configured in eslint.config.js, all.describe()calls should be migrated to.meta({ description: ... }).
.describe(
'Duration string like "1 hour", "30 minutes", "2 days" (transforms to milliseconds)',
);
packages/bupkis/src/schema.ts:1098
- This
.describe()call was not migrated to.meta()as part of the Zod v4 migration. According to the PR description and thezod/prefer-metaESLint rule configured in eslint.config.js, all.describe()calls should be migrated to.meta({ description: ... }).
.describe('A Set or WeakSet instance');
packages/bupkis/src/schema.ts:1197
- This
.describe()call was not migrated to.meta()as part of the Zod v4 migration. According to the PR description and thezod/prefer-metaESLint rule configured in eslint.config.js, all.describe()calls should be migrated to.meta({ description: ... }).
.describe('A Map or WeakMap instance');
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
