Skip to content

Commit 786e7b6

Browse files
authored
refactor: switch to zod 4 (#424)
1 parent e020435 commit 786e7b6

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

packages/eslint-plugin/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@
6565
"synckit": "^0.10.3",
6666
"ts-pattern": "^5.6.2",
6767
"tsx": "^4.19.3",
68-
"zod": "^3.24.2",
69-
"zod-to-json-schema": "3.24.5"
68+
"zod": "^4.1.12"
7069
},
7170
"peerDependencies": {
7271
"@typescript-eslint/utils": ">=8.0.0",

packages/eslint-plugin/src/rules/check-sql.rule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
import { JSONSchema4 } from "@typescript-eslint/utils/json-schema";
1111
import { match } from "ts-pattern";
1212
import ts from "typescript";
13-
import { zodToJsonSchema } from "zod-to-json-schema";
1413
import { ESTreeUtils } from "../utils";
1514
import { E, J, flow, pipe } from "../utils/fp-ts";
1615
import {
@@ -50,6 +49,7 @@ import {
5049
shouldLintFile,
5150
transformTypes,
5251
} from "./check-sql.utils";
52+
import z from "zod";
5353

5454
const messages = {
5555
typeInferenceFailed: "Type inference failed {{error}}",
@@ -500,7 +500,7 @@ export default createRule({
500500
},
501501
messages: messages,
502502
type: "problem",
503-
schema: zodToJsonSchema(RuleOptions, { target: "openApi3" }) as JSONSchema4,
503+
schema: z.toJSONSchema(RuleOptions, { target: "draft-4" }) as JSONSchema4,
504504
},
505505
defaultOptions: [],
506506
create(context) {

pnpm-lock.yaml

Lines changed: 5 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)