[unbound-method] problem detected using typeof of method #692
Labels
bug
Something isn't working
good first issue
Good for newcomers
has pr
there is a PR raised to close this
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Repro
Expected Result
No error is detected.
Actual Result
The next error is shown:
Avoid referencing unbound methods which may cause unintentional scoping of `this` @typescript-eslint/unbound-method
Additional Info
If the method is not run I can't see how the
this
can get an unexpected value.I've seem tslint has an
allow-typeof
option to allow this use case. However, if I'm not missing something the ideal behaviour will be only applying the rule when the method is run instead of adding that kind of options.Versions
@typescript-eslint/eslint-plugin
1.11.0
@typescript-eslint/parser
1.11.0
TypeScript
3.5.3
ESLint
5.16.0
node
8.16.0
npm
6.10.0
The text was updated successfully, but these errors were encountered: