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

Change default name case for event names to match documentation #1759

Closed
posva opened this issue Jan 16, 2022 · 2 comments · Fixed by #1846
Closed

Change default name case for event names to match documentation #1759

posva opened this issue Jan 16, 2022 · 2 comments · Fixed by #1846

Comments

@posva
Copy link
Member

posva commented Jan 16, 2022

What rule do you want to change?

https://eslint.vuejs.org/rules/custom-event-name-casing.html#camelcase

Does this change cause the rule to produce more or fewer warnings?

Same

How will the change be implemented? (New option, new default behavior, etc.)?

Default change

Please provide some example code that this change will affect:

      this.$emit('my-event')
      this.$emit('update:myProp', myProp)

      this.$emit('myEvent')

What does the rule currently do for this code?

Allows the 2 first lines, fails on the last.

What will the rule do after it's changed?

It would do the opposite.

It should inverse the default and enforce camel-cased event names when calling emit() like proposed in docs

Additional context

@ota-meshi
Copy link
Member

Thank you for posting this issue.
I didn't know the documentation was updated. I think we need to change the default option for the rule in the next major version.

@FloEdelmann
Copy link
Member

For reference, the relevant section in the docs: https://vuejs.org/guide/components/events.html#emitting-and-listening-to-events

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants