npm.io
5.1.0 • Published 10 months ago

@putout/plugin-remove-iife

Licence
MIT
Version
5.1.0
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Stars
796

@putout/plugin-remove-iife NPM version

An IIFE (Immediately Invoked Function Expression) is a JavaScript function that runs as soon as it is defined.

(c) MDN

Putout plugin adds ability to find and remove IIFE. Check out in Putout Editor:

Install

npm i @putout/plugin-remove-iife

Rule

{
    "rules": {
        "remove-iife": "on"
    }
}

Example of incorrect code

(function() {
    console.log('hello');
})();

((a) => fn(a))(value);
((a, b) => fn(a, b))(value, value2);

Example of correct code

console.log('hello');
fn(value);
fn(value, value2);

License

MIT

Keywords