# @intlify/vue-i18n/no-unused-keys

disallow unused localization keys

Localization keys that not used anywhere in the code are most likely an error due to incomplete refactoring. Such localization keys take up code size and can lead to confusion by readers.

# 📖 Rule Details

This rule is aimed at eliminating unused localization keys.

👎 Examples of incorrect code for this rule:

locale messages:

Now loading...

In localization codes of application:

Now loading...
Now loading...

For SFC.

Now loading...

👍 Examples of correct code for this rule:

locale messages:

Now loading...

In localization codes of application:

Now loading...
Now loading...

# ⚙️ Options

{
  "@intlify/vue-i18n/no-unused-keys": [
    "error",
    {
      "src": "./src",
      "extensions": [".js", ".vue"],
      "enableFix": false
    }
  ]
}
  • src: specify the source codes directory to be able to lint. If you don't set any options, it set to process.cwd() as default.
  • extensions: an array to allow specified lintable target file extension. If you don't set any options, it set to .js and .vue as default.
  • enableFix: if true, enable automatically remove unused keys on eslint --fix. If you don't set any options, it set to false as default. (This is an experimental feature.)

# 🚀 Version

This rule was introduced in @intlify/eslint-plugin-vue-i18n v0.1.0

# 🔍 Implementation