eslint-plugin-zod-mini 1.9.0 → 1.9.1

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.
@@ -1,6 +1,5 @@
1
1
  const require_create_plugin_rule = require("../utils/create-plugin-rule.cjs");
2
2
  let _eslint_zod_utils = require("@eslint-zod/utils");
3
- let _typescript_eslint_utils = require("@typescript-eslint/utils");
4
3
  let _eslint_zod_utils_rule_builders_no_transform_in_record_key = require("@eslint-zod/utils/rule-builders/no-transform-in-record-key");
5
4
  //#region src/rules/no-transform-in-record-key.ts
6
5
  const noTransformInRecordKey = require_create_plugin_rule.createZodMiniPluginRule({
@@ -12,18 +11,7 @@ const noTransformInRecordKey = require_create_plugin_rule.createZodMiniPluginRul
12
11
  schema: []
13
12
  },
14
13
  defaultOptions: [],
15
- create: (0, _eslint_zod_utils_rule_builders_no_transform_in_record_key.buildNoTransformInRecordKeyCreate)(_eslint_zod_utils.zodMiniImportScope, { findTransformNode(keySchema, { detectZodSchemaRootNode, collectZodChainMethods }) {
16
- if (keySchema.type !== _typescript_eslint_utils.AST_NODE_TYPES.CallExpression) return null;
17
- for (const method of collectZodChainMethods(keySchema)) {
18
- if (method.name !== "check") continue;
19
- for (const argument of method.node.arguments) {
20
- if (argument.type !== _typescript_eslint_utils.AST_NODE_TYPES.CallExpression) continue;
21
- const zodCheck = detectZodSchemaRootNode(argument);
22
- if (zodCheck && _eslint_zod_utils.ZOD_MUTATING_CHECK_NAMES.includes(zodCheck.schemaType)) return argument;
23
- }
24
- }
25
- return null;
26
- } })
14
+ create: (0, _eslint_zod_utils_rule_builders_no_transform_in_record_key.buildNoTransformInRecordKeyCreate)(_eslint_zod_utils.zodMiniImportScope, _eslint_zod_utils.ZOD_MUTATING_CHECK_NAMES)
27
15
  });
28
16
  //#endregion
29
17
  exports.noTransformInRecordKey = noTransformInRecordKey;
@@ -1,6 +1,5 @@
1
1
  import { createZodMiniPluginRule } from "../utils/create-plugin-rule.mjs";
2
2
  import { ZOD_MUTATING_CHECK_NAMES, zodMiniImportScope } from "@eslint-zod/utils";
3
- import { AST_NODE_TYPES } from "@typescript-eslint/utils";
4
3
  import { buildNoTransformInRecordKeyCreate } from "@eslint-zod/utils/rule-builders/no-transform-in-record-key";
5
4
  //#region src/rules/no-transform-in-record-key.ts
6
5
  const noTransformInRecordKey = createZodMiniPluginRule({
@@ -12,18 +11,7 @@ const noTransformInRecordKey = createZodMiniPluginRule({
12
11
  schema: []
13
12
  },
14
13
  defaultOptions: [],
15
- create: buildNoTransformInRecordKeyCreate(zodMiniImportScope, { findTransformNode(keySchema, { detectZodSchemaRootNode, collectZodChainMethods }) {
16
- if (keySchema.type !== AST_NODE_TYPES.CallExpression) return null;
17
- for (const method of collectZodChainMethods(keySchema)) {
18
- if (method.name !== "check") continue;
19
- for (const argument of method.node.arguments) {
20
- if (argument.type !== AST_NODE_TYPES.CallExpression) continue;
21
- const zodCheck = detectZodSchemaRootNode(argument);
22
- if (zodCheck && ZOD_MUTATING_CHECK_NAMES.includes(zodCheck.schemaType)) return argument;
23
- }
24
- }
25
- return null;
26
- } })
14
+ create: buildNoTransformInRecordKeyCreate(zodMiniImportScope, ZOD_MUTATING_CHECK_NAMES)
27
15
  });
28
16
  //#endregion
29
17
  export { noTransformInRecordKey };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-zod-mini",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "ESLint plugin that adds custom linting rules to enforce best practices when using Zod Mini",
5
5
  "keywords": [
6
6
  "eslint",
@@ -39,9 +39,10 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@typescript-eslint/utils": "^8.67.0",
42
- "@eslint-zod/utils": "3.3.0"
42
+ "@eslint-zod/utils": "4.0.0"
43
43
  },
44
44
  "devDependencies": {
45
+ "@arethetypeswrong/cli": "0.18.5",
45
46
  "@typescript-eslint/rule-tester": "8.67.0",
46
47
  "dedent": "1.7.2",
47
48
  "eslint-doc-generator": "3.7.0",
@@ -70,6 +71,7 @@
70
71
  },
71
72
  "scripts": {
72
73
  "build": "tsdown",
74
+ "lint:publish": "attw --pack .",
73
75
  "build:docs": "pnpm run build && eslint-doc-generator",
74
76
  "lint:docs": "eslint-doc-generator --check",
75
77
  "test": "vitest"