eslint-plugin-vue-i18n icon indicating copy to clipboard operation
eslint-plugin-vue-i18n copied to clipboard

Forbid `$t` and friends in `data`

Open allanlewis opened this issue 3 years ago • 0 comments

Please describe what the rule should do:

Use of $t and friends in components' data sections should be forbidden because it results in non-dynamic translations.

What category should the rule belong to?

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

Provide 2-3 code examples that this rule should warn about:

data() {
  return {
    foo: this.$t('foo'),
  }
},

Additional context

allanlewis avatar Mar 07 '22 10:03 allanlewis