Skip to content

Commit 6fd931a

Browse files
committed
chore: fix zod lint
1 parent 3f6de0f commit 6fd931a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

eslint-rules/enforce-zod-v4.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export default {
2222
create(context) {
2323
const currentFilePath = path.resolve(context.getFilename());
2424

25-
// Only enforce rule in config.ts
26-
if (currentFilePath !== configFilePath) {
25+
// Only allow zod v4 import in config.ts
26+
if (currentFilePath === configFilePath) {
2727
return {};
2828
}
2929

@@ -36,11 +36,9 @@ export default {
3636
return;
3737
}
3838

39-
// If importing from 'zod' or any 'zod/...' except 'zod/v4', only allow 'zod/v4' in config.ts
40-
const isZodImport = importPath === "zod" || importPath.startsWith("zod/");
4139
const isZodV4Import = importPath === "zod/v4";
4240

43-
if (isZodImport && !isZodV4Import) {
41+
if (isZodV4Import) {
4442
context.report({
4543
node,
4644
messageId: "enforceZodV4",

0 commit comments

Comments
 (0)