packages/babel-plugin-minify-simplify/src/index.js
function(path) {
            const { node } = path;

            if (
              !path.parentPath.parentPath.isFunction() ||
              path.getSibling(path.key + 1).node
            ) {
              return;
            }

            if (!node.argument) {
              path.remove();
              return;
            }

            if (t.isUnaryExpression(node.argument, { operator: "void" })) {
              path.replaceWith(node.argument.argument);
            }
          }
function(path) {
            const { node } = path;

            if (
              !path.parentPath.parentPath.isFunction() ||
              path.getSibling(path.key + 1).node
            ) {
              return;
            }

            if (!node.argument) {
              path.remove();
              return;
            }

            if (t.isUnaryExpression(node.argument, { operator: "void" })) {
              path.replaceWith(node.argument.argument);
            }
          }
function ( path ) { const { node } = path ; if ( ! path . parentPath . parentPath . isFunction ( ) || path . getSibling ( path . key + 1 ) . node ) { return ; } if ( ! node . argument ) { path . remove ( ) ; return ; } if ( t . isUnaryExpression ( node . argument , { operator : "void" } ) ) { path . replaceWith ( node . argument . argument ) ; } }
Remove return if last statement with no argument. Replace return with `void` argument with argument.
Remove return if last statement with no argument . Replace return with void argument with argument .