Description
When using advanced types such as conditional types, I usually write a bunch of type tests to check for which conditions the annotations are supposed to pass/fail. Example:
As you see, every first statement checks for a condition that's supposed to pass, while every second statement checks for a condition that's correctly supposed to fail.
I'd ideally annotate those second statements with // @ts-ignore
, except that if the expected type error doesn't happen, I wouldn't know about it. For example if the variable derivative
is of type any
, then the type annotations would obviously be wrong, but no errors would be shown.
I propose a compiler flag like warnUnusedSuppressions: boolean
that would produce a lint error if a line is annotated with // @ts-ignore
but doesn't contain type errors.