Skip to content

Allow as for no-dynamic-keys rule #602

Open
@shaedrich

Description

@shaedrich

What rule do you want to change?
@intlify/vue-i18n/no-dynamic-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.)?
new option (skipTSAsExpression)

Please provide some example code that this change will affect:

<template>
<span>{{ t(`binary-question.${isPositive.toString()}.title` as `binary-question.${'true' | 'false'}.title` }}</span>
</template>

<script lang="ts" setup>
let isPositive: bool = true;
</script>

What does the rule currently do for this code?
Disallow any dynamic translation key

What will the rule do after it's changed?
Only disallow dynamic translation keys when their type isn't narrowed down via template string literal type.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions