# class-methods-use-this

Rule `typescript/class-methods-use-this`. Enforce that class methods utilize `this`

- Source: typescript
- Technologies: TypeScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 171.7K weekly downloads of presets that enable it
- Trend: +39.3% last quarter
- Rank: #1641 by reach, #1031 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `@typescript-eslint/class-methods-use-this` | no | no | package `@typescript-eslint/eslint-plugin` | [docs](https://typescript-eslint.io/rules/class-methods-use-this) |

## Code examples

### Incorrect: the rule reports this

```ts
class Standalone {
  method() {}
  property = () => {};
}
```

```ts
interface Base {
  method(): void;
}

class Derived implements Base {
  method() {}
  property = () => {};

  private privateMethod() {}
  private privateProperty = () => {};

  protected protectedMethod() {}
  protected protectedProperty = () => {};
}
```

### Correct: the rule accepts this

```ts
abstract class Base {
  abstract method(): void;
  abstract property: () => void;
}

class Derived extends Base {
  override method() {}
  override property = () => {};
}
```

```ts
interface Base {
  method(): void;
}

class Derived implements Base {
  method() {}
  property = () => {};
}
```

```ts
interface Base {
  method(): void;
}

class Derived implements Base {
  method() {}
  property = () => {};
}
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import tseslint from "typescript-eslint";

export default [
  {
    plugins: { "@typescript-eslint": tseslint.plugin },
    rules: {
      "@typescript-eslint/class-methods-use-this": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |

## Related rules

- [eslint/class-methods-use-this](https://lintradar.dev/rules/eslint/class-methods-use-this.md): Enforce that class methods utilize `this`
- [typescript/prefer-destructuring](https://lintradar.dev/rules/typescript/prefer-destructuring.md): Require destructuring from arrays and/or objects
- [typescript/init-declarations](https://lintradar.dev/rules/typescript/init-declarations.md): Require or disallow initialization in variable declarations
- [typescript/no-magic-numbers](https://lintradar.dev/rules/typescript/no-magic-numbers.md): Disallow magic numbers
- [typescript/max-params](https://lintradar.dev/rules/typescript/max-params.md): Enforce a maximum number of parameters in function definitions
- [typescript/member-ordering](https://lintradar.dev/rules/typescript/member-ordering.md): Require a consistent member declaration order

---

Web page: https://lintradar.dev/rules/typescript/class-methods-use-this. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
