Vize

ecosystem/vue-i18n-no-missing-key

Report static vue-i18n keys that are absent from local SFC messages

Bad · Good

Default severity: warning
Presets: ecosystem
Automatic fix: None; review the suggested change
Applies to: Vue SFC templates and blocks, with script context where the rule requires it
Options: No rule-specific options. Severity and preset selection are configurable.

Configuration (Vite+)

import { defineConfig } from "@vizejs/vite-plugin/vite-plus";

export default defineConfig({
  lint: {
    vize: {
      "preset": "incremental",
      "rules": {
        "ecosystem/vue-i18n-no-missing-key": "warn"
      }
    },
  },
});
vp run lint

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>

Good avoids this rule's finding under the configuration above; other rules may still report diagnostics.

Implementation · All rules