Skip to main content

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.

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.