···
function cleanup(opts = {}) {
const filter = createFilter(opts.include, opts.exclude, {
···
-
plugins: [unwrapStatePlugin, curryGuaranteePlugin],
···
+
function squashImplicitUnitReturn({ types: t }) {
+
ReturnStatement(path) {
+
t.isCallExpression(path.node.argument) &&
+
t.isIdentifier(path.node.argument.callee) &&
+
(path.node.argument.callee.name === 'sink' || path.node.argument.callee.name === 'source')
+
path.replaceWithMultiple([
+
t.expressionStatement(path.node.argument),
+
if (t.isIdentifier(functionPath.id) && functionPath.id.name === 'valFromOption') return;
+
let hasEmptyReturn = false;
+
let hasCallReturnOnly = true;
+
functionPath.traverse({
+
if (path.node.argument === null) {
+
} else if (!t.isCallExpression(path.node.argument)) {
+
hasCallReturnOnly = false;
+
if (hasEmptyReturn && hasCallReturnOnly && path.node.argument !== null) {
+
path.replaceWithMultiple([
+
t.expressionStatement(path.node.argument),
function cleanup(opts = {}) {
const filter = createFilter(opts.include, opts.exclude, {
···
+
plugins: [unwrapStatePlugin, curryGuaranteePlugin, squashImplicitUnitReturn],