---
# Don't modify this file manually. This file is auto generated from source, and you will lose your changes next time the website is built.
# Head to the `biomejs/biome` repository, and modify the source code in there.

title: useAdjacentOverloadSignatures
description: Learn more about useAdjacentOverloadSignatures
---
import { Tabs, TabItem } from '@astrojs/starlight/components';

<Tabs>
<TabItem label="JavaScript (and super languages)" icon="seti:javascript">
## Summary
- Rule available since: `v1.9.0`
- Diagnostic Category: [`lint/suspicious/useAdjacentOverloadSignatures`](/reference/diagnostics#diagnostic-category)
- This rule is **recommended**, meaning it is enabled by default.
- This rule doesn't have a fix.
- The default severity of this rule is [**warning**](/reference/diagnostics#warning).
- Sources: 
  - Same as [`@typescript-eslint/adjacent-overload-signatures`](https://typescript-eslint.io/rules/adjacent-overload-signatures)

## How to configure
```json title="biome.json"
{
	"linter": {
		"rules": {
			"suspicious": {
				"useAdjacentOverloadSignatures": "error"
			}
		}
	}
}

```
## Description
Disallow the use of overload signatures that are not next to each other.

Overload signatures must be adjacent.
If a key is defined multiple times, only the last definition takes effect. Previous definitions are ignored.
This rule is useful for preventing accidental overloads that are not adjacent.
It is recommended to keep the overload signatures adjacent to make the code easier to read and maintain.

## Examples

### Invalid

```ts
type Foo = {
  foo_type(s: string): void;
  foo_type(n: number): void;
  bar_type(): void;
  foo_type(sn: string | number): void;
};
```

<pre class="language-text"><code class="language-text">code-block.ts:5:3 <a href="https://biomejs.dev/linter/rules/use-adjacent-overload-signatures">lint/suspicious/useAdjacentOverloadSignatures</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━<br /><br />  <strong><span style="color: Orange;">⚠</span></strong> <span style="color: Orange;">All foo&#95;type signatures must be adjacent.</span><br />  <br />    <strong>3 │ </strong>  foo&#95;type(n: number): void;<br />    <strong>4 │ </strong>  bar&#95;type(): void;<br />  <strong><span style="color: Tomato;">&gt;</span></strong> <strong>5 │ </strong>  foo&#95;type(sn: string | number): void;<br />   <strong>   │ </strong>  <strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><br />    <strong>6 │ </strong>&#125;;<br />    <strong>7 │ </strong><br />  <br /></code></pre>

```ts
interface Foo {
  foo_interface(s: string): void;
  foo_interface(n: number): void;
  bar_interface(): void;
  foo_interface(sn: string | number): void;
}
```

<pre class="language-text"><code class="language-text">code-block.ts:5:3 <a href="https://biomejs.dev/linter/rules/use-adjacent-overload-signatures">lint/suspicious/useAdjacentOverloadSignatures</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━<br /><br />  <strong><span style="color: Orange;">⚠</span></strong> <span style="color: Orange;">All foo&#95;interface signatures must be adjacent.</span><br />  <br />    <strong>3 │ </strong>  foo&#95;interface(n: number): void;<br />    <strong>4 │ </strong>  bar&#95;interface(): void;<br />  <strong><span style="color: Tomato;">&gt;</span></strong> <strong>5 │ </strong>  foo&#95;interface(sn: string | number): void;<br />   <strong>   │ </strong>  <strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><br />    <strong>6 │ </strong>&#125;<br />    <strong>7 │ </strong><br />  <br /></code></pre>

```ts
class A {
  fooA(s: string): void;
  fooA(n: number): void;
  barA(): void {};
  fooA(sn: string | number): void {};
}
```

<pre class="language-text"><code class="language-text">code-block.ts:5:3 <a href="https://biomejs.dev/linter/rules/use-adjacent-overload-signatures">lint/suspicious/useAdjacentOverloadSignatures</a> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━<br /><br />  <strong><span style="color: Orange;">⚠</span></strong> <span style="color: Orange;">All fooA signatures must be adjacent.</span><br />  <br />    <strong>3 │ </strong>  fooA(n: number): void;<br />    <strong>4 │ </strong>  barA(): void &#123;&#125;;<br />  <strong><span style="color: Tomato;">&gt;</span></strong> <strong>5 │ </strong>  fooA(sn: string | number): void &#123;&#125;;<br />   <strong>   │ </strong>  <strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><strong><span style="color: Tomato;">^</span></strong><br />    <strong>6 │ </strong>&#125;<br />    <strong>7 │ </strong><br />  <br /></code></pre>

### Valid

```ts
declare namespace Foo {
  export function foo_declare(s: string): void;
  export function foo_declare(n: number): void;
  export function foo_declare(sn: string | number): void;
  export function bar_declare(): void;
}
```

```ts
type Foo = {
  foo_type(s: string): void;
  foo_type(n: number): void;
  foo_type(sn: string | number): void;
  bar_type(): void;
};
```

```ts
interface Foo {
  foo_interface(s: string): void;
  foo_interface(n: number): void;
  foo_interface(sn: string | number): void;
  bar_interface(): void;
}
```

```ts
class A {
  fooA(s: string): void;
  fooA(n: number): void;
  fooA(sn: string | number): void {}
  barA(): void {}
}
```

## Related links

- [Disable a rule](/linter/#disable-a-rule)
- [Configure the code fix](/linter#configure-the-code-fix)
- [Rule options](/linter/#rule-options)
- [Source Code](https://github.com/biomejs/biome/blob/main/crates/biome_js_analyze/src/lint/suspicious/use_adjacent_overload_signatures.rs)
- [Test Cases](https://github.com/biomejs/biome/blob/main/crates/biome_js_analyze/tests/specs/suspicious/useAdjacentOverloadSignatures)

</TabItem>
</Tabs>