Skip to main content

Enforces unbound methods are called with their expected scope (unbound-method)

Warns when a method is used outside of a method call.

Class functions don't preserve the class scope when passed as standalone variables.

If your function does not access this, you can annotate it with this: void, or consider using an arrow function instead.

If you're working with jest, you can use eslint-plugin-jest's version of this rule to lint your test files, which knows when it's ok to pass an unbound method to expect calls.

Rule Details

Examples of code for this rule

class MyClass {
public log(): void {

const instance = new MyClass();

// This logs the global scope (`window`/`global`), not the class instance
const myLog = instance.log;

// This log might later be called with an incorrect scope
const { log } = instance;

// arith.double may refer to `this` internally
const arith = {
double(x: number): number {
return x * 2;
const { double } = arith;


The rule accepts an options object with the following property:

  • ignoreStatic to not check whether static methods are correctly bound


Examples of correct code for this rule with { ignoreStatic: true }:

class OtherClass {
static log() {

// With `ignoreStatic`, statics are assumed to not rely on a particular scope
const { log } = OtherClass;



"@typescript-eslint/unbound-method": [
"ignoreStatic": true

When Not To Use It

If your code intentionally waits to bind methods after use, such as by passing a scope: this along with the method, you can disable this rule.

If you're wanting to use toBeCalled and similar matches in jest tests, you can disable this rule for your test files in favor of eslint-plugin-jest's version of this rule.


  • โœ… Recommended
  • ๐Ÿ”ง Fixable
  • ๐Ÿ’ญ Requires type information