-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Allow Duck-typing checks for conditional API compat logic #26
Comments
Wouldn't |
In other words, duck-typing should only be allowed when chained off of a definitely-present object. |
Oh yea, that's right. I've updated the rfc the initial comment to reflect this. Thanks for letting me know about this! |
what would happen in this case: if (String.prototype.includes) {
if ('some'.includes('e')) {
// do some action
}
} In this case, you've validated that the function exists before using it. |
@deecewan Sorry for the late response. Somehow I missed the notification for this. That should be allowed. I just added this example to my initial comment |
@amilajack Say, we're very interested in this feature at my company. Have you made any headway? If you need help, me and some of my colleagues would be happy to roll up our sleeves! |
Hi @amilajack, I am also interested in this feature, has any progress been made since? Would you like any contribution? Cheers |
@SalimBensiali I always love contributions. Unfortunately I don't have enough time to contribute to this project. Would really love if anyone could work on this! |
No worries @amilajack , is there an initial branch, POC? Is this issue here the one source of truth? Happy to look at this. Cheers. |
Nope, nothing yet |
UPDATE: Here's a related discussion in the eslint-typescript repo that's worth looking into
Allow checking for if lib or property is defined. Disallow calling the method
The text was updated successfully, but these errors were encountered: