# @intlify/vue-i18n/key-format-style

enforce specific casing for localization keys

This rule aims to enforces specific casing for localization key names.

camelCaseKey: The key for this value is camel case.
kebab-case-key: The key for this value is kebab case.
snake_case_key: The key for this value is snake case.
mixed_Case-key: Perhaps you don't want to use this casing.

# 📖 Rule Details

This rule reports localization keys other than the specific casing. Also, the following localization key definitions are reported as errors, because the casing cannot determine.

👎 Examples of incorrect code for this rule:

Now loading...

# Options

{
  "@intlify/vue-i18n/key-format-style": [
    "error",
    "camelCase" | "kebab-case" | "snake_case",
    {
      "allowArray": false
    }
  ]
}
  • Primary Option: Select the casing you want to apply. It set to "camelCase" as default
  • allowArray: If true, allow the use of arrays. If false, disallow the use of arrays. It set to false as default.

👍 Examples of correct code for this rule with "camelCase":

Now loading...

👎 Examples of incorrect code for this rule with "camelCase":

Now loading...

👍 Examples of correct code for this rule with "kebab-case":

Now loading...

👎 Examples of incorrect code for this rule with "kebab-case":

Now loading...

👍 Examples of correct code for this rule with "snake_case":

Now loading...

👎 Examples of incorrect code for this rule with "snake_case":

Now loading...

👍 Examples of correct code for this rule with {"allowArray": true}:

Now loading...

# 🚀 Version

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

# 🔍 Implementation