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

Add ignores option to no-dynamic-keys #527

Open
MikeBellika opened this issue Jun 10, 2024 · 0 comments
Open

Add ignores option to no-dynamic-keys #527

MikeBellika opened this issue Jun 10, 2024 · 0 comments

Comments

@MikeBellika
Copy link

What rule do you want to change?
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. I'm imaging something similar as the ignores option for no-unused-keys.
Users would be able to put all their dynamic keys in one place and not get errors.

Please provide some example code that this change will affect:

<span>{{$t(`dynamic.${someVariable}.headline`)}}</span>

What does the rule currently do for this code?
Give an error/warning

What will the rule do after it's changed?
Allow the user to set a pattern to ignore dynamic keys with a certain pattern.

Additional context
The way we would use it in our project would be to use the same pattern for no-unused-keys and no-dynamic-keys. We currently get some keys from the API that we use to lookup in the locale files. Changing the API would be difficult and making the keys not dynamic would result in a lot of unneeded boilerplate.

I am willing to work on this, if a PR is welcome.

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