eslint-plugin-zod 3.10.0 → 3.11.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 CHANGED
@@ -43,8 +43,8 @@ This plugin is primarily built for `zod`, so some rules are exclusive to `zod` a
43
43
  | [consistent-import](docs/rules/consistent-import.md) | Enforce a consistent import style for Zod | ✅ | 🔧 | | |
44
44
  | [consistent-import-source](docs/rules/consistent-import-source.md) | Enforce consistent source from Zod imports | | | 💡 | |
45
45
  | [consistent-object-schema-type](docs/rules/consistent-object-schema-type.md) | Enforce consistent usage of Zod schema methods | | | 💡 | |
46
- | [consistent-schema-name](docs/rules/consistent-schema-name.md) | Enforce a consistent naming convention for Zod schema variables | ✅ ✔️ | | | |
47
46
  | [consistent-schema-output-type-style](docs/rules/consistent-schema-output-type-style.md) | Enforce consistent use of z.infer or z.output for schema type inference | | 🔧 | | |
47
+ | [consistent-schema-var-name](docs/rules/consistent-schema-var-name.md) | Enforce a consistent naming convention for Zod schema variables | ✅ ✔️ | | | |
48
48
  | [no-any-schema](docs/rules/no-any-schema.md) | Disallow usage of `z.any()` in Zod schemas | ✅ ✔️ | | 💡 | |
49
49
  | [no-empty-custom-schema](docs/rules/no-empty-custom-schema.md) | Disallow usage of `z.custom()` without arguments | ✅ | | | |
50
50
  | [no-unknown-schema](docs/rules/no-unknown-schema.md) | Disallow usage of `z.unknown()` in Zod schemas | | | | |
package/dist/index.cjs CHANGED
@@ -3,8 +3,8 @@ const require_array_style = require("./rules/array-style.cjs");
3
3
  const require_consistent_import_source = require("./rules/consistent-import-source.cjs");
4
4
  const require_consistent_import = require("./rules/consistent-import.cjs");
5
5
  const require_consistent_object_schema_type = require("./rules/consistent-object-schema-type.cjs");
6
- const require_consistent_schema_name = require("./rules/consistent-schema-name.cjs");
7
6
  const require_consistent_schema_output_type_style = require("./rules/consistent-schema-output-type-style.cjs");
7
+ const require_consistent_schema_var_name = require("./rules/consistent-schema-var-name.cjs");
8
8
  const require_no_any_schema = require("./rules/no-any-schema.cjs");
9
9
  const require_no_empty_custom_schema = require("./rules/no-empty-custom-schema.cjs");
10
10
  const require_no_number_schema_with_finite = require("./rules/no-number-schema-with-finite.cjs");
