noVueDeprecatedConfigKeyCodes (JavaScript)
Language JavaScript (and super languages)
Summary
Section titled “Summary”- Rule available since:
v2.6.5 - Diagnostic Category:
lint/nursery/noVueDeprecatedConfigKeyCodes - This rule doesn’t have a fix.
- The default severity of this rule is information.
- This rule belongs to the following domains:
- Sources:
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noVueDeprecatedConfigKeyCodes": "error" } } }}Description
Section titled “Description”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.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”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 = {};Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.