Skip to content

v-on-style

Reports v-on: where the shorthand @ would do (v-on:click). The fix writes @.

One form keeps the templates uniform and shorter.

To fix, write @; the fix does it.

Reported
<template>
<MyCard v-bind:title="t" v-on:click="go" :cardTitle="c" cardSub="s" my-prop="p"
:ok="1"
...
After the fix
<template>
<MyCard :title="t" @click="go" :cardTitle="c" cardSub="s" my-prop="p"
:ok="1"
...
angular:
lint:
rules:
v-on-style: warn # off, warn (default), error
html:
lint:
rules:
v-on-style: warn # off, warn (default), error
svelte:
lint:
rules:
v-on-style: warn # off, warn (default), error
vue:
lint:
rules:
v-on-style: warn # off, warn (default), error

Enabled by the presets: html/eslint-plugin-vue-recommended.

Suppress one line with sudsy-disable-next-line v-on-style in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
eslint-plugin-vue v-on-style full