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

v-on-function-call with dots in name #1085

Closed
rightaway opened this issue Mar 27, 2020 · 2 comments · Fixed by #1146
Closed

v-on-function-call with dots in name #1085

rightaway opened this issue Mar 27, 2020 · 2 comments · Fixed by #1146
Labels

Comments

@rightaway
Copy link

Tell us about your environment

  • ESLint version: 6.8.0
  • eslint-plugin-vue version: 6.2.2
  • Node version: 13.9.0

Please show your full configuration:

"vue/v-on-function-call": ["error", "never"]

What did you do?

<MyComponent @myevent="$refs.myref.mymethod()"/>

What did you expect to happen?
Should be no error because you're not allowed to call it without () when calling it this way. Even with never as the argument you must include a dot. The only time you're allowed to skip the dot is when calling a function like @myevent="mymethod", like when it's in the methods of your Vue component.

What actually happened?

Method calls without arguments inside of 'v-on' directives must not have parentheses.eslint(vue/v-on-function-call)

@ota-meshi ota-meshi added the bug label Mar 31, 2020
@ota-meshi
Copy link
Member

Thanks for this problem.

I think it's a bug.

@rightaway
Copy link
Author

Are there any cases where it is valid in Vue to have dots in the name but not have (), like if calling a method on $parent? These cases could be documented in this rule so that people know to add an eslint-disable for those cases when using this rule.

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