eslint-plugin-zod 3.1.0 → 3.2.0
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/README.md +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.js +3 -0
- package/dist/rules/no-number-schema-with-int.cjs +10 -15
- package/dist/rules/no-number-schema-with-int.js +10 -15
- package/dist/rules/no-string-schema-with-uuid.cjs +63 -0
- package/dist/rules/no-string-schema-with-uuid.d.cts +4 -0
- package/dist/rules/no-string-schema-with-uuid.d.ts +4 -0
- package/dist/rules/no-string-schema-with-uuid.js +60 -0
- package/dist/utils/build-zod-chain-replacement-fix.cjs +24 -0
- package/dist/utils/build-zod-chain-replacement-fix.d.cts +12 -0
- package/dist/utils/build-zod-chain-replacement-fix.d.ts +12 -0
- package/dist/utils/build-zod-chain-replacement-fix.js +21 -0
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
| [no-empty-custom-schema](docs/rules/no-empty-custom-schema.md) | Disallow usage of `z.custom()` without arguments | ✅ | | | |
|
|
40
40
|
| [no-number-schema-with-int](docs/rules/no-number-schema-with-int.md) | Disallow usage of `z.number().int()` as it is considered legacy | ✅ | 🔧 | | |
|
|
41
41
|
| [no-optional-and-default-together](docs/rules/no-optional-and-default-together.md) | Disallow using both `.optional()` and `.default()` on the same Zod schema | ✅ | 🔧 | | |
|
|
42
|
+
| [no-string-schema-with-uuid](docs/rules/no-string-schema-with-uuid.md) | Disallow usage of `z.string().uuid()` in favor of the dedicated `z.uuid()` schema | ✅ | 🔧 | | |
|
|
42
43
|
| [no-throw-in-refine](docs/rules/no-throw-in-refine.md) | Disallow throwing errors directly inside Zod refine callbacks | ✅ | | | |
|
|
43
44
|
| [no-unknown-schema](docs/rules/no-unknown-schema.md) | Disallow usage of `z.unknown()` in Zod schemas | | | | |
|
|
44
45
|
| [prefer-enum-over-literal-union](docs/rules/prefer-enum-over-literal-union.md) | Prefer `z.enum()` over `z.union()` when all members are string literals. | ✅ | 🔧 | | |
|
package/dist/index.cjs
CHANGED
|
@@ -9,6 +9,7 @@ const no_any_schema_js_1 = require("./rules/no-any-schema.cjs");
|
|
|
9
9
|
const no_empty_custom_schema_js_1 = require("./rules/no-empty-custom-schema.cjs");
|
|
10
10
|
const no_number_schema_with_int_js_1 = require("./rules/no-number-schema-with-int.cjs");
|
|
11
11
|
const no_optional_and_default_together_js_1 = require("./rules/no-optional-and-default-together.cjs");
|
|
12
|
+
const no_string_schema_with_uuid_js_1 = require("./rules/no-string-schema-with-uuid.cjs");
|
|
12
13
|
const no_throw_in_refine_js_1 = require("./rules/no-throw-in-refine.cjs");
|
|
13
14
|
const no_unknown_schema_js_1 = require("./rules/no-unknown-schema.cjs");
|
|
14
15
|
const prefer_enum_over_literal_union_js_1 = require("./rules/prefer-enum-over-literal-union.cjs");
|
|
@@ -32,6 +33,7 @@ const eslintPluginZod = {
|
|
|
32
33
|
'no-any-schema': no_any_schema_js_1.noAnySchema,
|
|
33
34
|
'no-empty-custom-schema': no_empty_custom_schema_js_1.noEmptyCustomSchema,
|
|
34
35
|
'no-number-schema-with-int': no_number_schema_with_int_js_1.noNumberSchemaWithInt,
|
|
36
|
+
'no-string-schema-with-uuid': no_string_schema_with_uuid_js_1.noStringSchemaWithUuid,
|
|
35
37
|
'no-optional-and-default-together': no_optional_and_default_together_js_1.noOptionalAndDefaultTogether,
|
|
36
38
|
'no-throw-in-refine': no_throw_in_refine_js_1.noThrowInRefine,
|
|
37
39
|
'no-unknown-schema': no_unknown_schema_js_1.noUnknownSchema,
|
|
@@ -57,6 +59,7 @@ const recommendedConfig = {
|
|
|
57
59
|
'zod/no-any-schema': 'error',
|
|
58
60
|
'zod/no-empty-custom-schema': 'error',
|
|
59
61
|
'zod/no-number-schema-with-int': 'error',
|
|
62
|
+
'zod/no-string-schema-with-uuid': 'error',
|
|
60
63
|
'zod/no-optional-and-default-together': 'error',
|
|
61
64
|
'zod/no-throw-in-refine': 'error',
|
|
62
65
|
'zod/prefer-enum-over-literal-union': 'error',
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { noAnySchema } from "./rules/no-any-schema.js";
|
|
|
7
7
|
import { noEmptyCustomSchema } from "./rules/no-empty-custom-schema.js";
|
|
8
8
|
import { noNumberSchemaWithInt } from "./rules/no-number-schema-with-int.js";
|
|
9
9
|
import { noOptionalAndDefaultTogether } from "./rules/no-optional-and-default-together.js";
|
|
10
|
+
import { noStringSchemaWithUuid } from "./rules/no-string-schema-with-uuid.js";
|
|
10
11
|
import { noThrowInRefine } from "./rules/no-throw-in-refine.js";
|
|
11
12
|
import { noUnknownSchema } from "./rules/no-unknown-schema.js";
|
|
12
13
|
import { preferEnumOverLiteralUnion } from "./rules/prefer-enum-over-literal-union.js";
|
|
@@ -30,6 +31,7 @@ const eslintPluginZod = {
|
|
|
30
31
|
'no-any-schema': noAnySchema,
|
|
31
32
|
'no-empty-custom-schema': noEmptyCustomSchema,
|
|
32
33
|
'no-number-schema-with-int': noNumberSchemaWithInt,
|
|
34
|
+
'no-string-schema-with-uuid': noStringSchemaWithUuid,
|
|
33
35
|
'no-optional-and-default-together': noOptionalAndDefaultTogether,
|
|
34
36
|
'no-throw-in-refine': noThrowInRefine,
|
|
35
37
|
'no-unknown-schema': noUnknownSchema,
|
|
@@ -55,6 +57,7 @@ const recommendedConfig = {
|
|
|
55
57
|
'zod/no-any-schema': 'error',
|
|
56
58
|
'zod/no-empty-custom-schema': 'error',
|
|
57
59
|
'zod/no-number-schema-with-int': 'error',
|
|
60
|
+
'zod/no-string-schema-with-uuid': 'error',
|
|
58
61
|
'zod/no-optional-and-default-together': 'error',
|
|
59
62
|
'zod/no-throw-in-refine': 'error',
|
|
60
63
|
'zod/prefer-enum-over-literal-union': 'error',
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.noNumberSchemaWithInt = void 0;
|
|
4
4
|
const utils_1 = require("@typescript-eslint/utils");
|
|
5
5
|
const meta_js_1 = require("../meta.cjs");
|
|
6
|
+
const build_zod_chain_replacement_fix_js_1 = require("../utils/build-zod-chain-replacement-fix.cjs");
|
|
6
7
|
const track_zod_schema_imports_js_1 = require("../utils/track-zod-schema-imports.cjs");
|
|
7
8
|
exports.noNumberSchemaWithInt = utils_1.ESLintUtils.RuleCreator(meta_js_1.getRuleURL)({
|
|
8
9
|
name: 'no-number-schema-with-int',
|
|
@@ -29,13 +30,11 @@ exports.noNumberSchemaWithInt = utils_1.ESLintUtils.RuleCreator(meta_js_1.getRul
|
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
32
|
const methods = collectZodChainMethods(node);
|
|
32
|
-
const numberIndex = methods.findIndex((m) => m.name === 'number');
|
|
33
33
|
const intIndex = methods.findIndex((m) => m.name === 'int');
|
|
34
|
-
if (
|
|
34
|
+
if (intIndex === -1) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
const
|
|
38
|
-
const intNode = methods[intIndex].node;
|
|
37
|
+
const numberIndex = methods.findIndex((m) => m.name === 'number');
|
|
39
38
|
if (zodSchemaMeta.schemaDecl === 'named') {
|
|
40
39
|
context.report({
|
|
41
40
|
node,
|
|
@@ -47,18 +46,14 @@ exports.noNumberSchemaWithInt = utils_1.ESLintUtils.RuleCreator(meta_js_1.getRul
|
|
|
47
46
|
node,
|
|
48
47
|
messageId: 'removeNumber',
|
|
49
48
|
fix(fixer) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const fullText = sourceCode.getText(m.node);
|
|
58
|
-
return fullText.slice(objText.length);
|
|
49
|
+
return (0, build_zod_chain_replacement_fix_js_1.buildZodChainReplacementFix)({
|
|
50
|
+
sourceCode,
|
|
51
|
+
fixer,
|
|
52
|
+
methods,
|
|
53
|
+
fromIndex: numberIndex,
|
|
54
|
+
toIndex: intIndex,
|
|
55
|
+
toMethodName: 'int',
|
|
59
56
|
});
|
|
60
|
-
const replacement = `${prefixText}.int()${betweenSuffixes.join('')}`;
|
|
61
|
-
return fixer.replaceTextRange([numberNode.range[0], intNode.range[1]], replacement);
|
|
62
57
|
},
|
|
63
58
|
});
|
|
64
59
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
2
|
import { getRuleURL } from "../meta.js";
|
|
3
|
+
import { buildZodChainReplacementFix } from "../utils/build-zod-chain-replacement-fix.js";
|
|
3
4
|
import { trackZodSchemaImports } from "../utils/track-zod-schema-imports.js";
|
|
4
5
|
export const noNumberSchemaWithInt = ESLintUtils.RuleCreator(getRuleURL)({
|
|
5
6
|
name: 'no-number-schema-with-int',
|
|
@@ -26,13 +27,11 @@ export const noNumberSchemaWithInt = ESLintUtils.RuleCreator(getRuleURL)({
|
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
29
|
const methods = collectZodChainMethods(node);
|
|
29
|
-
const numberIndex = methods.findIndex((m) => m.name === 'number');
|
|
30
30
|
const intIndex = methods.findIndex((m) => m.name === 'int');
|
|
31
|
-
if (
|
|
31
|
+
if (intIndex === -1) {
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
const
|
|
35
|
-
const intNode = methods[intIndex].node;
|
|
34
|
+
const numberIndex = methods.findIndex((m) => m.name === 'number');
|
|
36
35
|
if (zodSchemaMeta.schemaDecl === 'named') {
|
|
37
36
|
context.report({
|
|
38
37
|
node,
|
|
@@ -44,18 +43,14 @@ export const noNumberSchemaWithInt = ESLintUtils.RuleCreator(getRuleURL)({
|
|
|
44
43
|
node,
|
|
45
44
|
messageId: 'removeNumber',
|
|
46
45
|
fix(fixer) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const fullText = sourceCode.getText(m.node);
|
|
55
|
-
return fullText.slice(objText.length);
|
|
46
|
+
return buildZodChainReplacementFix({
|
|
47
|
+
sourceCode,
|
|
48
|
+
fixer,
|
|
49
|
+
methods,
|
|
50
|
+
fromIndex: numberIndex,
|
|
51
|
+
toIndex: intIndex,
|
|
52
|
+
toMethodName: 'int',
|
|
56
53
|
});
|
|
57
|
-
const replacement = `${prefixText}.int()${betweenSuffixes.join('')}`;
|
|
58
|
-
return fixer.replaceTextRange([numberNode.range[0], intNode.range[1]], replacement);
|
|
59
54
|
},
|
|
60
55
|
});
|
|
61
56
|
},
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.noStringSchemaWithUuid = void 0;
|
|
4
|
+
const utils_1 = require("@typescript-eslint/utils");
|
|
5
|
+
const meta_js_1 = require("../meta.cjs");
|
|
6
|
+
const build_zod_chain_replacement_fix_js_1 = require("../utils/build-zod-chain-replacement-fix.cjs");
|
|
7
|
+
const track_zod_schema_imports_js_1 = require("../utils/track-zod-schema-imports.cjs");
|
|
8
|
+
exports.noStringSchemaWithUuid = utils_1.ESLintUtils.RuleCreator(meta_js_1.getRuleURL)({
|
|
9
|
+
name: 'no-string-schema-with-uuid',
|
|
10
|
+
meta: {
|
|
11
|
+
fixable: 'code',
|
|
12
|
+
type: 'problem',
|
|
13
|
+
docs: {
|
|
14
|
+
description: 'Disallow usage of `z.string().uuid()` in favor of the dedicated `z.uuid()` schema',
|
|
15
|
+
url: 'https://zod.dev/api#uuids',
|
|
16
|
+
},
|
|
17
|
+
messages: {
|
|
18
|
+
useUuid: '`z.string().uuid()` is redundant. Use `z.uuid()` instead.',
|
|
19
|
+
},
|
|
20
|
+
schema: [],
|
|
21
|
+
},
|
|
22
|
+
defaultOptions: [],
|
|
23
|
+
create(context) {
|
|
24
|
+
const { sourceCode } = context;
|
|
25
|
+
const { importDeclarationListener, detectZodSchemaRootNode, collectZodChainMethods, } = (0, track_zod_schema_imports_js_1.trackZodSchemaImports)();
|
|
26
|
+
return {
|
|
27
|
+
ImportDeclaration: importDeclarationListener,
|
|
28
|
+
CallExpression(node) {
|
|
29
|
+
const zodSchemaMeta = detectZodSchemaRootNode(node);
|
|
30
|
+
if ((zodSchemaMeta === null || zodSchemaMeta === void 0 ? void 0 : zodSchemaMeta.schemaType) !== 'string') {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const methods = collectZodChainMethods(node);
|
|
34
|
+
const uuidIndex = methods.findIndex((m) => m.name === 'uuid');
|
|
35
|
+
if (uuidIndex === -1) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const stringIndex = methods.findIndex((m) => m.name === 'string');
|
|
39
|
+
if (zodSchemaMeta.schemaDecl === 'named') {
|
|
40
|
+
context.report({
|
|
41
|
+
node,
|
|
42
|
+
messageId: 'useUuid',
|
|
43
|
+
});
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
context.report({
|
|
47
|
+
node,
|
|
48
|
+
messageId: 'useUuid',
|
|
49
|
+
fix(fixer) {
|
|
50
|
+
return (0, build_zod_chain_replacement_fix_js_1.buildZodChainReplacementFix)({
|
|
51
|
+
sourceCode,
|
|
52
|
+
fixer,
|
|
53
|
+
methods,
|
|
54
|
+
fromIndex: stringIndex,
|
|
55
|
+
toIndex: uuidIndex,
|
|
56
|
+
toMethodName: 'uuid',
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
import { getRuleURL } from "../meta.js";
|
|
3
|
+
import { buildZodChainReplacementFix } from "../utils/build-zod-chain-replacement-fix.js";
|
|
4
|
+
import { trackZodSchemaImports } from "../utils/track-zod-schema-imports.js";
|
|
5
|
+
export const noStringSchemaWithUuid = ESLintUtils.RuleCreator(getRuleURL)({
|
|
6
|
+
name: 'no-string-schema-with-uuid',
|
|
7
|
+
meta: {
|
|
8
|
+
fixable: 'code',
|
|
9
|
+
type: 'problem',
|
|
10
|
+
docs: {
|
|
11
|
+
description: 'Disallow usage of `z.string().uuid()` in favor of the dedicated `z.uuid()` schema',
|
|
12
|
+
url: 'https://zod.dev/api#uuids',
|
|
13
|
+
},
|
|
14
|
+
messages: {
|
|
15
|
+
useUuid: '`z.string().uuid()` is redundant. Use `z.uuid()` instead.',
|
|
16
|
+
},
|
|
17
|
+
schema: [],
|
|
18
|
+
},
|
|
19
|
+
defaultOptions: [],
|
|
20
|
+
create(context) {
|
|
21
|
+
const { sourceCode } = context;
|
|
22
|
+
const { importDeclarationListener, detectZodSchemaRootNode, collectZodChainMethods, } = trackZodSchemaImports();
|
|
23
|
+
return {
|
|
24
|
+
ImportDeclaration: importDeclarationListener,
|
|
25
|
+
CallExpression(node) {
|
|
26
|
+
const zodSchemaMeta = detectZodSchemaRootNode(node);
|
|
27
|
+
if ((zodSchemaMeta === null || zodSchemaMeta === void 0 ? void 0 : zodSchemaMeta.schemaType) !== 'string') {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const methods = collectZodChainMethods(node);
|
|
31
|
+
const uuidIndex = methods.findIndex((m) => m.name === 'uuid');
|
|
32
|
+
if (uuidIndex === -1) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const stringIndex = methods.findIndex((m) => m.name === 'string');
|
|
36
|
+
if (zodSchemaMeta.schemaDecl === 'named') {
|
|
37
|
+
context.report({
|
|
38
|
+
node,
|
|
39
|
+
messageId: 'useUuid',
|
|
40
|
+
});
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
context.report({
|
|
44
|
+
node,
|
|
45
|
+
messageId: 'useUuid',
|
|
46
|
+
fix(fixer) {
|
|
47
|
+
return buildZodChainReplacementFix({
|
|
48
|
+
sourceCode,
|
|
49
|
+
fixer,
|
|
50
|
+
methods,
|
|
51
|
+
fromIndex: stringIndex,
|
|
52
|
+
toIndex: uuidIndex,
|
|
53
|
+
toMethodName: 'uuid',
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildZodChainReplacementFix = buildZodChainReplacementFix;
|
|
4
|
+
function buildZodChainReplacementFix(opts) {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
const { sourceCode, fixer, methods, fromIndex, toIndex, toMethodName } = opts;
|
|
7
|
+
const fromNode = (_a = methods[fromIndex]) === null || _a === void 0 ? void 0 : _a.node;
|
|
8
|
+
const toNode = (_b = methods[toIndex]) === null || _b === void 0 ? void 0 : _b.node;
|
|
9
|
+
if (!fromNode || !toNode) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const fromCallee = fromNode.callee;
|
|
13
|
+
const prefixObj = fromCallee.object;
|
|
14
|
+
const prefixText = sourceCode.getText(prefixObj);
|
|
15
|
+
const methodsBetween = methods.slice(fromIndex + 1, toIndex);
|
|
16
|
+
const betweenSuffixes = methodsBetween.map((m) => {
|
|
17
|
+
const betweenCallee = m.node.callee;
|
|
18
|
+
const objText = sourceCode.getText(betweenCallee.object);
|
|
19
|
+
const fullText = sourceCode.getText(m.node);
|
|
20
|
+
return fullText.slice(objText.length);
|
|
21
|
+
});
|
|
22
|
+
const replacement = `${prefixText}.${toMethodName}()${betweenSuffixes.join('')}`;
|
|
23
|
+
return fixer.replaceTextRange([fromNode.range[0], toNode.range[1]], replacement);
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
export declare function buildZodChainReplacementFix(opts: {
|
|
3
|
+
sourceCode: TSESLint.SourceCode;
|
|
4
|
+
fixer: TSESLint.RuleFixer;
|
|
5
|
+
methods: Array<{
|
|
6
|
+
name: string;
|
|
7
|
+
node: TSESTree.CallExpression;
|
|
8
|
+
}>;
|
|
9
|
+
fromIndex: number;
|
|
10
|
+
toIndex: number;
|
|
11
|
+
toMethodName: string;
|
|
12
|
+
}): TSESLint.RuleFix | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
export declare function buildZodChainReplacementFix(opts: {
|
|
3
|
+
sourceCode: TSESLint.SourceCode;
|
|
4
|
+
fixer: TSESLint.RuleFixer;
|
|
5
|
+
methods: Array<{
|
|
6
|
+
name: string;
|
|
7
|
+
node: TSESTree.CallExpression;
|
|
8
|
+
}>;
|
|
9
|
+
fromIndex: number;
|
|
10
|
+
toIndex: number;
|
|
11
|
+
toMethodName: string;
|
|
12
|
+
}): TSESLint.RuleFix | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function buildZodChainReplacementFix(opts) {
|
|
2
|
+
var _a, _b;
|
|
3
|
+
const { sourceCode, fixer, methods, fromIndex, toIndex, toMethodName } = opts;
|
|
4
|
+
const fromNode = (_a = methods[fromIndex]) === null || _a === void 0 ? void 0 : _a.node;
|
|
5
|
+
const toNode = (_b = methods[toIndex]) === null || _b === void 0 ? void 0 : _b.node;
|
|
6
|
+
if (!fromNode || !toNode) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
const fromCallee = fromNode.callee;
|
|
10
|
+
const prefixObj = fromCallee.object;
|
|
11
|
+
const prefixText = sourceCode.getText(prefixObj);
|
|
12
|
+
const methodsBetween = methods.slice(fromIndex + 1, toIndex);
|
|
13
|
+
const betweenSuffixes = methodsBetween.map((m) => {
|
|
14
|
+
const betweenCallee = m.node.callee;
|
|
15
|
+
const objText = sourceCode.getText(betweenCallee.object);
|
|
16
|
+
const fullText = sourceCode.getText(m.node);
|
|
17
|
+
return fullText.slice(objText.length);
|
|
18
|
+
});
|
|
19
|
+
const replacement = `${prefixText}.${toMethodName}()${betweenSuffixes.join('')}`;
|
|
20
|
+
return fixer.replaceTextRange([fromNode.range[0], toNode.range[1]], replacement);
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-zod",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "ESLint plugin that adds custom linting rules to enforce best practices when using Zod",
|
|
6
6
|
"engines": {
|
|
@@ -62,19 +62,19 @@
|
|
|
62
62
|
"@marcalexiei/prettier-config": "1.1.4",
|
|
63
63
|
"@types/esquery": "1.5.4",
|
|
64
64
|
"@types/node": "24.10.1",
|
|
65
|
-
"@typescript-eslint/rule-tester": "8.
|
|
66
|
-
"@vitest/eslint-plugin": "1.6.
|
|
65
|
+
"@typescript-eslint/rule-tester": "8.56.1",
|
|
66
|
+
"@vitest/eslint-plugin": "1.6.9",
|
|
67
67
|
"dedent": "1.7.1",
|
|
68
68
|
"eslint": "9.39.2",
|
|
69
|
-
"eslint-doc-generator": "3.0
|
|
69
|
+
"eslint-doc-generator": "3.2.0",
|
|
70
70
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
71
|
-
"eslint-plugin-eslint-plugin": "7.3.
|
|
71
|
+
"eslint-plugin-eslint-plugin": "7.3.1",
|
|
72
72
|
"eslint-plugin-import-x": "4.16.1",
|
|
73
|
-
"eslint-plugin-n": "17.
|
|
74
|
-
"knip": "5.
|
|
73
|
+
"eslint-plugin-n": "17.24.0",
|
|
74
|
+
"knip": "5.85.0",
|
|
75
75
|
"prettier": "3.8.1",
|
|
76
76
|
"typescript": "5.9.3",
|
|
77
|
-
"typescript-eslint": "8.
|
|
77
|
+
"typescript-eslint": "8.56.1",
|
|
78
78
|
"vitest": "4.0.18",
|
|
79
79
|
"zshy": "0.7.0"
|
|
80
80
|
},
|