prettier
prettier copied to clipboard
[typescript]: Missing line break with long generic parameter
Prettier 2.6.2 Playground link
--parser typescript
--prose-wrap never
Input:
const hermesNotificationCancellationByUserTagSchema: ZodSchema<HermesNotificationCancellationByUserTag> =
z.object({
userTag: z.string(),
notificationType: z.nativeEnum(NotificationType).optional(),
})
const hermesNotificationCancellationByUserTagSchema: ZodSchema<
HermesNotificationCancellationByUserTag
> =
z.object({
userTag: z.string(),
notificationType: z.nativeEnum(NotificationType).optional(),
})
Output:
const hermesNotificationCancellationByUserTagSchema: ZodSchema<HermesNotificationCancellationByUserTag> =
z.object({
userTag: z.string(),
notificationType: z.nativeEnum(NotificationType).optional(),
});
const hermesNotificationCancellationByUserTagSchema: ZodSchema<HermesNotificationCancellationByUserTag> =
z.object({
userTag: z.string(),
notificationType: z.nativeEnum(NotificationType).optional(),
});
Expected behavior:
Im not sure if this is intentional, but I would expect both calls to end up as the second input (or a variation of it), and not as the first, as the first one violates the maximum line length.