Open
Description
Please describe what the rule should do:
Disallow () => {}
as the default of props.
What category should the rule belong to?
[ ] Enforces code style (layout)
[x] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
defineProps({
foo: {
default: () => {},
},
});
probably mean to use the following, but forgot parentheses
defineProps({
foo: {
default: () => ({}),
},
});
Additional context
In most cases, it's just a mistake to return an empty object. If mean to default to undefined
,
defineProps({foo: {default: undefined}});
OR
defineProps({foo: {default: () => undefined}}); // Maybe also forbid this? The above should be preferred.
should be used.
Metadata
Metadata
Assignees
Labels
No labels