Skip to content

[unbound-method] Doesn't work on destructuring declarations #1112

Closed
@Validark

Description

@Validark

Repro

{
  "rules": {
    "@typescript-eslint/unbound-method": "warn"
  }
}
class MyClass {
	public log(): void {
		print(this);
	}
}

const instance = new MyClass();

const myLog = instance.log; // properly caught
myLog();

const { log } = instance; // no problem ?

log();

Expected Result const { log } = instance; should get reported as bad

Actual Result const { log } = instance; is not reported

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 2.3.2
@typescript-eslint/parser 2.3.2
TypeScript 3.6.4
ESLint 6.5.1
node 12.9.1
npm 6.11.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions