π Disallow unreadable IIFEs.
πΌ This rule is enabled in the following configs: β
recommended, βοΈ unopinionated.
IIFE with parenthesized arrow function body is considered unreadable.
// β
const foo = (bar => (bar ? bar.baz : baz))(getBar());
// β
const bar = getBar();
const foo = bar ? bar.baz : baz;
// β
const getBaz = bar => (bar ? bar.baz : baz);
const foo = getBaz(getBar());// β
const foo = ((bar, baz) => ({bar, baz}))(bar, baz);// β
const foo = (bar => {
return bar ? bar.baz : baz;
})(getBar());