Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Zod Type Infer-erNew to Visual Studio Code? Get it now.
Zod Type Infer-er

Zod Type Infer-er

collin

| (0) | Free
Quickly infer the types of zod schemas via Quick Fix
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

💡 Zod Type Infer-er

A VSCode extension that automatically generates TypeScript types using z.infer from your Zod schema definitions — right from a lightbulb Quick Fix 💡.


✨ Features

  • 🔍 Detects z.object({ ... }) schema definitions
  • 🧠 Suggests and inserts:
    export type MyType = z.infer<typeof mySchema>;
    
  • 🛠 Offers two options:

    • export type
    • non-exported type
  • 🔄 Updates existing type aliases if they already exist


⚡ Example

When you write:

const recordSaleRequestSchema = z.object({
  barcode: z.string(),
});

Hover over the line or click the 💡 lightbulb — and choose:

💡 Generate exported type: RecordSaleRequest
💡 Generate internal type: RecordSaleRequest

The extension will insert (or update):

export type RecordSaleRequest = z.infer<typeof recordSaleRequestSchema>;

📦 Installation

Coming soon to the VSCode Marketplace

For now, you can clone and run locally:

git clone https://github.com/your-username/zod-type-inferer
cd zod-type-inferer
npm install
npm run build
code .

Then press F5 to launch the extension development window.


🧰 Development

This extension is built with:

  • TypeScript
  • esbuild
  • VSCode Extension API

🚀 Roadmap

  • [ ] Support for z.union, z.enum, z.discriminatedUnion
  • [ ] Support for superRefine/refine comments
  • [ ] Configurable type naming and placement
  • [ ] Auto-infer all types in a file

🛡 License

MIT


Made by Collin Napier

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft