Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I generally put lint rules to prevent casting, why cast here instead of declaring `props: (keyof SomeObj)[]` or `props: Parameters<typeof someFn>[0]`?


Er, my justification was that the code in question was meant to be minimally demonstrating someFn, and adding an import or a verbose type seemed to distract from that a little.

But mostly it just gave me a chuckle. I tried it because it seemed logical, but I didn't really think it was going to work until it did..




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: