---
url: /docs/guide/usage/linter/rules/unicorn/max-nested-calls.md
---

### What it does

Limit the depth of nested calls.

This rule counts calls and constructor calls passed into other calls or
constructors. Fluent receiver chains and JSX wrappers are ignored.

### Why is this bad?

Deeply nested calls make code hard to read. Extracting intermediate
results into named variables improves readability.

### Examples

Examples of **incorrect** code for this rule:

```js
foo(bar(baz(qux())));
```

Examples of **correct** code for this rule:

```js
const value = baz(qux());
foo(bar(value));

// Fluent chains are ignored.
query().filter().map().toArray();
```

## Configuration

This rule accepts a configuration object with the following properties:

### max

type: `integer`

default: `3`

The maximum allowed nested call depth.

## How to use

## Version

This rule was added in v1.71.0.

## References
