uppercase-iife
Disallow unreadable immediately invoked arrow function expressions.
Targeted pattern scopeโ
This rule targets immediately invoked arrow function expressions (IIFEs).
What this rule reportsโ
This rule reports IIFEs whose arrow function body is an unnecessary parenthesized expression.
Why this rule existsโ
Extra parentheses in IIFE arrow bodies reduce readability and add noise.
โ Incorrectโ
(() => doWork())();
โ Correctโ
(() => doWork())();
Behavior and migration notesโ
This rule forwards options and behavior to unicorn/no-unreadable-iife.
- Lifecycle: Deprecated and frozen.
- Deprecated since:
v1.0.0 - Available until:
v2.0.0 - Use instead:
unicorn/no-unreadable-iife
Additional examplesโ
const value = (() => compute())();
// โ reported by forwarded unicorn rule
const valueFixed = (() => compute())();
// โ
valid
ESLint flat config exampleโ
import etcMisc from "eslint-plugin-etc-misc";
export default [
{
plugins: { "etc-misc": etcMisc },
rules: {
"etc-misc/uppercase-iife": "error",
},
},
];
When not to use itโ
Disable this rule if your team deliberately keeps this parenthesized IIFE style for historical consistency.
Package documentationโ
Rule catalog ID: R078
Further readingโ
Adoption resourcesโ
- Start at warning level in CI, then move to error after cleanup.
- Use focused codemods/autofix batches per package or directory.