You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)?
When concatenating a string with a const, typescript knows the possible strings which this expression can result in. For this reason, this rule could be extended to allow dynamic keys, when they result in a fixed list of strings. Those strings would then have to be taken into consideration for other rules as well (e.g. no-missing-keys-in-other-locales).
Please provide some example code that this change will affect:
Might be problematic that even typescript itself doesn't resolve string-manipulation...
constsearchFilter=ref<|"All"|"Speeches"|"Music">("All");// The type of this variable is `string`, even though it could be determined as `test-All`, `test-Speeches` or `test-Music`...constsearchFilter2=`test-${searchFilter}`
The text was updated successfully, but these errors were encountered:
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.)?
When concatenating a string with a const, typescript knows the possible strings which this expression can result in. For this reason, this rule could be extended to allow dynamic keys, when they result in a fixed list of strings. Those strings would then have to be taken into consideration for other rules as well (e.g.
no-missing-keys-in-other-locales
).Please provide some example code that this change will affect:
What does the rule currently do for this code?
It reports the code.
What will the rule do after it's changed?
It won't report the code.
Additional context
Might be problematic that even typescript itself doesn't resolve string-manipulation...
The text was updated successfully, but these errors were encountered: