twin.examples
twin.examples copied to clipboard
[next-styled-components] Type parameter ("T") defined but never used
Hi there, I'm using Twin version 2.6.2 and following the next-styled-components example with TypeScript.
And my twin.d.ts
file is warning me about a type parameter ("T") defined but never used.
I'm learning TypeScript now, the project where I'm installing it's part of a course.
Is this something I should care about?
Cheers for letting me know, I'll take a look into this 👍
Sorry to ping such an old issue - just curious if you ever found out what to do with the unused generic. Thanks - and thanks for such an amazing library!
Hey, I didn't get to the bottom of this one - but I'm keen on any help and insight.
@ben-rogerson I'll try to poke around. It's def a non-issue issue heheh.
A common practice is to prefix unused variables with an underscore, or to simply use _
as the variable name - in fact, this is built directly into some languages like Go. So one option here could be to replace T
with _
, and you'll probably have to configure eslint to ignore variables with this pattern (e.g., "@typescript-eslint/no-unused-vars": [1, { "varsIgnorePattern": "^_" }]
or ^_$
if you only want to ignore specifically _
. Of course, whether or not this is a good pattern is entirely personal :p