eslint-plugin-zod 4.2.0 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rules/array-style.cjs +3 -3
- package/dist/rules/array-style.mjs +3 -3
- package/dist/rules/no-native-enum.cjs +6 -14
- package/dist/rules/no-native-enum.mjs +6 -14
- package/dist/rules/no-number-schema-with-int.cjs +1 -7
- package/dist/rules/no-number-schema-with-int.mjs +1 -7
- package/dist/rules/no-number-schema-with-safe.cjs +1 -7
- package/dist/rules/no-number-schema-with-safe.mjs +1 -7
- package/dist/rules/no-string-schema-with-uuid.cjs +1 -7
- package/dist/rules/no-string-schema-with-uuid.mjs +1 -7
- package/dist/rules/prefer-enum-over-literal-union.cjs +4 -10
- package/dist/rules/prefer-enum-over-literal-union.mjs +4 -10
- package/dist/rules/prefer-string-schema-with-trim.cjs +1 -7
- package/dist/rules/prefer-string-schema-with-trim.mjs +1 -7
- package/dist/rules/prefer-top-level-string-formats.cjs +1 -11
- package/dist/rules/prefer-top-level-string-formats.mjs +1 -11
- package/dist/rules/prefer-trim-before-string-length-checks.cjs +1 -7
- package/dist/rules/prefer-trim-before-string-length-checks.mjs +1 -7
- package/package.json +37 -37
|
@@ -32,9 +32,9 @@ const arrayStyle = require_create_plugin_rule.createZodPluginRule({
|
|
|
32
32
|
return {
|
|
33
33
|
ImportDeclaration: importDeclarationListener,
|
|
34
34
|
CallExpression(node) {
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
37
|
-
const { schemaDecl, schemaType } =
|
|
35
|
+
const zodSchemaMeta = detectZodSchemaRootNode(node);
|
|
36
|
+
if (!zodSchemaMeta) return;
|
|
37
|
+
const { schemaDecl, schemaType } = zodSchemaMeta;
|
|
38
38
|
if (style === "method") {
|
|
39
39
|
if (schemaType === "array") {
|
|
40
40
|
if (schemaDecl === "namespace") {
|
|
@@ -31,9 +31,9 @@ const arrayStyle = createZodPluginRule({
|
|
|
31
31
|
return {
|
|
32
32
|
ImportDeclaration: importDeclarationListener,
|
|
33
33
|
CallExpression(node) {
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
36
|
-
const { schemaDecl, schemaType } =
|
|
34
|
+
const zodSchemaMeta = detectZodSchemaRootNode(node);
|
|
35
|
+
if (!zodSchemaMeta) return;
|
|
36
|
+
const { schemaDecl, schemaType } = zodSchemaMeta;
|
|
37
37
|
if (style === "method") {
|
|
38
38
|
if (schemaType === "array") {
|
|
39
39
|
if (schemaDecl === "namespace") {
|
|
@@ -15,27 +15,19 @@ const noNativeEnum = require_create_plugin_rule.createZodPluginRule({
|
|
|
15
15
|
},
|
|
16
16
|
defaultOptions: [],
|
|
17
17
|
create(context) {
|
|
18
|
-
const { importDeclarationListener, detectZodSchemaRootNode, collectZodChainMethods
|
|
18
|
+
const { importDeclarationListener, detectZodSchemaRootNode, collectZodChainMethods } = trackZodSchemaImports();
|
|
19
19
|
return {
|
|
20
20
|
ImportDeclaration: importDeclarationListener,
|
|
21
21
|
CallExpression(node) {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
if (!zodSchema || !isNativeEnumRoot) return;
|
|
26
|
-
if (zodSchema.schemaDecl === "named") {
|
|
27
|
-
context.report({
|
|
28
|
-
node,
|
|
29
|
-
messageId: "useEnum"
|
|
30
|
-
});
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
22
|
+
const zodSchemaMeta = detectZodSchemaRootNode(node);
|
|
23
|
+
if (zodSchemaMeta?.schemaType !== "nativeEnum") return;
|
|
24
|
+
const [{ node: rootMethodNode }] = collectZodChainMethods(zodSchemaMeta.node);
|
|
33
25
|
context.report({
|
|
34
26
|
node,
|
|
35
27
|
messageId: "useEnum",
|
|
36
28
|
fix(fixer) {
|
|
37
|
-
if (
|
|
38
|
-
return fixer.replaceText(
|
|
29
|
+
if (rootMethodNode.callee.type !== _typescript_eslint_utils.AST_NODE_TYPES.MemberExpression) return null;
|
|
30
|
+
return fixer.replaceText(rootMethodNode.callee.property, "enum");
|
|
39
31
|
}
|
|
40
32
|
});
|
|
41
33
|
}
|
|
@@ -14,27 +14,19 @@ const noNativeEnum = createZodPluginRule({
|
|
|
14
14
|
},
|
|
15
15
|
defaultOptions: [],
|
|
16
16
|
create(context) {
|
|
17
|
-
const { importDeclarationListener, detectZodSchemaRootNode, collectZodChainMethods
|
|
17
|
+
const { importDeclarationListener, detectZodSchemaRootNode, collectZodChainMethods } = trackZodSchemaImports();
|
|
18
18
|
return {
|
|
19
19
|
ImportDeclaration: importDeclarationListener,
|
|
20
20
|
CallExpression(node) {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
if (!zodSchema || !isNativeEnumRoot) return;
|
|
25
|
-
if (zodSchema.schemaDecl === "named") {
|
|
26
|
-
context.report({
|
|
27
|
-
node,
|
|
28
|
-
messageId: "useEnum"
|
|
29
|
-
});
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
21
|
+
const zodSchemaMeta = detectZodSchemaRootNode(node);
|
|
22
|
+
if (zodSchemaMeta?.schemaType !== "nativeEnum") return;
|
|
23
|
+
const [{ node: rootMethodNode }] = collectZodChainMethods(zodSchemaMeta.node);
|
|
32
24
|
context.report({
|
|
33
25
|
node,
|
|
34
26
|
messageId: "useEnum",
|
|
35
27
|
fix(fixer) {
|
|
36
|
-
if (
|
|
37
|
-
return fixer.replaceText(
|
|
28
|
+
if (rootMethodNode.callee.type !== AST_NODE_TYPES.MemberExpression) return null;
|
|
29
|
+
return fixer.replaceText(rootMethodNode.callee.property, "enum");
|
|
38
30
|
}
|
|
39
31
|
});
|
|
40
32
|
}
|
|
@@ -25,17 +25,11 @@ const noNumberSchemaWithInt = require_create_plugin_rule.createZodPluginRule({
|
|
|
25
25
|
const intIndex = methods.findIndex((m) => m.name === "int");
|
|
26
26
|
if (intIndex === -1) return;
|
|
27
27
|
const numberIndex = methods.findIndex((m) => m.name === "number");
|
|
28
|
-
if (zodSchemaMeta.schemaDecl === "named") {
|
|
29
|
-
context.report({
|
|
30
|
-
node,
|
|
31
|
-
messageId: "removeNumber"
|
|
32
|
-
});
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
28
|
context.report({
|
|
36
29
|
node,
|
|
37
30
|
messageId: "removeNumber",
|
|
38
31
|
fix(fixer) {
|
|
32
|
+
if (zodSchemaMeta.schemaDecl === "named") return null;
|
|
39
33
|
return (0, _eslint_zod_utils.buildZodChainReplacementFix)({
|
|
40
34
|
sourceCode,
|
|
41
35
|
fixer,
|
|
@@ -24,17 +24,11 @@ const noNumberSchemaWithInt = createZodPluginRule({
|
|
|
24
24
|
const intIndex = methods.findIndex((m) => m.name === "int");
|
|
25
25
|
if (intIndex === -1) return;
|
|
26
26
|
const numberIndex = methods.findIndex((m) => m.name === "number");
|
|
27
|
-
if (zodSchemaMeta.schemaDecl === "named") {
|
|
28
|
-
context.report({
|
|
29
|
-
node,
|
|
30
|
-
messageId: "removeNumber"
|
|
31
|
-
});
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
27
|
context.report({
|
|
35
28
|
node,
|
|
36
29
|
messageId: "removeNumber",
|
|
37
30
|
fix(fixer) {
|
|
31
|
+
if (zodSchemaMeta.schemaDecl === "named") return null;
|
|
38
32
|
return buildZodChainReplacementFix({
|
|
39
33
|
sourceCode,
|
|
40
34
|
fixer,
|
|
@@ -25,17 +25,11 @@ const noNumberSchemaWithSafe = require_create_plugin_rule.createZodPluginRule({
|
|
|
25
25
|
const safeIndex = methods.findIndex((m) => m.name === "safe" && m.node === node);
|
|
26
26
|
if (safeIndex === -1) return;
|
|
27
27
|
const numberIndex = methods.findIndex((m) => m.name === "number");
|
|
28
|
-
if (zodSchemaMeta.schemaDecl === "named") {
|
|
29
|
-
context.report({
|
|
30
|
-
node,
|
|
31
|
-
messageId: "useInt"
|
|
32
|
-
});
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
28
|
context.report({
|
|
36
29
|
node,
|
|
37
30
|
messageId: "useInt",
|
|
38
31
|
fix(fixer) {
|
|
32
|
+
if (zodSchemaMeta.schemaDecl === "named") return null;
|
|
39
33
|
return (0, _eslint_zod_utils.buildZodChainReplacementFix)({
|
|
40
34
|
sourceCode,
|
|
41
35
|
fixer,
|
|
@@ -24,17 +24,11 @@ const noNumberSchemaWithSafe = createZodPluginRule({
|
|
|
24
24
|
const safeIndex = methods.findIndex((m) => m.name === "safe" && m.node === node);
|
|
25
25
|
if (safeIndex === -1) return;
|
|
26
26
|
const numberIndex = methods.findIndex((m) => m.name === "number");
|
|
27
|
-
if (zodSchemaMeta.schemaDecl === "named") {
|
|
28
|
-
context.report({
|
|
29
|
-
node,
|
|
30
|
-
messageId: "useInt"
|
|
31
|
-
});
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
27
|
context.report({
|
|
35
28
|
node,
|
|
36
29
|
messageId: "useInt",
|
|
37
30
|
fix(fixer) {
|
|
31
|
+
if (zodSchemaMeta.schemaDecl === "named") return null;
|
|
38
32
|
return buildZodChainReplacementFix({
|
|
39
33
|
sourceCode,
|
|
40
34
|
fixer,
|
|
@@ -29,17 +29,11 @@ const noStringSchemaWithUuid = require_create_plugin_rule.createZodPluginRule({
|
|
|
29
29
|
const uuidIndex = methods.findIndex((m) => m.name === "uuid");
|
|
30
30
|
if (uuidIndex === -1) return;
|
|
31
31
|
const stringIndex = methods.findIndex((m) => m.name === "string");
|
|
32
|
-
if (zodSchemaMeta.schemaDecl === "named") {
|
|
33
|
-
context.report({
|
|
34
|
-
node,
|
|
35
|
-
messageId: "useUuid"
|
|
36
|
-
});
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
32
|
context.report({
|
|
40
33
|
node,
|
|
41
34
|
messageId: "useUuid",
|
|
42
35
|
fix(fixer) {
|
|
36
|
+
if (zodSchemaMeta.schemaDecl === "named") return null;
|
|
43
37
|
return (0, _eslint_zod_utils.buildZodChainReplacementFix)({
|
|
44
38
|
sourceCode,
|
|
45
39
|
fixer,
|
|
@@ -28,17 +28,11 @@ const noStringSchemaWithUuid = createZodPluginRule({
|
|
|
28
28
|
const uuidIndex = methods.findIndex((m) => m.name === "uuid");
|
|
29
29
|
if (uuidIndex === -1) return;
|
|
30
30
|
const stringIndex = methods.findIndex((m) => m.name === "string");
|
|
31
|
-
if (zodSchemaMeta.schemaDecl === "named") {
|
|
32
|
-
context.report({
|
|
33
|
-
node,
|
|
34
|
-
messageId: "useUuid"
|
|
35
|
-
});
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
31
|
context.report({
|
|
39
32
|
node,
|
|
40
33
|
messageId: "useUuid",
|
|
41
34
|
fix(fixer) {
|
|
35
|
+
if (zodSchemaMeta.schemaDecl === "named") return null;
|
|
42
36
|
return buildZodChainReplacementFix({
|
|
43
37
|
sourceCode,
|
|
44
38
|
fixer,
|
|
@@ -19,9 +19,9 @@ const preferEnumOverLiteralUnion = require_create_plugin_rule.createZodPluginRul
|
|
|
19
19
|
return {
|
|
20
20
|
ImportDeclaration: importDeclarationListener,
|
|
21
21
|
CallExpression(node) {
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
const union = collectZodChainMethods(
|
|
22
|
+
const zodSchemaMeta = detectZodSchemaRootNode(node);
|
|
23
|
+
if (zodSchemaMeta?.schemaType !== "union") return;
|
|
24
|
+
const union = collectZodChainMethods(zodSchemaMeta.node).find((it) => it.name === "union");
|
|
25
25
|
if (!union) return;
|
|
26
26
|
const unionNode = union.node;
|
|
27
27
|
const unionArgument = unionNode.arguments.at(0);
|
|
@@ -39,17 +39,11 @@ const preferEnumOverLiteralUnion = require_create_plugin_rule.createZodPluginRul
|
|
|
39
39
|
return null;
|
|
40
40
|
});
|
|
41
41
|
if (zodLiteralStrings.some((it) => it === null)) return;
|
|
42
|
-
if (zodSchema.schemaDecl === "named") {
|
|
43
|
-
context.report({
|
|
44
|
-
node,
|
|
45
|
-
messageId: "useEnum"
|
|
46
|
-
});
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
42
|
context.report({
|
|
50
43
|
node,
|
|
51
44
|
messageId: "useEnum",
|
|
52
45
|
fix(fixer) {
|
|
46
|
+
if (zodSchemaMeta.schemaDecl === "named") return null;
|
|
53
47
|
return [fixer.replaceText(unionNode.callee.property, "enum"), fixer.replaceText(unionNode.arguments[0], `[${zodLiteralStrings.join(", ")}]`)];
|
|
54
48
|
}
|
|
55
49
|
});
|
|
@@ -18,9 +18,9 @@ const preferEnumOverLiteralUnion = createZodPluginRule({
|
|
|
18
18
|
return {
|
|
19
19
|
ImportDeclaration: importDeclarationListener,
|
|
20
20
|
CallExpression(node) {
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
const union = collectZodChainMethods(
|
|
21
|
+
const zodSchemaMeta = detectZodSchemaRootNode(node);
|
|
22
|
+
if (zodSchemaMeta?.schemaType !== "union") return;
|
|
23
|
+
const union = collectZodChainMethods(zodSchemaMeta.node).find((it) => it.name === "union");
|
|
24
24
|
if (!union) return;
|
|
25
25
|
const unionNode = union.node;
|
|
26
26
|
const unionArgument = unionNode.arguments.at(0);
|
|
@@ -38,17 +38,11 @@ const preferEnumOverLiteralUnion = createZodPluginRule({
|
|
|
38
38
|
return null;
|
|
39
39
|
});
|
|
40
40
|
if (zodLiteralStrings.some((it) => it === null)) return;
|
|
41
|
-
if (zodSchema.schemaDecl === "named") {
|
|
42
|
-
context.report({
|
|
43
|
-
node,
|
|
44
|
-
messageId: "useEnum"
|
|
45
|
-
});
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
41
|
context.report({
|
|
49
42
|
node,
|
|
50
43
|
messageId: "useEnum",
|
|
51
44
|
fix(fixer) {
|
|
45
|
+
if (zodSchemaMeta.schemaDecl === "named") return null;
|
|
52
46
|
return [fixer.replaceText(unionNode.callee.property, "enum"), fixer.replaceText(unionNode.arguments[0], `[${zodLiteralStrings.join(", ")}]`)];
|
|
53
47
|
}
|
|
54
48
|
});
|
|
@@ -26,17 +26,11 @@ const preferStringSchemaWithTrim = require_create_plugin_rule.createZodPluginRul
|
|
|
26
26
|
})) return;
|
|
27
27
|
const methods = collectZodChainMethods(zodSchemaMeta.node);
|
|
28
28
|
if (methods.some((it) => it.name === "trim")) return;
|
|
29
|
-
if (zodSchemaMeta.schemaDecl === "named") {
|
|
30
|
-
context.report({
|
|
31
|
-
node,
|
|
32
|
-
messageId: "addTrim"
|
|
33
|
-
});
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
29
|
context.report({
|
|
37
30
|
node,
|
|
38
31
|
messageId: "addTrim",
|
|
39
32
|
fix(fixer) {
|
|
33
|
+
if (zodSchemaMeta.schemaDecl === "named") return null;
|
|
40
34
|
const lastMethod = methods.at(0);
|
|
41
35
|
return fixer.insertTextAfter(lastMethod.node, ".trim()");
|
|
42
36
|
}
|
|
@@ -25,17 +25,11 @@ const preferStringSchemaWithTrim = createZodPluginRule({
|
|
|
25
25
|
})) return;
|
|
26
26
|
const methods = collectZodChainMethods(zodSchemaMeta.node);
|
|
27
27
|
if (methods.some((it) => it.name === "trim")) return;
|
|
28
|
-
if (zodSchemaMeta.schemaDecl === "named") {
|
|
29
|
-
context.report({
|
|
30
|
-
node,
|
|
31
|
-
messageId: "addTrim"
|
|
32
|
-
});
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
28
|
context.report({
|
|
36
29
|
node,
|
|
37
30
|
messageId: "addTrim",
|
|
38
31
|
fix(fixer) {
|
|
32
|
+
if (zodSchemaMeta.schemaDecl === "named") return null;
|
|
39
33
|
const lastMethod = methods.at(0);
|
|
40
34
|
return fixer.insertTextAfter(lastMethod.node, ".trim()");
|
|
41
35
|
}
|
|
@@ -156,17 +156,6 @@ const preferTopLevelStringFormats = require_create_plugin_rule.createZodPluginRu
|
|
|
156
156
|
if (!formatMethod) return;
|
|
157
157
|
if (!isTopLevelStringFormatMethodName(formatMethod.name)) return;
|
|
158
158
|
const { replacementMethodName, sourceMethodName } = TOP_LEVEL_STRING_FORMATS_BY_SOURCE[formatMethod.name];
|
|
159
|
-
if (zodSchemaMeta.schemaDecl === "named") {
|
|
160
|
-
context.report({
|
|
161
|
-
node,
|
|
162
|
-
messageId: "preferTopLevelStringFormat",
|
|
163
|
-
data: {
|
|
164
|
-
replacementMethod: replacementMethodName,
|
|
165
|
-
sourceMethod: sourceMethodName
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
159
|
context.report({
|
|
171
160
|
node,
|
|
172
161
|
messageId: "preferTopLevelStringFormat",
|
|
@@ -175,6 +164,7 @@ const preferTopLevelStringFormats = require_create_plugin_rule.createZodPluginRu
|
|
|
175
164
|
sourceMethod: sourceMethodName
|
|
176
165
|
},
|
|
177
166
|
fix(fixer) {
|
|
167
|
+
if (zodSchemaMeta.schemaDecl === "named") return null;
|
|
178
168
|
return (0, _eslint_zod_utils.buildZodChainReplacementFix)({
|
|
179
169
|
sourceCode,
|
|
180
170
|
fixer,
|
|
@@ -155,17 +155,6 @@ const preferTopLevelStringFormats = createZodPluginRule({
|
|
|
155
155
|
if (!formatMethod) return;
|
|
156
156
|
if (!isTopLevelStringFormatMethodName(formatMethod.name)) return;
|
|
157
157
|
const { replacementMethodName, sourceMethodName } = TOP_LEVEL_STRING_FORMATS_BY_SOURCE[formatMethod.name];
|
|
158
|
-
if (zodSchemaMeta.schemaDecl === "named") {
|
|
159
|
-
context.report({
|
|
160
|
-
node,
|
|
161
|
-
messageId: "preferTopLevelStringFormat",
|
|
162
|
-
data: {
|
|
163
|
-
replacementMethod: replacementMethodName,
|
|
164
|
-
sourceMethod: sourceMethodName
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
158
|
context.report({
|
|
170
159
|
node,
|
|
171
160
|
messageId: "preferTopLevelStringFormat",
|
|
@@ -174,6 +163,7 @@ const preferTopLevelStringFormats = createZodPluginRule({
|
|
|
174
163
|
sourceMethod: sourceMethodName
|
|
175
164
|
},
|
|
176
165
|
fix(fixer) {
|
|
166
|
+
if (zodSchemaMeta.schemaDecl === "named") return null;
|
|
177
167
|
return buildZodChainReplacementFix({
|
|
178
168
|
sourceCode,
|
|
179
169
|
fixer,
|
|
@@ -35,17 +35,11 @@ const preferTrimBeforeStringLengthChecks = require_create_plugin_rule.createZodP
|
|
|
35
35
|
const firstLengthCheckIndex = methods.findIndex((m) => LENGTH_CHECK_METHODS.includes(m.name));
|
|
36
36
|
if (firstLengthCheckIndex === -1) return;
|
|
37
37
|
if (trimIndex < firstLengthCheckIndex) return;
|
|
38
|
-
if (zodSchemaMeta.schemaDecl === "named") {
|
|
39
|
-
context.report({
|
|
40
|
-
node,
|
|
41
|
-
messageId: "trimBeforeLengthCheck"
|
|
42
|
-
});
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
38
|
context.report({
|
|
46
39
|
node,
|
|
47
40
|
messageId: "trimBeforeLengthCheck",
|
|
48
41
|
fix(fixer) {
|
|
42
|
+
if (zodSchemaMeta.schemaDecl === "named") return null;
|
|
49
43
|
const stringMethodNode = methods[0].node;
|
|
50
44
|
const trimMethodNode = methods[trimIndex].node;
|
|
51
45
|
const trimCallee = trimMethodNode.callee;
|
|
@@ -34,17 +34,11 @@ const preferTrimBeforeStringLengthChecks = createZodPluginRule({
|
|
|
34
34
|
const firstLengthCheckIndex = methods.findIndex((m) => LENGTH_CHECK_METHODS.includes(m.name));
|
|
35
35
|
if (firstLengthCheckIndex === -1) return;
|
|
36
36
|
if (trimIndex < firstLengthCheckIndex) return;
|
|
37
|
-
if (zodSchemaMeta.schemaDecl === "named") {
|
|
38
|
-
context.report({
|
|
39
|
-
node,
|
|
40
|
-
messageId: "trimBeforeLengthCheck"
|
|
41
|
-
});
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
37
|
context.report({
|
|
45
38
|
node,
|
|
46
39
|
messageId: "trimBeforeLengthCheck",
|
|
47
40
|
fix(fixer) {
|
|
41
|
+
if (zodSchemaMeta.schemaDecl === "named") return null;
|
|
48
42
|
const stringMethodNode = methods[0].node;
|
|
49
43
|
const trimMethodNode = methods[trimIndex].node;
|
|
50
44
|
const trimCallee = trimMethodNode.callee;
|
package/package.json
CHANGED
|
@@ -1,49 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-zod",
|
|
3
|
-
"version": "4.2.
|
|
4
|
-
"type": "module",
|
|
3
|
+
"version": "4.2.2",
|
|
5
4
|
"description": "ESLint plugin that adds custom linting rules to enforce best practices when using Zod",
|
|
6
|
-
"engines": {
|
|
7
|
-
"node": "^20 || ^22 || >=24"
|
|
8
|
-
},
|
|
9
|
-
"publishConfig": {
|
|
10
|
-
"access": "public"
|
|
11
|
-
},
|
|
12
|
-
"main": "./dist/index.cjs",
|
|
13
|
-
"types": "./dist/index.d.cts",
|
|
14
|
-
"module": "./dist/index.mjs",
|
|
15
|
-
"exports": {
|
|
16
|
-
".": {
|
|
17
|
-
"import": "./dist/index.mjs",
|
|
18
|
-
"require": "./dist/index.cjs"
|
|
19
|
-
},
|
|
20
|
-
"./package.json": "./package.json"
|
|
21
|
-
},
|
|
22
|
-
"homepage": "https://github.com/marcalexiei/eslint-zod#readme",
|
|
23
|
-
"bugs": {
|
|
24
|
-
"url": "https://github.com/marcalexiei/eslint-zod/issues"
|
|
25
|
-
},
|
|
26
5
|
"keywords": [
|
|
27
6
|
"eslint",
|
|
28
|
-
"eslintplugin",
|
|
29
7
|
"eslint-plugin",
|
|
8
|
+
"eslintplugin",
|
|
30
9
|
"oxlint",
|
|
31
10
|
"zod"
|
|
32
11
|
],
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
12
|
+
"homepage": "https://github.com/marcalexiei/eslint-zod#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/marcalexiei/eslint-zod/issues"
|
|
15
|
+
},
|
|
37
16
|
"license": "MIT",
|
|
17
|
+
"author": "Marco Pasqualetti @marcalexiei",
|
|
38
18
|
"repository": {
|
|
39
19
|
"type": "git",
|
|
40
20
|
"url": "https://github.com/marcalexiei/eslint-zod",
|
|
41
21
|
"directory": "plugins/eslint-plugin-zod"
|
|
42
22
|
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "./dist/index.cjs",
|
|
28
|
+
"module": "./dist/index.mjs",
|
|
29
|
+
"types": "./dist/index.d.cts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"import": "./dist/index.mjs",
|
|
33
|
+
"require": "./dist/index.cjs"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
43
40
|
"dependencies": {
|
|
44
41
|
"@typescript-eslint/utils": "^8.57.0",
|
|
45
42
|
"esquery": "^1.6.0",
|
|
46
|
-
"@eslint-zod/utils": "1.0
|
|
43
|
+
"@eslint-zod/utils": "1.2.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@marcalexiei/prettier-config": "1.1.4",
|
|
47
|
+
"@types/esquery": "1.5.4",
|
|
48
|
+
"@typescript-eslint/rule-tester": "8.59.2",
|
|
49
|
+
"dedent": "1.7.2",
|
|
50
|
+
"eslint-doc-generator": "3.3.2",
|
|
51
|
+
"prettier": "3.8.3",
|
|
52
|
+
"tsdown": "0.21.10",
|
|
53
|
+
"vitest": "4.1.5"
|
|
47
54
|
},
|
|
48
55
|
"peerDependencies": {
|
|
49
56
|
"eslint": "^9 || ^10",
|
|
@@ -61,15 +68,8 @@
|
|
|
61
68
|
"optional": true
|
|
62
69
|
}
|
|
63
70
|
},
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"@types/esquery": "1.5.4",
|
|
67
|
-
"@typescript-eslint/rule-tester": "8.59.2",
|
|
68
|
-
"dedent": "1.7.2",
|
|
69
|
-
"eslint-doc-generator": "3.3.2",
|
|
70
|
-
"prettier": "3.8.3",
|
|
71
|
-
"tsdown": "0.21.10",
|
|
72
|
-
"vitest": "4.1.5"
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": "^20 || ^22 || >=24"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"build": "tsdown",
|