Skip to content

configurable i18n call expressions #643

@Tinoooo

Description

@Tinoooo

What rule do you want to change?
@intlify/vue-i18n/no-unused-keys

Does this change cause the rule to produce more or fewer warnings?
fewer

How will the change be implemented? (New option, new default behavior, etc.)?
The rule currently checks for a fixed set of call expressions. I propose to make additional expressions configurable.

Please provide some example code that this change will affect:

<script setup>
const { t } = useI18n()
const { t: tg } = useI18n({ useScope: 'global' })
</script>

<template>
component specific i18n message: {{ t('verySpecific') }} <br>
exists in global i18n message file: {{ tg('cancel') }}
</template>

<i18n lang="json" locale="en">
{
  "verySpecific": "Hey! I'm component specific."
}
</i18n>

What does the rule currently do for this code?
If does falsly reports about the "cancel" message in the global i18n file (en.json) being unused.

What will the rule do after it's changed?
It will not report incorrectly.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions