Skip to content

Add allowProps option to vue/require-explicit-emits rule. #1259

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

Merged
merged 1 commit into from
Jul 31, 2020

Conversation

ota-meshi
Copy link
Member

Even if you declare it in props, a warning message and fallthrough can be stopped, so I add an option to allow this.
https://github.com/vuejs/vue-next/blob/00ab9e2e8506d108958895cda4e977dfb16b53f9/packages/runtime-core/src/componentEmits.ts#L50

By default this option remains disabled.

Even if you declare it in props, a warning message and fallthrough can be stopped, so I add an option to allow this.
https://github.com/vuejs/vue-next/blob/00ab9e2e8506d108958895cda4e977dfb16b53f9/packages/runtime-core/src/componentEmits.ts#L50

By default this option remains disabled.
@ota-meshi ota-meshi self-assigned this Jul 21, 2020
@ota-meshi ota-meshi merged commit 872c0b8 into master Jul 31, 2020
@ota-meshi ota-meshi deleted the ignore-prop-require-explicit-emits branch July 31, 2020 11:04
@Robo-Rin
Copy link

Robo-Rin commented Jul 24, 2023

@ota-meshi This doesn't seem to account for custom events in kebab-case declared as a prop, do you think we should add this to support the workaround mentioned here:
vuejs/core#5220 (comment)

For example currently this does work but is ugly and violates vue/prop-name-casing:

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

So it would be great if we can do:

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

Robo-Rin added a commit to Robo-Rin/eslint-plugin-vue that referenced this pull request Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants