From e2181e057b68ca392f817646575f9926b2e20ebd Mon Sep 17 00:00:00 2001 From: RafaelGSS Date: Thu, 10 Nov 2022 13:40:53 -0300 Subject: [PATCH] lib: fix eslint early return The https://github.com/nodejs/node/pull/45243 upgraded eslint and apparently, when you specific a `@returns` early returns aren't considered valid. This PR fixes this lint issue. PR-URL: https://github.com/nodejs/node/pull/45409 Reviewed-By: Filip Skokan Reviewed-By: Luigi Pinca Reviewed-By: Ruy Adorno Reviewed-By: Beth Griggs --- lib/events.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/events.js b/lib/events.js index 7abf18f42c0064..004112cd353db8 100644 --- a/lib/events.js +++ b/lib/events.js @@ -1091,8 +1091,6 @@ function on(emitter, event, options) { { once: true }); } - return iterator; - function abortListener() { errorHandler(new AbortError(undefined, { cause: signal?.reason })); } @@ -1120,4 +1118,5 @@ function on(emitter, event, options) { iterator.return(); } + return iterator; }