chore: enable unbound-method eslint rule#33605
Conversation
Unbound method calls using `this` are likely to have unintended effects.
Here is an example with static methods, but the same thing applies
to object methods:
```ts
class Class {
public static staticMethod() {
this.otherStaticMethod()
}
public static otherStaticMethod() { }
}
// ✅ valid
Class.staticMethod();
// ❌ boom
const x = Class.staticMethod;
x();
```
When assigning a method to a variable, you need to take extra
care and this linter rule is going to remind you.
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (50.00%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #33605 +/- ##
=======================================
Coverage 82.21% 82.21%
=======================================
Files 119 119
Lines 6876 6876
Branches 1162 1162
=======================================
Hits 5653 5653
Misses 1120 1120
Partials 103 103
Flags with carried forward coverage won't be shown. Click here to find out more.
|
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Unbound method calls using
thisare likely to have unintended effects.Here is an example with static methods, but the same thing applies to object methods:
When assigning a method to a variable, you need to take extra care and this linter rule is going to remind you.
This rule also catches a lot of cases were we meant to call a function but accidentally didn't:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license