> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# no-unreadable-iife

[Added in v0.9.3](https://github.com/web-infra-dev/rslint/releases/tag/v0.9.3)
## Configuration

| Preset                              | Configured Value |
| ----------------------------------- | ---------------- |
| ✅ unicornPlugin.configs.recommended | `"error"`        |


```ts title=rslint.config.ts
import { defineConfig, unicornPlugin } from '@rslint/core';

export default defineConfig([
  unicornPlugin.configs.recommended,
  {
    rules: {
      'unicorn/no-unreadable-iife': 'error',
    },
  },
]);
```

## Rule Details

Disallow immediately invoked arrow functions with parenthesized expression bodies.
A block body makes the function body easier to distinguish from the surrounding call.

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

```javascript
const foo = (bar => (bar ? bar.baz : baz))(getBar());
const value = (() => ({ ready: true }))();
```

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

```javascript
const foo = (bar => {
  return bar ? bar.baz : baz;
})(getBar());
const value = { ready: true };
```

## Suggestions

This rule offers an editor suggestion to replace the parenthesized body with a
block containing a return statement. It does not automatically fix code. The
suggestion is withheld when removing the parentheses would discard comments
outside the expression. Comments inside the expression are preserved.

## Options

This rule has no options.

## Original Documentation

- [eslint-plugin-unicorn: no-unreadable-iife](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v74.0.0/docs/rules/no-unreadable-iife.md)
- [Source code](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v74.0.0/rules/no-unreadable-iife.js)
