This is mostly a Facebook-specific transform that removes noop function calls. However, can be generalized to detect and remove noops.
In
function emptyFunction(){}
emptyFunction('how long','?');
foo(emptyFunction('how long', '?'));
Out
function emptyFunction(){}
foo(false);
npm install babel-plugin-minify-empty-function
.babelrc
{
"plugins": ["minify-empty-function"]
}
babel --plugins minify-empty-function script.js
require("babel-core").transform("code", {
plugins: ["minify-empty-function"]
});