Skip to content

noVueDeprecatedConfigKeyCodes (JavaScript)

Language JavaScript (and super languages)
biome.json
{
"linter": {
"rules": {
"nursery": {
"noVueDeprecatedConfigKeyCodes": "error"
}
}
}
}

Disallow the deprecated Vue.config.keyCodes option.

In Vue 2, Vue.config.keyCodes defined custom names for keyboard keys, so that templates could use modifiers such as @keyup.f1. Vue 3 removed this option, because it relies on the deprecated KeyboardEvent.keyCode browser property. Setting or reading it has no effect in Vue 3.

Use the key name in kebab-case as the modifier instead, such as @keyup.page-down for the PageDown key.

See the Vue 3 migration guide for more information.

Vue.config.keyCodes = {
f1: 112,
};
code-block.js:1:1 lint/nursery/noVueDeprecatedConfigKeyCodes ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ The Vue.config.keyCodes option is deprecated and has no effect in Vue 3.

> 1 │ Vue.config.keyCodes = {
│ ^^^^^^^^^^^^^^^^^^^
2 │ f1: 112,
3 │ };

ℹ Vue 3 no longer supports custom key names, because they rely on the deprecated KeyboardEvent.keyCode browser property.

ℹ Remove this option, and use the key name in kebab-case as the modifier instead, such as @keyup.page-down. See the Vue 3 migration guide for more information.

ℹ 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.

import Vue from "vue";
const keyCodes = Vue.config.keyCodes;
code-block.js:3:18 lint/nursery/noVueDeprecatedConfigKeyCodes ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ The Vue.config.keyCodes option is deprecated and has no effect in Vue 3.

1 │ import Vue from "vue";
2 │
> 3 │ const keyCodes = Vue.config.keyCodes;
│ ^^^^^^^^^^^^^^^^^^^
4 │

ℹ Vue 3 no longer supports custom key names, because they rely on the deprecated KeyboardEvent.keyCode browser property.

ℹ Remove this option, and use the key name in kebab-case as the modifier instead, such as @keyup.page-down. See the Vue 3 migration guide for more information.

ℹ 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.

Vue.config.silent = true;
config.keyCodes = {};