Skip to content

@intlify/vue-i18n/prefer-linked-key-with-paren

enforce linked key to be enclosed in parentheses

  • ✒️️ The --fix option on the command line can automatically fix some of the problems reported by this rule.

This rule enforces the linked message key to be enclosed in parentheses.

📖 Rule Details

👎 Examples of incorrect code for this rule:

locale messages:

json
/* eslint @intlify/vue-i18n/prefer-linked-key-with-paren: 'error' */
{
  /* ✗ BAD */
  "hello": "Hello @:world",
  "world": "world"
}

👍 Examples of correct code for this rule:

locale messages (for vue-i18n v9+):

json
/* eslint @intlify/vue-i18n/prefer-linked-key-with-paren: 'error' */
{
  /* ✓ GOOD */
  "hello": "Hello @:{'world'}",
  "world": "world"
}

locale messages (for vue-i18n v8):

json
/* eslint @intlify/vue-i18n/prefer-linked-key-with-paren: 'error' */
{
  /* ✓ GOOD */
  "hello": "Hello @:(world)",
  "world": "world"
}

🚀 Version

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

🔍 Implementation