-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
bugSomething isn't workingSomething isn't workinghas prthere is a PR raised to close thisthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
Repro
{
"rules": {
"@typescript-eslint/unbound-method": [
"error",
{
"ignoreStatic": true
}
]
}
}
class BaseClass {
x: number = 42;
logThis() { console.log(`x is ${this?.x}`); }
}
class OtherClass extends BaseClass {
superLogThis: any;
constructor() {
super();
this.superLogThis = super.logThis; // X - Incorrect eslint error
}
}
const oc = new OtherClass();
oc.superLogThis(); // Works despite eslint error in constructor
Expected Result
No unbound-method
error. In the test case above, oc.superLogThis()
correctly prints x is 42
.
Actual Result
unbound-method
error about super.logThis
in OtherClass
's constructor.
Additional Info
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
2.17.0 |
@typescript-eslint/parser |
2.17.0 |
TypeScript |
3.7.5 |
ESLint |
6.8.0 |
node |
10.19.0 |
npm |
6.13.4 |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghas prthere is a PR raised to close thisthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin