-
Notifications
You must be signed in to change notification settings - Fork 198
Add detection for @bind decorators in react-this-binding #392
Comments
is this being considered? |
@cyberhck absolutely! Everything with the |
I would, but I don't even know how to go about this 😄 |
@cyberhck if you are still interested in implementation I can provide you with tips about possible implementation. Otherwise I can take on this issue if there are no more volunteers. |
Yes please, can you provide me some tips? Since this will be my first attempt, I don't know of helper methods, and I don't know how to detect if a function is bound or not. |
@cyberhck ok. Next - files related to rule: rule source and tests. In rule source code you'll need to add options parser inside Walker constructor (you can check other rules for example) and in Test are regular Mocha tests with helpers that allow to compare liter result with array of error objects. For your case you'll need to use |
I've enabled experimentalDecorators for test data. |
Great job @cyberhck! |
It's common practice to do something like the following:
Unfortunately the
react-this-binding-issue
rule isn't aware of this and gets tripped up.I propose adding an option like
{ "bindDecorators": ["bind"] }
which looks at decorator names and flags functions with those decorators as having been bound. It can have sensible defaults like["bind", "Bind"]
.The text was updated successfully, but these errors were encountered: