-
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
Error on references to literal enum members in conditions #58264
Conversation
@typescript-bot test it |
Hey @weswigham, the results of running the DT tests are ready. Everything looks the same! |
@weswigham Here are the results of running the user tests comparing Everything looks good! |
@weswigham Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@weswigham Here are the results of running the top 400 repos comparing Everything looks good! |
Is this a common mistake? I don't think I've ever done this. I think I'd rather this be a more general check of "you're testing the value of a (pseudo-)constant, did you mean to do that?" which feels way more useful than trying to detect that I wrote |
I think we basically already have that in some cases but not all, e.g. function foo() { }
if (foo) {
} where your program has no plausible way of varying on |
@typescript-bot pack this |
Hey @gabritto, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running |
@typescript-bot pack this |
Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
So when you write
we inform you in advance that you've failed to actually write
kind ===
.