Closed
Description
Please describe what the rule should do:
Enforce detailed emits
option with types.
What category should the rule belong to?
[ ] Enforces code style (layout)
[ ] Warns about a potential error (problem)
[x] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
// bad
export default defineComponent({
emits: ['update'],
})
// good
export default defineComponent({
emits: {
update: (payload: Payload) => typeof payload === 'object',
},
})
Additional context
- Declaring types of
emits
can provide better TypeScript inference. - This rule is similar to require-prop-types.