Skip to content
← Back to rules

vue/no-deprecated-vue-config-keycodes Correctness

What it does

Disallow using deprecated Vue.config.keyCodes (in Vue.js 3.0.0+).

Why is this bad?

Vue.config.keyCodes was removed in Vue 3. Code that relies on it will silently stop working when upgrading.

Examples

Examples of incorrect code for this rule:

js
Vue.config.keyCodes = { enter: 13 };

Examples of correct code for this rule:

js
Vue.config.silent = true;

How to use

To enable this rule using the config file or in the CLI, you can use:

json
{
  "plugins": ["vue"],
  "rules": {
    "vue/no-deprecated-vue-config-keycodes": "error"
  }
}
ts
import { defineConfig } from "oxlint";

export default defineConfig({
  plugins: ["vue"],
  rules: {
    "vue/no-deprecated-vue-config-keycodes": "error",
  },
});
bash
oxlint --deny vue/no-deprecated-vue-config-keycodes --vue-plugin

Version

This rule was added in v1.62.0.

References