ecosystem/vue-i18n-no-missing-key
Report static vue-i18n keys that are absent from local SFC messages.
| Default severity | Presets | Automatic fix | Options |
|---|---|---|---|
warning |
ecosystem |
No | None |
Applies to: Vue SFC templates and blocks, with script context where the rule requires it.
Bad
The template requests auth.missing, but the local English messages declare only auth.login.
<template>{{ $t("auth.missing") }}</template>
<i18n lang="json">
{ "en": { "auth": { "login": "Log in" } } }
</i18n>
Good
The template requests the auth.login key that exists in the local messages.
<template>{{ $t("auth.login") }}</template>
<i18n lang="json">
{ "en": { "auth": { "login": "Log in" } } }
</i18n>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"ecosystem/vue-i18n-no-missing-key": "warn"
}
},
});
Then run vp run lint.