Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type interface improvement #553

Closed
Mister-Hope opened this issue Oct 8, 2020 · 0 comments
Closed

Type interface improvement #553

Mister-Hope opened this issue Oct 8, 2020 · 0 comments

Comments

@Mister-Hope
Copy link
Contributor

Mister-Hope commented Oct 8, 2020

https://v3.vuejs.org/guide/component-custom-events.html#defining-custom-events

https://eslint.vuejs.org/rules/require-explicit-emits.html

TIP

It is recommended to define all emitted events in order to better document how a component should work.

Though it has no effects on Vue2, but we can still add emits: string[] | Record<string, null | ((emitData: any) => boolean) > in defineComponent for better documenting and to avoid eslint-plugin-vue@V7 throwing warnings.

Also, we have to warn people in readme that this has no effects and just for smoothing the miragation.


Adding emits options will broke ThisType in defineComponent now.

image

image

while eslint will throw warnings if using vue/require-explicit-emits

image

@antfu antfu closed this as completed in e44311f Oct 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant