Skip to content

noVueDeprecatedVOnNativeModifier (HTML)

Language HTML
biome.json
{
"linter": {
"rules": {
"nursery": {
"noVueDeprecatedVOnNativeModifier": "error"
}
}
}
}

Disallow the .native modifier on Vue’s v-on directive.

In Vue 2, the .native modifier made v-on listen to an event on the root element of a component, instead of an event sent by the component itself. Vue 3 removed this modifier. A listener for an event that the component does not declare in its emits option is now added to the component’s root element automatically, so the modifier is no longer needed.

<MyComponent v-on:click.native="onClick" />
code-block.vue:1:24 lint/nursery/noVueDeprecatedVOnNativeModifier ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ The .native modifier on v-on is deprecated.

> 1 │ <MyComponent v-on:click.native="onClick" />
│ ^^^^^^^
2 │

ℹ Vue 3 removed this modifier. Listeners for events that a component does not declare in its emits option are added to its root element automatically.

ℹ Remove the .native modifier.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

<MyComponent @click.native="onClick" />
code-block.vue:1:20 lint/nursery/noVueDeprecatedVOnNativeModifier ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

✖ The .native modifier on v-on is deprecated.

> 1 │ <MyComponent @click.native="onClick" />
│ ^^^^^^^
2 │

ℹ Vue 3 removed this modifier. Listeners for events that a component does not declare in its emits option are added to its root element automatically.

ℹ Remove the .native modifier.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

<MyComponent v-on:click="onClick" />
<MyComponent @click="onClick" />
<input @keyup.enter="submit" />