Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

New rule: no bind calls #77

Closed
danielmanesku opened this issue Nov 2, 2015 · 3 comments
Closed

New rule: no bind calls #77

danielmanesku opened this issue Nov 2, 2015 · 3 comments
Labels
External Issues that should be addressed in other repositories.
Milestone

Comments

@danielmanesku
Copy link
Contributor

Calling bind() or _.bind() is not type safe. It should be discouraged.
Instead, lambda expression should be used.

We should either update "no-unnecessary-bind" or create a entirely new rule.

@ChrisMBarr
Copy link
Contributor

It's possible to ban the underscore calls

"ban": [
    true,
    [ "_", "bind" ]
]

And there is an issue submitted to the main TSLint project to allow banning native function calls palantir/tslint#733, although there has really been no progress on it fromw what I can tell.

@danielmanesku
Copy link
Contributor Author

@ChrisMBarr thank you for this info!

@JoshuaKGoldberg
Copy link

TSLint's ban rule can do this now! 🚀

palantir/tslint#2547

@JoshuaKGoldberg JoshuaKGoldberg added the External Issues that should be addressed in other repositories. label Jul 6, 2018
@JoshuaKGoldberg JoshuaKGoldberg modified the milestones: 5.0.4, 5.1.0 Jul 18, 2018
@JoshuaKGoldberg JoshuaKGoldberg added this to the None milestone Aug 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
External Issues that should be addressed in other repositories.
Projects
None yet
Development

No branches or pull requests

4 participants