@@ -38,7 +38,7 @@ const eslintPluginZod = {
38
38
  "consistent-import-source": require_consistent_import_source.consistentImportSource,
39
39
  "consistent-import": require_consistent_import.consistentImport,
40
40
  "consistent-object-schema-type": require_consistent_object_schema_type.consistentObjectSchemaType,
41
- "consistent-schema-name": require_consistent_schema_name.consistentSchemaName,
41
+ "consistent-schema-var-name": require_consistent_schema_var_name.consistentSchemaVarName,
42
42
  "consistent-schema-output-type-style": require_consistent_schema_output_type_style.consistentSchemaOutputTypeStyle,
43
43
  "no-any-schema": require_no_any_schema.noAnySchema,
44
44
  "no-empty-custom-schema": require_no_empty_custom_schema.noEmptyCustomSchema,
@@ -74,7 +74,7 @@ const recommendedConfig = {
74
74
  rules: {
75
75
  "zod/array-style": "error",
76
76
  "zod/consistent-import": "error",
77
- "zod/consistent-schema-name": "error",
77
+ "zod/consistent-schema-var-name": "error",
78
78
  "zod/no-any-schema": "error",
79
79
  "zod/no-empty-custom-schema": "error",
80
80
  "zod/no-number-schema-with-finite": "error",
@@ -97,7 +97,7 @@ const recommendedConfig = {
97
97
  const recommendedConfigMini = {
98
98
  ...baseConfig,
99
99
  rules: {
100
- "zod/consistent-schema-name": "error",
100
+ "zod/consistent-schema-var-name": "error",
101
101
  "zod/no-any-schema": "error",
102
102
  "zod/prefer-meta": "error",
103
103
  "zod/require-brand-type-parameter": "error",
package/dist/index.mjs CHANGED
@@ -3,8 +3,8 @@ import { arrayStyle } from "./rules/array-style.mjs";
3
3
  import { consistentImportSource } from "./rules/consistent-import-source.mjs";
4
4
  import { consistentImport } from "./rules/consistent-import.mjs";
5
5
  import { consistentObjectSchemaType } from "./rules/consistent-object-schema-type.mjs";
6
- import { consistentSchemaName } from "./rules/consistent-schema-name.mjs";
7
6
  import { consistentSchemaOutputTypeStyle } from "./rules/consistent-schema-output-type-style.mjs";
7
+ import { consistentSchemaVarName } from "./rules/consistent-schema-var-name.mjs";
8
8
  import { noAnySchema } from "./rules/no-any-schema.mjs";
9
9
  import { noEmptyCustomSchema } from "./rules/no-empty-custom-schema.mjs";
10
10
  import { noNumberSchemaWithFinite } from "./rules/no-number-schema-with-finite.mjs";
@@ -38,7 +38,7 @@ const eslintPluginZod = {
38
38
  "consistent-import-source": consistentImportSource,
39
39
  "consistent-import": consistentImport,
40
40
  "consistent-object-schema-type": consistentObjectSchemaType,
41
- "consistent-schema-name": consistentSchemaName,
41
+ "consistent-schema-var-name": consistentSchemaVarName,
42
42
  "consistent-schema-output-type-style": consistentSchemaOutputTypeStyle,
43
43
  "no-any-schema": noAnySchema,
44
44
  "no-empty-custom-schema": noEmptyCustomSchema,
@@ -74,7 +74,7 @@ const recommendedConfig = {
74
74
  rules: {
75
75
  "zod/array-style": "error",
76
76
  "zod/consistent-import": "error",
77
- "zod/consistent-schema-name": "error",
77
+ "zod/consistent-schema-var-name": "error",
78
78
  "zod/no-any-schema": "error",
79
79
  "zod/no-empty-custom-schema": "error",
80
80
  "zod/no-number-schema-with-finite": "error",
@@ -97,7 +97,7 @@ const recommendedConfig = {
97
97
  const recommendedConfigMini = {
98
98
  ...baseConfig,
99
99
  rules: {
100
- "zod/consistent-schema-name": "error",
100
+ "zod/consistent-schema-var-name": "error",
101
101
  "zod/no-any-schema": "error",
102
102
  "zod/prefer-meta": "error",
103
103
  "zod/require-brand-type-parameter": "error",
@@ -2,10 +2,10 @@ require("../_virtual/_rolldown/runtime.cjs");
2
2
  const require_create_plugin_rule = require("../utils/create-plugin-rule.cjs");
3
3
  const require_track_zod_schema_imports = require("../utils/track-zod-schema-imports.cjs");
4
4
  let _typescript_eslint_utils = require("@typescript-eslint/utils");
5
- //#region src/rules/consistent-schema-name.ts
5
+ //#region src/rules/consistent-schema-var-name.ts
6
6
  const { zodImportAllowedSource, trackZodSchemaImports } = require_track_zod_schema_imports.createZodSchemaImportTrack("all");
7
- const consistentSchemaName = require_create_plugin_rule.createZodPluginRule({
8
- name: "consistent-schema-name",
7
+ const consistentSchemaVarName = require_create_plugin_rule.createZodPluginRule({
8
+ name: "consistent-schema-var-name",
9
9
  meta: {
10
10
  type: "suggestion",
11
11
  docs: {
@@ -73,4 +73,4 @@ const consistentSchemaName = require_create_plugin_rule.createZodPluginRule({
73
73
  }
74
74
  });
75
75
  //#endregion
76
- exports.consistentSchemaName = consistentSchemaName;
76
+ exports.consistentSchemaVarName = consistentSchemaVarName;
@@ -1,10 +1,10 @@
1
1
  import { createZodPluginRule } from "../utils/create-plugin-rule.mjs";
2
2
  import { createZodSchemaImportTrack } from "../utils/track-zod-schema-imports.mjs";
3
3
  import { AST_NODE_TYPES } from "@typescript-eslint/utils";
4
- //#region src/rules/consistent-schema-name.ts
4
+ //#region src/rules/consistent-schema-var-name.ts
5
5
  const { zodImportAllowedSource, trackZodSchemaImports } = createZodSchemaImportTrack("all");
6
- const consistentSchemaName = createZodPluginRule({
7
- name: "consistent-schema-name",
6
+ const consistentSchemaVarName = createZodPluginRule({
7
+ name: "consistent-schema-var-name",
8
8
  meta: {
9
9
  type: "suggestion",
10
10
  docs: {
@@ -72,4 +72,4 @@ const consistentSchemaName = createZodPluginRule({
72
72
  }
73
73
  });
74
74
  //#endregion
75
- export { consistentSchemaName };
75
+ export { consistentSchemaVarName };
@@ -8,7 +8,7 @@ const requireSchemaSuffix = require_create_plugin_rule.createZodPluginRule({
8
8
  name: "require-schema-suffix",
9
9
  meta: {
10
10
  type: "suggestion",
11
- deprecated: { message: "Use `zod/consistent-schema-name`" },
11
+ deprecated: { message: "Use `zod/consistent-schema-var-name`" },
12
12
  docs: {
13
13
  zodImportAllowedSource,
14
14
  description: "Require schema suffix when declaring a Zod schema"
@@ -7,7 +7,7 @@ const requireSchemaSuffix = createZodPluginRule({
7
7
  name: "require-schema-suffix",
8
8
  meta: {
9
9
  type: "suggestion",
10
- deprecated: { message: "Use `zod/consistent-schema-name`" },
10
+ deprecated: { message: "Use `zod/consistent-schema-var-name`" },
11
11
  docs: {
12
12
  zodImportAllowedSource,
13
13
  description: "Require schema suffix when declaring a Zod schema"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-zod",
3
- "version": "3.10.0",
3
+ "version": "3.11.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": {