duplicate-export false positive for type/value merging
#81
-
|
When using Zod (or similar libraries), it's idiomatic TypeScript to export both a runtime validator and its inferred type under the same name: export const Status = z.enum(['active', 'inactive'])
export type Status = z.infer<typeof Status>TypeScript allows this because Fallow currently flags this as Expected behavior: fallow should recognise that a Current workaround: Is this something fallow could detect and allow? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Good catch! This is fixed in 6f461b6 (will ship in the next release). The duplicate-export detection now tracks whether each export is type-only. Groups that mix value and type exports (like Same-namespace duplicates (two value exports or two type exports with the same name across files) are still correctly flagged. |
Beta Was this translation helpful? Give feedback.
Good catch! This is fixed in 6f461b6 (will ship in the next release).
The duplicate-export detection now tracks whether each export is type-only. Groups that mix value and type exports (like
export const Status+export type Status) are recognized as TypeScript declaration merging and skipped. This covers Zod, Prisma, class+interface patterns, and any other value/type namespace split.Same-namespace duplicates (two value exports or two type exports with the same name across files) are still correctly flagged.