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

fix(require-explicit-emits): Add support for kebab-cased custom events #2248

Conversation

Robo-Rin
Copy link

@Robo-Rin Robo-Rin commented Jul 24, 2023

The existing vue/require-explicit-emits rule does not support the scenario where a custom event is emitted in kebab-case. This usage was recommended as a workaround by core Vue members here: vuejs/core#5220 (comment) .

Before this PR with allowProps: true, this works but is ugly and violates vue/prop-name-casing:

props: ['onCustom-event'],
// ...
this.$emit('custom-event')

After this PR you will be able to do:

props: ['onCustomEvent'],
// ...
this.$emit('custom-event')

@Robo-Rin
Copy link
Author

Robo-Rin commented Jul 25, 2023

Looks like what I thought was working was a false positive. Currently having issues with the recommended strategy from the github issue I linked. Closing for now but will reopen if I can get it working.

@Robo-Rin Robo-Rin closed this Jul 25, 2023
@Robo-Rin Robo-Rin deleted the fix/require-explicit-emits__support-kebab-case-custom-events branch December 27, 2023 19:29
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

Successfully merging this pull request may close these issues.

1 participant