Open
Description
Environment
- unplugin: 6.2.2
- typescript: 5.7.2
Reproduction
https://stackblitz.com/edit/vitejs-vite-lovdzaug?file=unplugin-foo.ts
Describe the bug
Definitions like:
type StringFilter = FilterPattern | {
include?: FilterPattern
exclude?: FilterPattern
};
... can cause friction when using the TypeScript exactOptionalPropertyTypes
compiler option, since under that configuration, undefined
is not a valid value to be passed into include
or exclude
. Would it break anything to widen the type to the following?:
type StringFilter = FilterPattern | {
include?: FilterPattern | undefined
exclude?: FilterPattern | undefined
};
Additional information
- Would you be willing to help implement a patch for this?