ESLint plugin (v1.2.1) that enforces namespace imports for zod (`import * as z from "zod"`) to improve tree-shaking and reduce bundle sizes. Targets eslint >=9 and Node >=20, ships TypeScript types. Auto-fixable: converts default/named imports to namespace imports, splits mixed imports. Released as v1.0.0 in 2025, with active development (recent patches). Unique vs other import rules: specifically for zod ecosystem.
npm install eslint-plugin-import-zodVerified import paths — ran on the pinned version, not inferred.
Sets up the plugin with recommended config and enables the prefer-zod-namespace rule in ESLint flat config.
Use import syntax or configure ESLint as ESM.
Review auto-fix changes; namespace import may affect type inference.
Use namespace import directly.
Migrate to flat config or wrap plugin with compatibility layer.
npm install -D eslint-plugin-import-zod and ensure ESLint is running in ESM mode.
Change to dynamic import: const importZod = (await import('eslint-plugin-import-zod')).default;Use flat config and import the plugin directly, not via string name.