dummy-type-gen - GenT - GenType
You don't have to manually create dev data to fulfill type!
Now you can ask for it!
Contains 0% of AI! WOW.
Personally I rely on Copilot but it's not covering 100% of my needs.
This should help developers in typescript to generate dummy data.
Features
Keyboard shortcut
Ctrl + G G
Command Palette
Starting from GenType:
- GenType: Insert type name to generate data
Supported structures
Interface and Type for:
- primitive keywords
- string
- number
- boolean
- never
- undefined
- null
- false
- true
- unknown
- void
- LiteralType
- StringLiteral
- Number Literal
- UnionType
- Tuple
- ArrayType
- Identifier
- TypeReference (Array, Records and imports)
- TypeLiteral (objects)
- PropertySignature
- Parameter
in addition to this supports features like:
- resolves internal imports to n level deep
- recursion for types
Remember about
- External imports (for example types from react) will just resolve with the typename. It's not handling them:
import { FC } from 'react';
const Test: FC = "FC" // <-- Extension will generate.
Missing features
- [ ] support for HeritageClauses (interface extends)
- [ ] support for IntersectionType (Type = A & B)
- [ ] support for Parameters from FunctionType
- [ ] support for function types (optional)
Requirements
dummy-type-gen.projectPath must be set to absolute path to the project root directory
Extension Settings
dummy-type-gen.enable : Enable/disable this extension.
dummy-type-gen.projectPath : Path to the project root directory. Useful to keep it in .vscode/settings.json per workspace
Known Issues
Did not tested it with very nested types (more than 3x deep).
It's beta, be aware.
Release Notes
See CHANGELOG.md
| |