Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger an error when using a non-final key #568

Open
1 of 4 tasks
fbnlsr opened this issue Nov 5, 2024 · 0 comments
Open
1 of 4 tasks

Trigger an error when using a non-final key #568

fbnlsr opened this issue Nov 5, 2024 · 0 comments

Comments

@fbnlsr
Copy link

fbnlsr commented Nov 5, 2024

Please describe what the rule should do:

no-nonfinal-keys

The rule should trigger an error when the key used for translation is not final.

At the moment, if we ask for a translation on a key that is not final (meaning it contains child keys), no error is triggered. This is particularly problematic on large code bases where people might change the dictionary key layout.

What category should the rule belong to?

  • Enforces code style (layout)
  • Warns about a potential error (problem)
  • Suggests an alternate way of doing something (suggestion)
  • Other (please specify:)

Example:

<template>
  <button @click="submit">{{ t('app.save') }}
</template>
{
  "app": {
    "save": {
      "label": "Save"
    }
  }
}

eslint-plugin-vue-i18n should trigger an error as app.save is not a final key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant