Ignore self binding in `prefer-prototype-methods`
See original GitHub issuethis.foo.bind(this)
and foo.bar.bind(foo)
is very common.
Even though ClassName.prototype.method.bind(this)
make more sense, many people still prefer the old way as they are shorter and not really “borrowing” method, should we ignore it or check under an option?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Function.prototype.bind() - JavaScript - MDN Web Docs - Mozilla
The bind() method creates a new function that, when called, has its this keyword set to the provided value, with a given sequence...
Read more >Getting Out of Binding Situations in JavaScript - A List Apart
Binding -sensitive code patterns involve passing method references, which usually happens through two possible means: either you're assigning a method as a value ......
Read more >What is the use of the JavaScript 'bind' method? - Stack Overflow
The bind function can take any number of arguments and return a new function. The new function will call the original function using...
Read more >YDKJS: this & Object Prototypes, this call site, implicit, explicit ...
The primary reason for this behavior is to create a function (that can be used with new for constructing objects) that essentially ignores...
Read more >The 10 Most Common JavaScript Issues Developers Face
If you need help figuring out why your JavaScript isn't working, consult this list of the 10 most common JavaScript issues from a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Agreed. We can add an option if someone asks.
Was actually going to open an issue and then saw this. I’m also disabling this rule. At the very least, an option for self binding would be nice