Incorrect removing of an expression
Closed this issue · 2 comments
sirenkovladd commented
import {
parse,
transform,
} from 'putout';
import {print} from '@putout/printer';
import removeUnusedExpressions from '@putout/plugin-remove-unused-expressions';
const js = `a();!(function (s) {console.log(s);})();b()`;
const ast = parse(js);
transform(ast, js, {plugins: [
['remove-unused-expressions', removeUnusedExpressions],
]});
const min = print(ast);
console.log(min);
result
❯ node v.js
a();
b();
removed immediate function execution
coderaiser commented
Just fixed, is it works for you?
sirenkovladd commented
Yes, thank you so much)