Open AlexRMU opened 2 weeks ago
Accordingly, if a string is passed to the class attribute instead of a variable, a const assertion
must be applied to it.
What? Can you elaborate a bit what you want to achieve with this (with an example maybe)
https://svelte.dev/repl/5dd04bf9ed6a4b0d96e54bb65d60c7b2?version=4.2.19
Now, if a variable or expression is present in a class attribute, then checking for unused classes is disabled. This can be fixed by using types.
Describe the problem
This is a issue of the distant future. If the type passed to the class value has a literal type, then it can be assumed that the user knows what he is doing and use this type to search for unused classes.
Describe the proposed solution
Here is an example for getting the final type of a class value:
CSSTypes Playground
https://github.com/ghoullier/awesome-template-literal-types
Importance
nice to have