-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Feature suggestion: Report unused suppressions #22021
Labels
Declined
The issue was declined as something which matches the TypeScript vision
Comments
This is not the intended use of If this is a .d.ts file that you are testing, consider using https://github.com/Microsoft/dtslint, with |
mhegazy
added
the
Declined
The issue was declined as something which matches the TypeScript vision
label
Mar 10, 2018
I see. Thanks for pointing to the correct solution! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 variablederivative
is of typeany
, 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.Related issues: #19139, #21602
The text was updated successfully, but these errors were encountered: