eslint-plugin-vue icon indicating copy to clipboard operation
eslint-plugin-vue copied to clipboard

Typed defineExpose with generic value

Open tragid opened this issue 2 years ago • 0 comments

Please describe what the rule should do: defineExpose in script should include generic for types.

What category should the rule belong to? [X ] Enforces code style (layout) [ ] 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:

defineExpose({ doSmth }); // Error

defineExpose<{ doSmth: () => void; }>({ doSmth }); // OK

Additional context This rule will help to find out potential errors on component refactoring.

tragid avatar Sep 12 '23 09:09 tragid