Fix zod imports with ast-grep namespace import rule
Applied ast-grep rule to convert named zod imports to namespace imports across the api-contract package for consistency. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
11
.ast-grep/rules/zod-namespace-import.yml
Normal file
11
.ast-grep/rules/zod-namespace-import.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
id: zod-namespace-import
|
||||
language: typescript
|
||||
severity: error
|
||||
message: Use namespace import for zod - `import * as z from "zod"` instead of named import
|
||||
note: |
|
||||
Named imports from zod (e.g., `import { z } from "zod"`) should be replaced
|
||||
with namespace imports (`import * as z from "zod"`) for consistency and to
|
||||
ensure all zod utilities are available under the `z` namespace.
|
||||
rule:
|
||||
pattern: import { $$$IMPORTS } from "zod"
|
||||
fix: import * as z from "zod";
|
||||
Reference in New Issue
Block a user