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

Allow as for no-dynamic-keys rule #602

Open
shaedrich opened this issue Jan 17, 2025 · 0 comments
Open

Allow as for no-dynamic-keys rule #602

shaedrich opened this issue Jan 17, 2025 · 0 comments

Comments

@shaedrich
Copy link

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

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