# no-unreadable-iife

Rule `unicorn/no-unreadable-iife`. Disallow unreadable IIFEs.

- Source: unicorn
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 12M weekly downloads of presets that enable it
- Trend: +40.1% last quarter
- Rank: #766 by reach, #962 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `unicorn/no-unreadable-iife` | no | suggestion | package `eslint-plugin-unicorn` | [docs](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v80.0.0/docs/rules/no-unreadable-iife.md) |
| Oxlint | `unicorn/no-unreadable-iife` | no | suggestion | plugin `unicorn`, category pedantic | [docs](https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-unreadable-iife.html) |
| Biome | `nursery/noUnreadableIife` | no | unsafe | group nursery, since 2.6.4 | [docs](https://biomejs.dev/linter/rules/no-unreadable-iife/) |

## Code examples

### Incorrect: the rule reports this

```js
const foo = (bar => (bar ? bar.baz : baz))(getBar());
```

```js
const foo = ((bar, baz) => ({bar, baz}))(bar, baz);
```

### Correct: the rule accepts this

```js
const bar = getBar();
const foo = bar ? bar.baz : baz;
```

```js
const getBaz = bar => (bar ? bar.baz : baz);
const foo = getBaz(getBar());
```

```js
const foo = {bar, baz};
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import unicorn from "eslint-plugin-unicorn";

export default [
  {
    plugins: { unicorn },
    rules: {
      "unicorn/no-unreadable-iife": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "unicorn/no-unreadable-iife": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noUnreadableIife": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Unicorn recommended](https://lintradar.dev/presets/unicorn-recommended.md) | ESLint | `eslint-plugin-unicorn` | 340 | 9.5M | +30.3% |
| [Unicorn unopinionated](https://lintradar.dev/presets/unicorn-unopinionated.md) | ESLint | `eslint-plugin-unicorn` | 236 | 9.5M | +30.3% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |

## Related rules

- [unicorn/no-static-only-class](https://lintradar.dev/rules/unicorn/no-static-only-class.md): Disallow classes that only have static members.
- [unicorn/no-zero-fractions](https://lintradar.dev/rules/unicorn/no-zero-fractions.md): Require consistent decimal numbers without redundant zeros.
- [unicorn/no-negation-in-equality-check](https://lintradar.dev/rules/unicorn/no-negation-in-equality-check.md): Disallow negated expression in equality check.
- [unicorn/prefer-negative-index](https://lintradar.dev/rules/unicorn/prefer-negative-index.md): Prefer negative index over `.length - index` when possible.
- [unicorn/no-negated-condition](https://lintradar.dev/rules/unicorn/no-negated-condition.md): Disallow negated conditions.
- [unicorn/prefer-query-selector](https://lintradar.dev/rules/unicorn/prefer-query-selector.md): Prefer `.querySelector()` and `.querySelectorAll()` over older DOM query methods.

---

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