This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
react-bind-this-issue doesn't detect bind decorators defined after usage #813
Labels
Difficulty: Easy
Someone with little to no experience in TSLint should be able to send a pull request for this issue.
Status: Accepting PRs
Type: Bug
Milestone
Bug Report
tslint-microsoft-contrib
version: latestIn PR #534 , I introduced a feature, but it contains a missing feature A.K.A 🐛
It does half the work, it only detects bound methods above usage, and not the ones below usages.
TypeScript code being linted
with
tslint.json
configuration:Actual behavior
Shouldn't report violation
Expected behavior
Reports violation
However the same code works if I do something like this:
Difference is that the method went up.
And I know what happened.
On the source code for
react-this-binding-issue
we're looking for method definitions, and JSX tags, and when we see methods, we push it to array if it's bound, but that method isn't encountered yet, it isn't listed in the bound methods, hence it'll report violation.I don't know how I missed this when I created this PR and looks like no one has noticed till now 😄
Any suggestions are welcome, if I find some free time, I'll try to come up with a solution.
The text was updated successfully, but these errors were encountered: