-
-
Notifications
You must be signed in to change notification settings - Fork 273
Open
Labels
bug 🔥Something isn't workingSomething isn't workingfeature 🚀New feature or requestNew feature or request
Description
Description
Currently, if two generated components have the same identifier name, the second one will be suffixed with an auto-incremental integer started from 2. This is usually the desired behavior. However, it limits the use case where the identifier of a type and a value (e.g. const) can share the same name. For example,
const MyModel = z.object({id: z.string()})
type MyModel = z.infer<typeof MyModel>This is a valid TypeScript code but it's not achievable with existing Zod plugin since getUniqueComponentName is always called after the name is generated even when the name is specified as a getter function. To achieve the goal and make the API more flexible, we can add an option to skip getUniqueComponentName.
Metadata
Metadata
Assignees
Labels
bug 🔥Something isn't workingSomething isn't workingfeature 🚀New feature or requestNew feature or request