---
title: "lint/style/no-nested-ternary"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="lint/style/no-nested-ternary" />

In the [`coding-style`](/docs/rules/sets/coding-style) set. Report only.

## What it does

Nested ternary expressions are disallowed to improve code clarity and prevent potential bugs arising from confusion over operator associativity.

## Configuration

```toml title="pun.toml"
[lint.rules]
"style/no-nested-ternary" = "error"
```

To skip it in some files or lines, add an [override](/docs/configuration/pun-toml#lint) or an [ignore comment](/docs/configuration/ignore-comments).

## Replaces

- [`no-nested-ternary`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/#no-nested-ternary) (mago-linter)

[More lint/style rules](/docs/rules/lint/style) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
