You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ESLint plugin to enforce namespace imports for zod. This plugin provides a rule that ensures all imports of zod use the namespace import style (`import * as z from "zod";`) instead of named imports to promote better tree-shaking and reduce bundle sizes. See [this Zod issue comment](https://github.com/colinhacks/zod/issues/4433#issuecomment-2921500831) for a more detailed explanation.
6
+
ESLint plugin to enforce namespace imports for zod. This plugin provides a rule that ensures all imports of zod use the namespace import style (`import * as z from "zod";`) instead of named imports or default imports to promote better tree-shaking and reduce bundle sizes. See [this Zod issue comment](https://github.com/colinhacks/zod/issues/4433#issuecomment-2921500831) for a more detailed explanation.
Copy file name to clipboardExpand all lines: docs/rules/prefer-zod-namespace.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Enforce namespace imports for zod (prefer-zod-namespace)
2
2
3
-
This rule enforces using namespace imports for zod instead of named imports. Using namespace imports results in better tree-shaking and reduced bundle sizes.
3
+
This rule enforces using namespace imports for zod instead of named imports or default imports. Using namespace imports results in better tree-shaking and reduced bundle sizes. All default imports from 'zod' are converted to namespace imports regardless of the import name.
4
4
5
5
## Rule Details
6
6
@@ -12,6 +12,19 @@ This rule aims to enforce a consistent pattern for importing zod.
0 commit comments