# noVoidTypeReturn

Rule `biome/noVoidTypeReturn`. Disallow returning a value from a function with the return type 'void'

- Source: biome
- Technologies: TypeScript
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 30.6M weekly downloads of presets that enable it
- Trend: +109.3% last quarter
- Rank: #580 by reach, #215 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `correctness/noVoidTypeReturn` | yes | no | group correctness, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/no-void-type-return/) |

## Code examples

### Incorrect: the rule reports this

```ts
class A {
    f(): void {
        return undefined;
    }
}
```

```ts
const a = {
    f(): void {
        return undefined;
    }
}
```

```ts
function f(): void {
    return undefined;
}
```

### Correct: the rule accepts this

```js
class A {
    f() {
        return undefined;
    }
}
```

```ts
class B {
    f(): void {}
}
```

```ts
function f(): void {
    return;
}
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "correctness": {
        "noVoidTypeReturn": "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/noUselessStringRaw](https://lintradar.dev/rules/biome/noUselessStringRaw.md): Disallow unnecessary `String.raw` function in template string literals without any escape sequence.
- [biome/noVueMixin](https://lintradar.dev/rules/biome/noVueMixin.md): Disallow the `mixins` option in Vue components.
- [biome/noUselessReExportAll](https://lintradar.dev/rules/biome/noUselessReExportAll.md): Disallow `export * from` a module that has no named exports.
- [biome/noZeroLengthUnit](https://lintradar.dev/rules/biome/noZeroLengthUnit.md): Disallow units on zero lengths.
- [biome/noUselessEscapeInString](https://lintradar.dev/rules/biome/noUselessEscapeInString.md): Disallow unnecessary escapes in string literals.
- [biome/useBiomeIgnoreFolder](https://lintradar.dev/rules/biome/useBiomeIgnoreFolder.md): Prefer folder exclusions that prevent Biome from scanning the folder.

---

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