no-deprecated-v-on-number-modifiers
Angular templatesHTMLVue / SvelteVue / Sveltecorrectnessno fixdefault: warnhtml/eslint-plugin-vue-recommended
What it does
Section titled “What it does”Reports a key code as a modifier of v-on (@keyup.13).
Why it matters
Section titled “Why it matters”Vue 3 removed key codes, so the listener never fires. The numbers are also deprecated in browsers.
To fix, write the key name (@keyup.enter).
Example
Section titled “Example”<template> <C :title.sync="t" @click.native="go" @keyup.13="k" inline-template v-is="c" />... <tr is="vue:row" v-model:title="t" @keyup.enter="k"></tr>...Configuration
Section titled “Configuration”angular: lint: rules: no-deprecated-v-on-number-modifiers: warn # off, warn (default), errorhtml: lint: rules: no-deprecated-v-on-number-modifiers: warn # off, warn (default), errorsvelte: lint: rules: no-deprecated-v-on-number-modifiers: warn # off, warn (default), errorvue: lint: rules: no-deprecated-v-on-number-modifiers: warn # off, warn (default), errorEnabled by the presets: html/eslint-plugin-vue-recommended.
Suppress one line with sudsy-disable-next-line no-deprecated-v-on-number-modifiers in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| eslint-plugin-vue | no-deprecated-v-on-number-modifiers |
full |