# noThisInStatic

Rule `biome/noThisInStatic`. Disallow `this` and `super` in `static` contexts.

- Source: biome
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 30.6M weekly downloads of presets that enable it
- Trend: +109.3% last quarter
- Rank: #563 by reach, #198 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `complexity/noThisInStatic` | yes | unsafe | group complexity, since 1.3.1 | [docs](https://biomejs.dev/linter/rules/no-this-in-static/) |

## Code examples

### Incorrect: the rule reports this

```js
class A {
   static CONSTANT = 0;

   static foo() {
       this.CONSTANT;
   }
}
```

```js
class B extends A {
   static bar() {
       super.CONSTANT;
   }
}
```

### Correct: the rule accepts this

```js
class B extends A {
    static ANOTHER_CONSTANT = A.CONSTANT + 1;

    static foo() {
        A.CONSTANT;
        B.ANOTHER_CONSTANT;
    }

    bar() {
        this.property;
    }
}
```

```js
class A {
   static foo() {
       doSomething()
   }

   bar() {
     A.foo()
   }
}
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "complexity": {
        "noThisInStatic": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [biome/noTanstackQueryVoidQueryFn](https://lintradar.dev/rules/biome/noTanstackQueryVoidQueryFn.md): Disallow TanStack Query functions that don't return any data.
- [biome/noUnknownAtRules](https://lintradar.dev/rules/biome/noUnknownAtRules.md): Disallow unrecognized CSS at-rules.
- [biome/noTanstackQueryUnstableDeps](https://lintradar.dev/rules/biome/noTanstackQueryUnstableDeps.md): Disallow using the result of a TanStack Query hook as a React hook dependency.
- [biome/noUnknownFunction](https://lintradar.dev/rules/biome/noUnknownFunction.md): Disallow unrecognized CSS value functions.
- [biome/noTanstackQueryRestDestructuring](https://lintradar.dev/rules/biome/noTanstackQueryRestDestructuring.md): Disallow rest destructuring and object spread on TanStack Query results.
- [biome/noUnknownMediaFeatureName](https://lintradar.dev/rules/biome/noUnknownMediaFeatureName.md): Disallow unrecognized feature names in media queries.

---

Web page: https://lintradar.dev/rules/biome/noThisInStatic. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
