vue/require-default-prop
gives false positive for optional Function props
#2376
Labels
vue/require-default-prop
gives false positive for optional Function props
#2376
Checklist
Tell us about your environment
Please show your full configuration:
What did you do?
-- MyComponent.vue export type ToggleCallback = (target: Item) => void const props = withDefaults( defineProps<{ item: Item onToggle?: ToggleCallback }>(), { onToggle: (_: Item) => {}, } )
What did you expect to happen?
I've provided a default for this Function-typed property, so I don't expect an error. I also wouldn't expect an error if I set the default to
undefined
ornull
.What actually happened?
Repository to reproduce this issue
No time right now to reproduce. Might be easier if I write a test for your test package, but not sure if you accept PRs for that?
The text was updated successfully, but these errors were encountered: