JSDoc - Functions Taking Never
I'm using JS + JSDoc +
@ts-check
in a project, and I'm running into the following somewhat odd issue. It appears that when using JSDoc, TypeScript fails to recognize that an argument of type never
should not be passed at the call site. Here's the minimum code needed to recreate this issue:
Of course, in the actual codebase I'm dealing with, the never
comes from a conditional type, but it's the same issue.
Basically, my question is: What is going wrong here? Am I messing something up? Is this a bug in TypeScript? Is there anything I can do right now to fix this?
Any help would be appreciated. Proof (screenshot of the diagnostic) is attached.![](https://cdn.answeroverflow.com/1138585839958491247/image.png)
2 Replies