💡 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
⚡ 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:
🚀 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