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
Incorrect types for chalk in tagged template literal form #314
Comments
Yeah agreed, this is wrong. Can someone from the typescript community submit a fix? I don't know enough of it. |
I am happy to submit a PR if someone can define the type that it should be. A quick fix would be to change it to |
You can interpolate any type. We don't enforce anything. |
The typing enforces that the values you interpolate are strings. Unless I am mistaken this line defines the tagged template literal. ie:
Would be |
And what I'm saying is we don't care what the placeholder types are, much less that they are strings... |
Shall I submit a fix then with type |
Sure, but I'd like to get a confirmation that |
Yes, it should be |
Ohh, sorry, reference from 317 is invalid (should be to 318 not to this 314). Fixed, but reference will stay :-\ |
I am using chalk to do some logging and I noticed this issue.
In this case I am giving chalk two numbers instead of strings.
Typescript complains about this because chalk's tagged template literal form is defined as
In my case placeholders contains numbers.
Now I could fix this by doing
but that feels wrong.
Ideally it would be some type union of things easily parsed to string (||etc etc)
The text was updated successfully, but these errors were encountered: