diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 4bedafc76615a2..3b8f051b4c8f4a 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -257,6 +257,7 @@ overrides: - ./cluster.js - ./console.js - ./constants.js + - ./events.js - ./fs.js - ./internal/assert.js - ./internal/child_process.js @@ -264,6 +265,7 @@ overrides: - ./internal/cli_table.js - ./internal/cluster/*.js - ./internal/debugger/*.js + - ./internal/event_target.js - ./internal/events/*.js - ./internal/fixed_queue.js - ./internal/freelist.js diff --git a/lib/events.js b/lib/events.js index 8e6a2b5af0ef54..b887ef43de793d 100644 --- a/lib/events.js +++ b/lib/events.js @@ -67,7 +67,7 @@ const { ERR_INVALID_ARG_TYPE, ERR_INVALID_THIS, ERR_OUT_OF_RANGE, - ERR_UNHANDLED_ERROR + ERR_UNHANDLED_ERROR, }, genericNodeError, } = require('internal/errors'); @@ -95,7 +95,7 @@ let EventEmitterAsyncResource; function lazyEventEmitterAsyncResource() { if (EventEmitterAsyncResource === undefined) { const { - AsyncResource + AsyncResource, } = require('async_hooks'); const kEventEmitter = Symbol('kEventEmitter'); @@ -232,7 +232,7 @@ ObjectDefineProperty(EventEmitter, 'captureRejections', { EventEmitter.prototype[kCapture] = value; }, - enumerable: true + enumerable: true, }); ObjectDefineProperty(EventEmitter, 'EventEmitterAsyncResource', { @@ -250,7 +250,7 @@ ObjectDefineProperty(EventEmitter.prototype, kCapture, { __proto__: null, value: false, writable: true, - enumerable: false + enumerable: false, }); EventEmitter.prototype._events = undefined; @@ -279,7 +279,7 @@ ObjectDefineProperty(EventEmitter, 'defaultMaxListeners', { arg); } defaultMaxListeners = arg; - } + }, }); ObjectDefineProperties(EventEmitter, { @@ -296,7 +296,7 @@ ObjectDefineProperties(EventEmitter, { enumerable: false, configurable: false, writable: false, - } + }, }); /** @@ -480,7 +480,7 @@ EventEmitter.prototype.emit = function emit(type, ...args) { ObjectDefineProperty(er, kEnhanceStackBeforeInspector, { __proto__: null, value: FunctionPrototypeBind(enhanceStackTrace, this, er, capture), - configurable: true + configurable: true, }); } catch { // Continue regardless of error. @@ -1092,7 +1092,7 @@ function on(emitter, event, options = kEmptyObject) { [SymbolAsyncIterator]() { return this; - } + }, }, AsyncIteratorPrototype); eventTargetAgnosticAddListener(emitter, event, eventHandler);