Closed
Description
Checklist
- I have tried restarting my IDE and the issue persists.
- I have read the FAQ and my problem is not listed.
Tell us about your environment
- ESLint version:
- eslint-plugin-vue version:
- Vue version:
- Node version:
- Operating System:
Please show your full configuration:
'vue/v-on-handler-style': ['error', 'inline-function'],
What did you do?
<PageNextButton v-if="isLastPageInPages && !isFetching && hasNextPage"
@click="async () => await fetchNextPage()" />
What did you expect to happen?
Not reporting.
What actually happened?
@click="async () => await fetchNextPage()" />
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Prefer inline function over inline handler in v-on. eslint(vue/v-on-handler-style)
there's an auto fix available, but it will just warping the async function into a regular function declaration and not executing it:
@click="() => async () => await fetchNextPage()" />
Only warping it with an IIFE is working proper:
@click="() => (async () => await fetchNextPage())()" />
Or just allow async event listener since it just works: vuejs/vue#10338 (comment)
Repository to reproduce this issue