diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index ff790e49821d28..b6c41447ce4e00 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -5,7 +5,7 @@ rules: comma-dangle: [error, { arrays: always-multiline, exports: always-multiline, - functions: only-multiline, + functions: always-multiline, imports: always-multiline, objects: only-multiline, }] diff --git a/lib/_http_agent.js b/lib/_http_agent.js index 6fd876222c579e..8129fcfdeb9cae 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -396,7 +396,7 @@ function installListeners(agent, s, options) { // TODO(ronag): Always destroy, even if not in free list. const sockets = agent.freeSockets; if (ArrayPrototypeSome(ObjectKeys(sockets), (name) => - ArrayPrototypeIncludes(sockets[name], s) + ArrayPrototypeIncludes(sockets[name], s), )) { return s.destroy(); } diff --git a/lib/_http_server.js b/lib/_http_server.js index bf1cd91b288491..f86f3b76e352c2 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -600,7 +600,7 @@ function checkConnections() { function connectionListener(socket) { defaultTriggerAsyncIdScope( - getOrSetAsyncId(socket), connectionListenerInternal, this, socket + getOrSetAsyncId(socket), connectionListenerInternal, this, socket, ); } @@ -803,15 +803,15 @@ function onParserTimeout(server, socket) { const noop = () => {}; const badRequestResponse = Buffer.from( `HTTP/1.1 400 ${STATUS_CODES[400]}\r\n` + - 'Connection: close\r\n\r\n', 'ascii' + 'Connection: close\r\n\r\n', 'ascii', ); const requestTimeoutResponse = Buffer.from( `HTTP/1.1 408 ${STATUS_CODES[408]}\r\n` + - 'Connection: close\r\n\r\n', 'ascii' + 'Connection: close\r\n\r\n', 'ascii', ); const requestHeaderFieldsTooLargeResponse = Buffer.from( `HTTP/1.1 431 ${STATUS_CODES[431]}\r\n` + - 'Connection: close\r\n\r\n', 'ascii' + 'Connection: close\r\n\r\n', 'ascii', ); function socketOnError(e) { // Ignore further errors diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 78fe3191dc86d5..377187a6e5a3d1 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -171,7 +171,7 @@ function onhandshakedone() { function loadSession(hello) { debug('server onclienthello', 'sessionid.len', hello.sessionId.length, - 'ticket?', hello.tlsTicket + 'ticket?', hello.tlsTicket, ); const owner = this[owner_symbol]; @@ -350,7 +350,7 @@ function onPskServerCallback(identity, maxPskLen) { throw new ERR_INVALID_ARG_TYPE( 'ret', ['Object', 'Buffer', 'TypedArray', 'DataView'], - ret + ret, ); } psk = ret.psk; @@ -361,7 +361,7 @@ function onPskServerCallback(identity, maxPskLen) { throw new ERR_INVALID_ARG_VALUE( 'psk', psk, - `Pre-shared key exceeds ${maxPskLen} bytes` + `Pre-shared key exceeds ${maxPskLen} bytes`, ); } @@ -381,7 +381,7 @@ function onPskClientCallback(hint, maxPskLen, maxIdentityLen) { throw new ERR_INVALID_ARG_VALUE( 'psk', ret.psk, - `Pre-shared key exceeds ${maxPskLen} bytes` + `Pre-shared key exceeds ${maxPskLen} bytes`, ); } @@ -390,7 +390,7 @@ function onPskClientCallback(hint, maxPskLen, maxIdentityLen) { throw new ERR_INVALID_ARG_VALUE( 'identity', ret.identity, - `PSK identity exceeds ${maxIdentityLen} bytes` + `PSK identity exceeds ${maxIdentityLen} bytes`, ); } @@ -447,7 +447,7 @@ function initRead(tlsSocket, socket) { debug('%s initRead', tlsSocket._tlsOptions.isServer ? 'server' : 'client', 'handle?', !!tlsSocket._handle, - 'buffered?', !!socket && socket.readableLength + 'buffered?', !!socket && socket.readableLength, ); // If we were destroyed already don't bother reading if (!tlsSocket._handle) @@ -689,7 +689,7 @@ TLSSocket.prototype._init = function(socket, wrap) { debug('%s _init', options.isServer ? 'server' : 'client', - 'handle?', !!ssl + 'handle?', !!ssl, ); // Clients (!isServer) always request a cert, servers request a client cert @@ -846,7 +846,7 @@ TLSSocket.prototype.renegotiate = function(options, callback) { debug('%s renegotiate()', this._tlsOptions.isServer ? 'server' : 'client', - 'destroyed?', this.destroyed + 'destroyed?', this.destroyed, ); if (this.destroyed) @@ -1456,7 +1456,7 @@ Server.prototype.addContext = function(servername, context) { const re = new RegExp('^' + StringPrototypeReplaceAll( RegExpPrototypeSymbolReplace(/([.^$+?\-\\[\]{}])/g, servername, '\\$1'), - '*', '[^.]*' + '*', '[^.]*', ) + '$'); ArrayPrototypePush(this._contexts, [re, tls.createSecureContext(context).context]); @@ -1680,7 +1680,7 @@ exports.connect = function connect(...args) { 'Setting the TLS ServerName to an IP address is not permitted by ' + 'RFC 6066. This will be ignored in a future version.', 'DeprecationWarning', - 'DEP0123' + 'DEP0123', ); ipServernameWarned = true; } diff --git a/lib/assert.js b/lib/assert.js index 82c3a285f51abd..93b80088ec222a 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -148,7 +148,7 @@ function fail(actual, expected, message, operator, stackStartFn) { 'assert.fail() with more than one argument is deprecated. ' + 'Please use assert.strictEqual() instead or only pass a message.', 'DeprecationWarning', - 'DEP0094' + 'DEP0094', ); } if (argsLen === 2) @@ -807,13 +807,13 @@ function expectsError(stackStartFn, actual, error, message) { if (actual.message === error) { throw new ERR_AMBIGUOUS_ARGUMENT( 'error/message', - `The error message "${actual.message}" is identical to the message.` + `The error message "${actual.message}" is identical to the message.`, ); } } else if (actual === error) { throw new ERR_AMBIGUOUS_ARGUMENT( 'error/message', - `The error "${actual}" is identical to the message.` + `The error "${actual}" is identical to the message.`, ); } message = error; @@ -855,7 +855,7 @@ function hasMatchingError(actual, expected) { return RegExpPrototypeExec(expected, str) !== null; } throw new ERR_INVALID_ARG_TYPE( - 'expected', ['Function', 'RegExp'], expected + 'expected', ['Function', 'RegExp'], expected, ); } // Guard instanceof against arrow functions as they don't have a prototype. @@ -970,7 +970,7 @@ assert.ifError = function ifError(err) { if (origStackStart !== -1) { const originalFrames = StringPrototypeSplit( StringPrototypeSlice(origStack, origStackStart + 1), - '\n' + '\n', ); // Filter all frames existing in err.stack. let newFrames = StringPrototypeSplit(newErr.stack, '\n'); @@ -996,7 +996,7 @@ assert.ifError = function ifError(err) { function internalMatch(string, regexp, message, fn) { if (!isRegExp(regexp)) { throw new ERR_INVALID_ARG_TYPE( - 'regexp', 'RegExp', regexp + 'regexp', 'RegExp', regexp, ); } const match = fn === assert.match; diff --git a/lib/buffer.js b/lib/buffer.js index 9c39a39e832bbf..5c9ff31ee91a7e 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -326,7 +326,7 @@ Buffer.from = function from(value, encodingOrOffset, length) { throw new ERR_INVALID_ARG_TYPE( 'first argument', ['string', 'Buffer', 'ArrayBuffer', 'Array', 'Array-like Object'], - value + value, ); }; @@ -736,7 +736,7 @@ function byteLength(string, encoding) { } throw new ERR_INVALID_ARG_TYPE( - 'string', ['string', 'Buffer', 'ArrayBuffer'], string + 'string', ['string', 'Buffer', 'ArrayBuffer'], string, ); } @@ -957,7 +957,7 @@ function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { } throw new ERR_INVALID_ARG_TYPE( - 'value', ['number', 'string', 'Buffer', 'Uint8Array'], val + 'value', ['number', 'string', 'Buffer', 'Uint8Array'], val, ); } @@ -1213,7 +1213,7 @@ if (internalBinding('config').hasIntl) { const code = icuErrName(result); const err = genericNodeError( `Unable to transcode Buffer [${code}]`, - { code: code, errno: result } + { code: code, errno: result }, ); throw err; }; @@ -1365,10 +1365,10 @@ ObjectDefineProperties(module.exports, { defineLazyProperties( module.exports, 'internal/blob', - ['Blob', 'resolveObjectURL'] + ['Blob', 'resolveObjectURL'], ); defineLazyProperties( module.exports, 'internal/file', - ['File'] + ['File'], ); diff --git a/lib/child_process.js b/lib/child_process.js index 55e6b781cd0069..1ee9d56f86c5c0 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -56,7 +56,7 @@ let debug = require('internal/util/debuglog').debuglog( 'child_process', (fn) => { debug = fn; - } + }, ); const { Buffer } = require('buffer'); const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap'); @@ -686,7 +686,7 @@ function normalizeSpawnArguments(file, args, options) { } sawKey.add(uppercaseKey); return true; - } + }, ); } diff --git a/lib/crypto.js b/lib/crypto.js index 35d54b5efb3af7..c8745999540aff 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -317,7 +317,7 @@ function getRandomBytesAlias(key) { configurable: true, writable: true, value: value - } + }, ); return value; }, @@ -331,7 +331,7 @@ function getRandomBytesAlias(key) { configurable: true, writable: true, value - } + }, ); } }; diff --git a/lib/dgram.js b/lib/dgram.js index a9fac97f64bb45..4d87299046d52b 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -412,7 +412,7 @@ function _connect(port, address, callback) { defaultTriggerAsyncIdScope( this[async_id_symbol], doConnect, - ex, this, ip, address, port, callback + ex, this, ip, address, port, callback, ); }; @@ -662,7 +662,7 @@ Socket.prototype.send = function(buffer, defaultTriggerAsyncIdScope( this[async_id_symbol], doSend, - ex, this, ip, list, address, port, callback + ex, this, ip, list, address, port, callback, ); }; @@ -1066,7 +1066,7 @@ module.exports = { _createSocketHandle: deprecate( _createSocketHandle, 'dgram._createSocketHandle() is deprecated', - 'DEP0112' + 'DEP0112', ), createSocket, Socket diff --git a/lib/dns.js b/lib/dns.js index 0f66b184d48a51..3489e83d493d79 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -219,7 +219,7 @@ function lookup(hostname, options, callback) { req.oncomplete = all ? onlookupall : onlookup; const err = cares.getaddrinfo( - req, toASCII(hostname), family, hints, verbatim + req, toASCII(hostname), family, hints, verbatim, ); if (err) { process.nextTick(callback, dnsException(err, 'getaddrinfo', hostname)); diff --git a/lib/fs.js b/lib/fs.js index 1e40720512b1bf..300abd73fada23 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -3109,7 +3109,7 @@ module.exports = fs = { defineLazyProperties( fs, 'internal/fs/dir', - ['Dir', 'opendir', 'opendirSync'] + ['Dir', 'opendir', 'opendirSync'], ); ObjectDefineProperties(fs, { diff --git a/lib/internal/assert/assertion_error.js b/lib/internal/assert/assertion_error.js index 65d076b68c06b5..851662fe4c5fa2 100644 --- a/lib/internal/assert/assertion_error.js +++ b/lib/internal/assert/assertion_error.js @@ -72,7 +72,7 @@ function inspectValue(val) { sorted: true, // Inspect getters as we also check them when comparing entries. getters: true, - } + }, ); } diff --git a/lib/internal/async_hooks.js b/lib/internal/async_hooks.js index f049255ebaa6a2..a3b6d0e6432865 100644 --- a/lib/internal/async_hooks.js +++ b/lib/internal/async_hooks.js @@ -201,7 +201,7 @@ function emitInitNative(asyncId, type, triggerAsyncId, resource) { if (typeof active_hooks.array[i][init_symbol] === 'function') { active_hooks.array[i][init_symbol]( asyncId, type, triggerAsyncId, - resource + resource, ); } } diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index 2bd26e1a2668fd..126d4caf740b90 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -201,7 +201,7 @@ class BuiltinModule { * @type {Map} */ static map = new SafeMap( - ArrayPrototypeMap(builtinIds, (id) => [id, new BuiltinModule(id)]) + ArrayPrototypeMap(builtinIds, (id) => [id, new BuiltinModule(id)]), ); constructor(id) { diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index ba93ad68eec63b..c3235e5bdcf610 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -104,7 +104,7 @@ process._exiting = false; const warnIntegerCoercionDeprecation = deprecate( () => {}, 'Implicit coercion to integer for exit code is deprecated.', - 'DEP0164' + 'DEP0164', ); let exitCode; @@ -211,13 +211,13 @@ defineOperation(globalThis, 'setImmediate', timers.setImmediate); defineLazyProperties( globalThis, 'internal/structured_clone', - ['structuredClone'] + ['structuredClone'], ); exposeLazyInterfaces( globalThis, 'internal/worker/io', - ['BroadcastChannel'] + ['BroadcastChannel'], ); // Set the per-Environment callback that will be called // when the TrackingTraceStateObserver updates trace state. diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index f2fe406a4a27d9..8e2f31a294768c 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -947,7 +947,7 @@ function setupChannel(target, channel, serializationMode) { ArrayPrototypePush( target.channel[kPendingMessages], - [event, message, handle] + [event, message, handle], ); } diff --git a/lib/internal/child_process/serialization.js b/lib/internal/child_process/serialization.js index 497bf233d77897..365c1f6f573c74 100644 --- a/lib/internal/child_process/serialization.js +++ b/lib/internal/child_process/serialization.js @@ -82,11 +82,11 @@ const advanced = { channel[kMessageBuffer][0] : Buffer.concat( channel[kMessageBuffer], - channel[kMessageBufferSize] + channel[kMessageBufferSize], ); const deserializer = new ChildProcessDeserializer( - TypedArrayPrototypeSubarray(concatenatedBuffer, 4, fullMessageSize) + TypedArrayPrototypeSubarray(concatenatedBuffer, 4, fullMessageSize), ); messageBufferHead = TypedArrayPrototypeSubarray(concatenatedBuffer, fullMessageSize); diff --git a/lib/internal/cluster/worker.js b/lib/internal/cluster/worker.js index d5dfef4387175f..872c5f89e0ceb3 100644 --- a/lib/internal/cluster/worker.js +++ b/lib/internal/cluster/worker.js @@ -29,10 +29,10 @@ function Worker(options) { if (options.process) { this.process = options.process; this.process.on('error', (code, signal) => - this.emit('error', code, signal) + this.emit('error', code, signal), ); this.process.on('message', (message, handle) => - this.emit('message', message, handle) + this.emit('message', message, handle), ); } } diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 6d2f3a34562ab1..1f0cc2d0a66ed9 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -490,7 +490,7 @@ const consoleMethods = { this[kGroupIndent] = StringPrototypeSlice( this[kGroupIndent], 0, - this[kGroupIndent].length - this[kGroupIndentationWidth] + this[kGroupIndent].length - this[kGroupIndentationWidth], ); }, @@ -653,7 +653,7 @@ function formatTime(ms) { if (hours !== 0 || minutes !== 0) { ({ 0: seconds, 1: ms } = StringPrototypeSplit( NumberPrototypeToFixed(seconds, 3), - '.' + '.', )); const res = hours !== 0 ? `${hours}:${pad(minutes)}` : minutes; return `${res}:${pad(seconds)}.${ms} (${hours !== 0 ? 'h:m' : ''}m:ss.mmm)`; diff --git a/lib/internal/crypto/diffiehellman.js b/lib/internal/crypto/diffiehellman.js index 391832fde46bc2..4950dd195e191d 100644 --- a/lib/internal/crypto/diffiehellman.js +++ b/lib/internal/crypto/diffiehellman.js @@ -81,7 +81,7 @@ function DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding) { throw new ERR_INVALID_ARG_TYPE( 'sizeOrKey', ['number', 'string', 'ArrayBuffer', 'Buffer', 'TypedArray', 'DataView'], - sizeOrKey + sizeOrKey, ); } @@ -116,7 +116,7 @@ function DiffieHellman(sizeOrKey, keyEncoding, generator, genEncoding) { throw new ERR_INVALID_ARG_TYPE( 'generator', ['number', 'string', 'ArrayBuffer', 'Buffer', 'TypedArray', 'DataView'], - generator + generator, ); } diff --git a/lib/internal/crypto/keys.js b/lib/internal/crypto/keys.js index bb7dd7dbd0d1eb..b48dd306738a39 100644 --- a/lib/internal/crypto/keys.js +++ b/lib/internal/crypto/keys.js @@ -203,7 +203,7 @@ const { case 'ec': return this[kAsymmetricKeyDetails] || (this[kAsymmetricKeyDetails] = normalizeKeyDetails( - this[kHandle].keyDetail({}) + this[kHandle].keyDetail({}), )); default: return {}; @@ -382,7 +382,7 @@ function getKeyObjectHandle(key, ctx) { throw new ERR_INVALID_ARG_TYPE( 'key', ['string', 'ArrayBuffer', 'Buffer', 'TypedArray', 'DataView'], - key + key, ); } diff --git a/lib/internal/crypto/random.js b/lib/internal/crypto/random.js index da1ecb80c8941f..874096ac239840 100644 --- a/lib/internal/crypto/random.js +++ b/lib/internal/crypto/random.js @@ -232,7 +232,7 @@ function randomInt(min, max, callback) { } if (max <= min) { throw new ERR_OUT_OF_RANGE( - 'max', `greater than the value of "min" (${min})`, max + 'max', `greater than the value of "min" (${min})`, max, ); } @@ -550,7 +550,7 @@ function checkPrime(candidate, options = kEmptyObject, callback) { 'DataView', 'bigint', ], - candidate + candidate, ); } if (typeof options === 'function') { @@ -583,7 +583,7 @@ function checkPrimeSync(candidate, options = kEmptyObject) { 'DataView', 'bigint', ], - candidate + candidate, ); } validateObject(options, 'options'); diff --git a/lib/internal/crypto/sig.js b/lib/internal/crypto/sig.js index f68606c8655163..457ed1d22eacb6 100644 --- a/lib/internal/crypto/sig.js +++ b/lib/internal/crypto/sig.js @@ -244,7 +244,7 @@ function verifyOneShot(algorithm, data, key, signature, callback) { throw new ERR_INVALID_ARG_TYPE( 'data', ['Buffer', 'TypedArray', 'DataView'], - data + data, ); } @@ -259,7 +259,7 @@ function verifyOneShot(algorithm, data, key, signature, callback) { throw new ERR_INVALID_ARG_TYPE( 'signature', ['Buffer', 'TypedArray', 'DataView'], - signature + signature, ); } diff --git a/lib/internal/crypto/util.js b/lib/internal/crypto/util.js index d7e6356486221e..edd54c3ae9c404 100644 --- a/lib/internal/crypto/util.js +++ b/lib/internal/crypto/util.js @@ -120,7 +120,7 @@ const getArrayBufferOrView = hideStackFrames((buffer, name, encoding) => { 'TypedArray', 'DataView', ], - buffer + buffer, ); } return buffer; diff --git a/lib/internal/debugger/inspect.js b/lib/internal/debugger/inspect.js index 691314605cfd7d..039d33811d1a9d 100644 --- a/lib/internal/debugger/inspect.js +++ b/lib/internal/debugger/inspect.js @@ -278,7 +278,7 @@ class NodeInspector { if (StringPrototypeEndsWith( textToPrint, - 'Waiting for the debugger to disconnect...\n' + 'Waiting for the debugger to disconnect...\n', )) { this.killChild(); } diff --git a/lib/internal/debugger/inspect_client.js b/lib/internal/debugger/inspect_client.js index 5bd73d250c2ead..5c8e5ab997ddfe 100644 --- a/lib/internal/debugger/inspect_client.js +++ b/lib/internal/debugger/inspect_client.js @@ -55,7 +55,7 @@ function validateHandshake(requestKey, responseKey) { if (shabuf.toString('base64') !== responseKey) { throw new ERR_DEBUGGER_ERROR( - `WebSocket secret mismatch: ${requestKey} did not match ${responseKey}` + `WebSocket secret mismatch: ${requestKey} did not match ${responseKey}`, ); } } diff --git a/lib/internal/debugger/inspect_repl.js b/lib/internal/debugger/inspect_repl.js index bd6a59ae282ba3..babf5817d544f4 100644 --- a/lib/internal/debugger/inspect_repl.js +++ b/lib/internal/debugger/inspect_repl.js @@ -521,7 +521,7 @@ function createRepl(inspector) { return SafePromiseAllReturnArrayLike( ArrayPrototypeFilter( this.scopeChain, - (scope) => scope.type !== 'global' + (scope) => scope.type !== 'global', ), async (scope) => { const { objectId } = scope.object; @@ -566,7 +566,7 @@ function createRepl(inspector) { (callFrame) => (callFrame instanceof CallFrame ? callFrame : - new CallFrame(callFrame)) + new CallFrame(callFrame)), ); } } @@ -624,7 +624,7 @@ function createRepl(inspector) { FunctionPrototypeCall( then, result, (result) => returnToCallback(null, result), - returnToCallback + returnToCallback, ); } else { returnToCallback(null, result); @@ -643,7 +643,7 @@ function createRepl(inspector) { PromisePrototypeThen(evalInCurrentContext(input), (result) => returnToCallback(null, result), - returnToCallback + returnToCallback, ); } @@ -926,7 +926,7 @@ function createRepl(inspector) { Profile.createAndRegister({ profile }); print( 'Captured new CPU profile.\n' + - `Access it with profiles[${profiles.length - 1}]` + `Access it with profiles[${profiles.length - 1}]`, ); }); @@ -1010,7 +1010,7 @@ function createRepl(inspector) { takeHeapSnapshot(filename = 'node.heapsnapshot') { if (heapSnapshotPromise) { print( - 'Cannot take heap snapshot because another snapshot is in progress.' + 'Cannot take heap snapshot because another snapshot is in progress.', ); return heapSnapshotPromise; } diff --git a/lib/internal/dns/utils.js b/lib/internal/dns/utils.js index aacf4bc4dcd506..a258a41e4209ab 100644 --- a/lib/internal/dns/utils.js +++ b/lib/internal/dns/utils.js @@ -269,7 +269,7 @@ function emitInvalidHostnameWarning(hostname) { `The provided hostname "${hostname}" is not a valid ` + 'hostname, and is supported in the dns module solely for compatibility.', 'DeprecationWarning', - 'DEP0118' + 'DEP0118', ); invalidHostnameWarningEmitted = true; } diff --git a/lib/internal/errors.js b/lib/internal/errors.js index c0e1f3bf5ee006..4f833741cf999f 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -445,7 +445,7 @@ function getMessage(key, args, self) { assert( msg.length <= args.length, // Default options do not count. `Code: ${key}; The provided arguments length (${args.length}) does not ` + - `match the required ones (${msg.length}).` + `match the required ones (${msg.length}).`, ); return ReflectApply(msg, self, args); } @@ -456,7 +456,7 @@ function getMessage(key, args, self) { assert( expectedLength === args.length, `Code: ${key}; The provided arguments length (${args.length}) does not ` + - `match the required ones (${expectedLength}).` + `match the required ones (${expectedLength}).`, ); if (args.length === 0) return msg; @@ -833,7 +833,7 @@ function hideInternalStackFrames(error) { frames = ArrayPrototypeFilter( stackFrames, (frm) => !StringPrototypeStartsWith(frm.getFileName() || '', - 'node:internal') + 'node:internal'), ); } ArrayPrototypeUnshift(frames, error); @@ -1395,7 +1395,7 @@ E( '"%s" did not call the next hook in its chain and did not' + ' explicitly signal a short circuit. If this is intentional, include' + ' `shortCircuit: true` in the hook\'s return.', - Error + Error, ); E('ERR_MANIFEST_ASSERT_INTEGRITY', (moduleURL, realIntegrities) => { @@ -1406,7 +1406,7 @@ E('ERR_MANIFEST_ASSERT_INTEGRITY', const sri = ArrayPrototypeJoin( ArrayFrom(realIntegrities.entries(), ({ 0: alg, 1: dgs }) => `${alg}-${dgs}`), - ' ' + ' ', ); msg += ` Integrities found are: ${sri}`; } else { @@ -1442,7 +1442,7 @@ E('ERR_MISSING_ARGS', args, (a) => (ArrayIsArray(a) ? ArrayPrototypeJoin(ArrayPrototypeMap(a, wrap), ' or ') : - wrap(a)) + wrap(a)), ); msg += `${formatList(args)} argument${len > 1 ? 's' : ''}`; return `${msg} must be specified`; diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js index 1d03a91cb782c7..5a7d3ce7dfdcfe 100644 --- a/lib/internal/event_target.js +++ b/lib/internal/event_target.js @@ -405,7 +405,7 @@ let weakListenersState = null; let objectToWeakListenerMap = null; function weakListeners() { weakListenersState ??= new SafeFinalizationRegistry( - (listener) => listener.remove() + (listener) => listener.remove(), ); objectToWeakListenerMap ??= new SafeWeakMap(); return { registry: weakListenersState, map: objectToWeakListenerMap }; diff --git a/lib/internal/freeze_intrinsics.js b/lib/internal/freeze_intrinsics.js index 7d030e42910e5a..0f486ce9061782 100644 --- a/lib/internal/freeze_intrinsics.js +++ b/lib/internal/freeze_intrinsics.js @@ -215,7 +215,7 @@ module.exports = function() { IteratorPrototype, // 27.1.2 IteratorPrototype // 27.1.3 AsyncIteratorPrototype ObjectGetPrototypeOf(ObjectGetPrototypeOf(ObjectGetPrototypeOf( - (async function*() {})() + (async function*() {})(), ))), PromisePrototype, // 27.2 @@ -324,7 +324,7 @@ module.exports = function() { ObjectGetPrototypeOf(ArrayIteratorPrototype), // 27.1.2 IteratorPrototype // 27.1.3 AsyncIteratorPrototype ObjectGetPrototypeOf(ObjectGetPrototypeOf(ObjectGetPrototypeOf( - (async function*() {})() + (async function*() {})(), ))), Promise, // 27.2 // 27.3 GeneratorFunction @@ -497,7 +497,7 @@ module.exports = function() { if (obj === this) { // eslint-disable-next-line no-restricted-syntax throw new TypeError( - `Cannot assign to read only property '${prop}' of object '${obj}'` + `Cannot assign to read only property '${prop}' of object '${obj}'`, ); } if (ObjectPrototypeHasOwnProperty(this, prop)) { diff --git a/lib/internal/fs/dir.js b/lib/internal/fs/dir.js index f2bf2485e11b1c..2d9dd4fc638f99 100644 --- a/lib/internal/fs/dir.js +++ b/lib/internal/fs/dir.js @@ -128,7 +128,7 @@ class Dir { this[kDirHandle].read( this[kDirOptions].encoding, this[kDirOptions].bufferSize, - req + req, ); } @@ -152,7 +152,7 @@ class Dir { this[kDirOptions].encoding, this[kDirOptions].bufferSize, undefined, - ctx + ctx, ); handleErrorFromBinding(ctx); @@ -256,7 +256,7 @@ function opendir(path, options, callback) { dirBinding.opendir( pathModule.toNamespacedPath(path), options.encoding, - req + req, ); } @@ -271,7 +271,7 @@ function opendirSync(path, options) { pathModule.toNamespacedPath(path), options.encoding, undefined, - ctx + ctx, ); handleErrorFromBinding(ctx); diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js index 6ba58f89527976..c61758d3bd3d5e 100644 --- a/lib/internal/fs/promises.js +++ b/lib/internal/fs/promises.js @@ -225,7 +225,7 @@ class FileHandle extends EventEmitterMixin(JSTransferable) { this[kFd] = -1; this[kClosePromise] = SafePromisePrototypeFinally( this[kHandle].close(), - () => { this[kClosePromise] = undefined; } + () => { this[kClosePromise] = undefined; }, ); } else { this[kClosePromise] = SafePromisePrototypeFinally( @@ -236,7 +236,7 @@ class FileHandle extends EventEmitterMixin(JSTransferable) { this[kClosePromise] = undefined; this[kCloseReject] = undefined; this[kCloseResolve] = undefined; - } + }, ); } @@ -347,7 +347,7 @@ class FileHandle extends EventEmitterMixin(JSTransferable) { PromisePrototypeThen( this[kHandle].close(), this[kCloseResolve], - this[kCloseReject] + this[kCloseReject], ); } } @@ -361,8 +361,8 @@ async function handleFdClose(fileOpPromise, closeFunc) { PromisePrototypeThen( closeFunc(), () => PromiseReject(opError), - (closeError) => PromiseReject(aggregateTwoErrors(closeError, opError)) - ) + (closeError) => PromiseReject(aggregateTwoErrors(closeError, opError)), + ), ); } @@ -421,7 +421,7 @@ async function writeFileHandle(filehandle, data, signal, encoding) { data = new Uint8Array( data.buffer, data.byteOffset + bytesWritten, - data.byteLength - bytesWritten + data.byteLength - bytesWritten, ); } while (remaining > 0); } diff --git a/lib/internal/fs/streams.js b/lib/internal/fs/streams.js index c5bc567a8409bf..dd027046092f74 100644 --- a/lib/internal/fs/streams.js +++ b/lib/internal/fs/streams.js @@ -204,7 +204,7 @@ function ReadStream(path, options) { throw new ERR_OUT_OF_RANGE( 'start', `<= "end" (here: ${this.end})`, - this.start + this.start, ); } } diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index f2b0cb6b94bb1b..d06f963f6cde8a 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -118,7 +118,7 @@ const kMinimumCopyMode = MathMin( kDefaultCopyMode, COPYFILE_EXCL, COPYFILE_FICLONE, - COPYFILE_FICLONE_FORCE + COPYFILE_FICLONE_FORCE, ); const kMaximumCopyMode = COPYFILE_EXCL | COPYFILE_FICLONE | @@ -370,7 +370,7 @@ const nullCheck = hideStackFrames((path, propName, throwError = true) => { const err = new ERR_INVALID_ARG_VALUE( propName, path, - 'must be a string or Uint8Array without null bytes' + 'must be a string or Uint8Array without null bytes', ); if (throwError) { throw err; @@ -541,7 +541,7 @@ function getStatsFromBinding(stats, offset = 0) { nsFromTimeSpecBigInt(stats[10 + offset], stats[11 + offset]), nsFromTimeSpecBigInt(stats[12 + offset], stats[13 + offset]), nsFromTimeSpecBigInt(stats[14 + offset], stats[15 + offset]), - nsFromTimeSpecBigInt(stats[16 + offset], stats[17 + offset]) + nsFromTimeSpecBigInt(stats[16 + offset], stats[17 + offset]), ); } return new Stats( @@ -552,7 +552,7 @@ function getStatsFromBinding(stats, offset = 0) { msFromTimeSpec(stats[10 + offset], stats[11 + offset]), msFromTimeSpec(stats[12 + offset], stats[13 + offset]), msFromTimeSpec(stats[14 + offset], stats[15 + offset]), - msFromTimeSpec(stats[16 + offset], stats[17 + offset]) + msFromTimeSpec(stats[16 + offset], stats[17 + offset]), ); } @@ -570,7 +570,7 @@ class StatFs { function getStatFsFromBinding(stats) { return new StatFs( - stats[0], stats[1], stats[2], stats[3], stats[4], stats[5], stats[6] + stats[0], stats[1], stats[2], stats[3], stats[4], stats[5], stats[6], ); } @@ -666,7 +666,7 @@ const validateOffsetLengthRead = hideStackFrames( throw new ERR_OUT_OF_RANGE('length', `<= ${bufferLength - offset}`, length); } - } + }, ); const validateOffsetLengthWrite = hideStackFrames( @@ -684,7 +684,7 @@ const validateOffsetLengthWrite = hideStackFrames( } validateInt32(length, 'length', 0); - } + }, ); const validatePath = hideStackFrames((path, propName = 'path') => { @@ -844,7 +844,7 @@ function emitRecursiveRmdirWarning() { 'In future versions of Node.js, fs.rmdir(path, { recursive: true }) ' + 'will be removed. Use fs.rm(path, { recursive: true }) instead', 'DeprecationWarning', - 'DEP0147' + 'DEP0147', ); recursiveRmdirWarned = true; } @@ -888,7 +888,7 @@ const validateStringAfterArrayBufferView = hideStackFrames((buffer, name) => { throw new ERR_INVALID_ARG_TYPE( name, ['string', 'Buffer', 'TypedArray', 'DataView'], - buffer + buffer, ); } }); diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index dec5b734a2490f..2ff8f3e0836b7a 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -119,7 +119,7 @@ function statusMessageWarn() { if (statusMessageWarned === false) { process.emitWarning( 'Status message is not supported by HTTP/2 (RFC7540 8.1.2.4)', - 'UnsupportedWarning' + 'UnsupportedWarning', ); statusMessageWarned = true; } @@ -136,7 +136,7 @@ function connectionHeaderMessageWarn() { 'The provided connection header is not valid, ' + 'the value will be dropped from the header and ' + 'will never be in use.', - 'UnsupportedWarning' + 'UnsupportedWarning', ); statusConnectionHeaderWarned = true; } diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 48b73ae54ce9f6..bd179a6ff0a90e 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -537,7 +537,7 @@ function onStreamClose(code) { debugStreamObj( stream, 'closed with code %d, closed %s, readable %s', - code, stream.closed, stream.readable + code, stream.closed, stream.readable, ); if (!stream.closed) @@ -2125,7 +2125,7 @@ class Http2Stream extends Duplex { this.once( 'ready', FunctionPrototypeBind(this[kWriteGeneric], - this, writev, data, encoding, cb) + this, writev, data, encoding, cb), ); return; } @@ -3098,7 +3098,7 @@ function initializeOptions(options) { if (options.maxSessionRejectedStreams !== undefined) { validateUint32( options.maxSessionRejectedStreams, - 'maxSessionRejectedStreams' + 'maxSessionRejectedStreams', ); } @@ -3235,7 +3235,7 @@ function setupCompat(ev) { this.on('stream', FunctionPrototypeBind(onServerStream, this, this[kOptions].Http2ServerRequest, - this[kOptions].Http2ServerResponse) + this[kOptions].Http2ServerResponse), ); } } @@ -3395,7 +3395,7 @@ binding.setCallbackFunctions( onAltSvc, onOrigin, onStreamTrailers, - onStreamClose + onStreamClose, ); // Exports diff --git a/lib/internal/http2/util.js b/lib/internal/http2/util.js index 54f9f032a0ff50..850c8f74019048 100644 --- a/lib/internal/http2/util.js +++ b/lib/internal/http2/util.js @@ -376,7 +376,7 @@ function updateSettingsBuffer(settings) { if (settings.maxHeaderSize !== undefined && (settings.maxHeaderSize !== settings.maxHeaderListSize)) { process.emitWarning( - 'settings.maxHeaderSize overwrite settings.maxHeaderListSize' + 'settings.maxHeaderSize overwrite settings.maxHeaderListSize', ); settingsBuffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE] = settings.maxHeaderSize; @@ -583,7 +583,7 @@ const assertWithinRange = hideStackFrames( throw new ERR_HTTP2_INVALID_SETTING_VALUE.RangeError( name, value, min, max); } - } + }, ); function toHeaderObject(headers, sensitiveHeaders) { diff --git a/lib/internal/js_stream_socket.js b/lib/internal/js_stream_socket.js index f1efa1f807cb9a..8bc19296620b3f 100644 --- a/lib/internal/js_stream_socket.js +++ b/lib/internal/js_stream_socket.js @@ -13,7 +13,7 @@ let debug = require('internal/util/debuglog').debuglog( 'stream_socket', (fn) => { debug = fn; - } + }, ); const { owner_symbol } = require('internal/async_hooks').symbols; const { ERR_STREAM_WRAP } = require('internal/errors').codes; diff --git a/lib/internal/main/mksnapshot.js b/lib/internal/main/mksnapshot.js index 6607d34138b910..928b3fd13f91d4 100644 --- a/lib/internal/main/mksnapshot.js +++ b/lib/internal/main/mksnapshot.js @@ -99,7 +99,7 @@ function requireForUserSnapshot(id) { if (!BuiltinModule.canBeRequiredByUsers(id)) { // eslint-disable-next-line no-restricted-syntax const err = new Error( - `Cannot find module '${id}'. ` + `Cannot find module '${id}'. `, ); err.code = 'MODULE_NOT_FOUND'; throw err; diff --git a/lib/internal/main/print_help.js b/lib/internal/main/print_help.js index 9a9fbc2d2bd195..4f07aedf1b6e82 100644 --- a/lib/internal/main/print_help.js +++ b/lib/internal/main/print_help.js @@ -91,7 +91,7 @@ function fold(text, width) { return RegExpPrototypeSymbolReplace( new RegExp(`([^\n]{0,${width}})( |$)`, 'g'), text, - (_, newLine, end) => newLine + (end === ' ' ? '\n' : '') + (_, newLine, end) => newLine + (end === ' ' ? '\n' : ''), ); } @@ -115,7 +115,7 @@ function getArgDescription(type) { } function format( - { options, aliases = new SafeMap(), firstColumn, secondColumn } + { options, aliases = new SafeMap(), firstColumn, secondColumn }, ) { let text = ''; let maxFirstColumnUsed = 0; diff --git a/lib/internal/main/worker_thread.js b/lib/internal/main/worker_thread.js index 9ae04e288fc70c..08adb0b425bb3b 100644 --- a/lib/internal/main/worker_thread.js +++ b/lib/internal/main/worker_thread.js @@ -167,7 +167,7 @@ port.on('message', (message) => { } else { assert( message.type === STDIO_WANTS_MORE_DATA, - `Unknown worker message type ${message.type}` + `Unknown worker message type ${message.type}`, ); const { stream } = message; process[stream][kStdioWantsMoreDataCallback](); diff --git a/lib/internal/mime.js b/lib/internal/mime.js index 8e9dade422262e..4dbfcb3d9b0715 100644 --- a/lib/internal/mime.js +++ b/lib/internal/mime.js @@ -194,21 +194,21 @@ class MIMEParams { const paramsMap = params.#data; const endOfSource = SafeStringPrototypeSearch( StringPrototypeSlice(str, position), - START_ENDING_WHITESPACE + START_ENDING_WHITESPACE, ) + position; while (position < endOfSource) { // Skip any whitespace before parameter position += SafeStringPrototypeSearch( StringPrototypeSlice(str, position), - END_BEGINNING_WHITESPACE + END_BEGINNING_WHITESPACE, ); // Read until ';' or '=' const afterParameterName = SafeStringPrototypeSearch( StringPrototypeSlice(str, position), - EQUALS_SEMICOLON_OR_END + EQUALS_SEMICOLON_OR_END, ) + position; const parameterString = toASCIILower( - StringPrototypeSlice(str, position, afterParameterName) + StringPrototypeSlice(str, position, afterParameterName), ); position = afterParameterName; // If we found a terminating character @@ -258,7 +258,7 @@ class MIMEParams { const trimmedValue = StringPrototypeSlice( rawValue, 0, - SafeStringPrototypeSearch(rawValue, START_ENDING_WHITESPACE) + SafeStringPrototypeSearch(rawValue, START_ENDING_WHITESPACE), ); // Ignore parameters without values if (trimmedValue === '') continue; diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index a859911522bf8d..6f17012f297bf1 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -114,12 +114,12 @@ const { const packageJsonReader = require('internal/modules/package_json_reader'); const { getOptionValue, getEmbedderOptions } = require('internal/options'); const policy = getLazy( - () => (getOptionValue('--experimental-policy') ? require('internal/process/policy') : null) + () => (getOptionValue('--experimental-policy') ? require('internal/process/policy') : null), ); const shouldReportRequiredModules = getLazy(() => process.env.WATCH_REPORT_DEPENDENCIES); const getCascadedLoader = getLazy( - () => require('internal/process/esm_loader').esmLoader + () => require('internal/process/esm_loader').esmLoader, ); // Whether any user-provided CJS modules had been loaded (executed). @@ -318,13 +318,13 @@ function initializeCJS() { getModuleParent, 'module.parent is deprecated due to accuracy issues. Please use ' + 'require.main to find program entry point instead.', - 'DEP0144' + 'DEP0144', ) : getModuleParent, set: pendingDeprecation ? deprecate( setModuleParent, 'module.parent is deprecated due to accuracy issues. Please use ' + 'require.main to find program entry point instead.', - 'DEP0144' + 'DEP0144', ) : setModuleParent, }); Module._debug = deprecate(debug, 'Module._debug is deprecated.', 'DEP0077'); @@ -337,7 +337,7 @@ function initializeCJS() { } const allBuiltins = new SafeSet( - ArrayPrototypeFlatMap(builtinModules, (bm) => [bm, `node:${bm}`]) + ArrayPrototypeFlatMap(builtinModules, (bm) => [bm, `node:${bm}`]), ); BuiltinModule.getSchemeOnlyModuleNames().forEach((builtin) => allBuiltins.add(`node:${builtin}`)); ObjectFreeze(builtinModules); @@ -447,7 +447,7 @@ function tryPackage(requestPath, exts, isMain, originalPath) { // eslint-disable-next-line no-restricted-syntax const err = new Error( `Cannot find module '${filename}'. ` + - 'Please verify that the package.json has a valid "main" entry' + 'Please verify that the package.json has a valid "main" entry', ); err.code = 'MODULE_NOT_FOUND'; err.path = path.resolve(requestPath, 'package.json'); @@ -460,7 +460,7 @@ function tryPackage(requestPath, exts, isMain, originalPath) { `Invalid 'main' field in '${jsonPath}' of '${pkg}'. ` + 'Please either fix that or report it to the module author', 'DeprecationWarning', - 'DEP0128' + 'DEP0128', ); } } @@ -741,7 +741,7 @@ if (isWindows) { if (p !== nmLen) ArrayPrototypePush( paths, - StringPrototypeSlice(from, 0, last) + '\\node_modules' + StringPrototypeSlice(from, 0, last) + '\\node_modules', ); last = i; p = 0; @@ -776,7 +776,7 @@ if (isWindows) { if (p !== nmLen) ArrayPrototypePush( paths, - StringPrototypeSlice(from, 0, last) + '/node_modules' + StringPrototypeSlice(from, 0, last) + '/node_modules', ); last = i; p = 0; @@ -847,7 +847,7 @@ Module._resolveLookupPaths = function(request, parent) { function emitCircularRequireWarning(prop) { process.emitWarning( `Accessing non-existent property '${String(prop)}' of module exports ` + - 'inside circular dependency' + 'inside circular dependency', ); } @@ -1422,7 +1422,7 @@ Module._initPaths = function() { if (nodePath) { ArrayPrototypeUnshiftApply(paths, ArrayPrototypeFilter( StringPrototypeSplit(nodePath, path.delimiter), - Boolean + Boolean, )); } diff --git a/lib/internal/modules/esm/fetch_module.js b/lib/internal/modules/esm/fetch_module.js index 073ec13562097c..d79e5a5eb99e84 100644 --- a/lib/internal/modules/esm/fetch_module.js +++ b/lib/internal/modules/esm/fetch_module.js @@ -136,7 +136,7 @@ function fetchWithRedirects(parsed) { throw new ERR_NETWORK_IMPORT_DISALLOWED( res.headers.location, parsed.href, - 'cannot redirect to non-network location' + 'cannot redirect to non-network location', ); } const entry = await fetchWithRedirects(location); @@ -161,7 +161,7 @@ function fetchWithRedirects(parsed) { if (!contentType) { throw new ERR_NETWORK_IMPORT_BAD_RESPONSE( parsed.href, - "the 'Content-Type' header is required" + "the 'Content-Type' header is required", ); } /** @@ -252,7 +252,7 @@ function fetchModule(parsed, { parentURL }) { throw new ERR_NETWORK_IMPORT_DISALLOWED( href, parentURL, - 'http can only be used to load local resources (use https instead).' + 'http can only be used to load local resources (use https instead).', ); } return fetchWithRedirects(parsed); diff --git a/lib/internal/modules/esm/formats.js b/lib/internal/modules/esm/formats.js index 9853dc160d3566..63742914597c46 100644 --- a/lib/internal/modules/esm/formats.js +++ b/lib/internal/modules/esm/formats.js @@ -27,7 +27,7 @@ function mimeToFormat(mime) { if ( RegExpPrototypeExec( /\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i, - mime + mime, ) !== null ) return 'module'; if (mime === 'application/json') return 'json'; diff --git a/lib/internal/modules/esm/get_format.js b/lib/internal/modules/esm/get_format.js index 640d240acd4ca1..a9653d43173c05 100644 --- a/lib/internal/modules/esm/get_format.js +++ b/lib/internal/modules/esm/get_format.js @@ -86,7 +86,7 @@ function getHttpProtocolModuleFormat(url, context) { PromiseResolve(fetchModule(url, context)), (entry) => { return mimeToFormat(entry.headers['content-type']); - } + }, ); } } diff --git a/lib/internal/modules/esm/initialize_import_meta.js b/lib/internal/modules/esm/initialize_import_meta.js index d6be06f23e1493..147eb0aa403784 100644 --- a/lib/internal/modules/esm/initialize_import_meta.js +++ b/lib/internal/modules/esm/initialize_import_meta.js @@ -16,7 +16,7 @@ function createImportMetaResolve(defaultParentUrl) { ({ url }) => url, (error) => ( error.code === 'ERR_UNSUPPORTED_DIR_IMPORT' ? - error.url : PromiseReject(error)) + error.url : PromiseReject(error)), ); }; } diff --git a/lib/internal/modules/esm/loader.js b/lib/internal/modules/esm/loader.js index a02619818ec78b..fa808ccb7d5477 100644 --- a/lib/internal/modules/esm/loader.js +++ b/lib/internal/modules/esm/loader.js @@ -139,7 +139,7 @@ function nextHookFactory(chain, meta, { validateArgs, validateOutput }) { // eslint-disable-next-line func-name-matching nextNextHook = function chainAdvancedTooFar() { throw new ERR_INTERNAL_ASSERTION( - `ESM custom loader '${hookName}' advanced beyond the end of the chain.` + `ESM custom loader '${hookName}' advanced beyond the end of the chain.`, ); }; } @@ -267,12 +267,12 @@ class ESMLoader { globalPreload ??= getGlobalPreloadCode; process.emitWarning( - 'Loader hook "getGlobalPreloadCode" has been renamed to "globalPreload"' + 'Loader hook "getGlobalPreloadCode" has been renamed to "globalPreload"', ); } if (dynamicInstantiate) ArrayPrototypePush( obsoleteHooks, - 'dynamicInstantiate' + 'dynamicInstantiate', ); if (getFormat) ArrayPrototypePush( obsoleteHooks, @@ -360,7 +360,7 @@ class ESMLoader { async eval( source, - url = pathToFileURL(`${process.cwd()}/[eval${++this.evalIndex}]`).href + url = pathToFileURL(`${process.cwd()}/[eval${++this.evalIndex}]`).href, ) { const evalInstance = (url) => { const { ModuleWrap } = internalBinding('module_wrap'); @@ -475,7 +475,7 @@ class ESMLoader { importAssertions, moduleProvider, parentURL === undefined, - inspectBrk + inspectBrk, ); this.moduleMap.set(url, importAssertions.type, job); @@ -663,7 +663,7 @@ class ESMLoader { 'a string, an ArrayBuffer, or a TypedArray', hookErrIdentifier, 'source', - source + source, ); } @@ -713,7 +713,7 @@ class ESMLoader { ['getBuiltin', 'port', 'setImportMetaCallback'], { filename: '', - } + }, ); const { BuiltinModule } = require('internal/bootstrap/loaders'); // We only allow replacing the importMetaInitializer during preload, diff --git a/lib/internal/modules/esm/module_job.js b/lib/internal/modules/esm/module_job.js index eeafd086073ebb..2a0208dfc5cf8f 100644 --- a/lib/internal/modules/esm/module_job.js +++ b/lib/internal/modules/esm/module_job.js @@ -42,7 +42,7 @@ const CJSGlobalLike = [ const isCommonJSGlobalLikeNotDefinedError = (errorMessage) => ArrayPrototypeSome( CJSGlobalLike, - (globalLike) => errorMessage === `${globalLike} is not defined` + (globalLike) => errorMessage === `${globalLike} is not defined`, ); /* A ModuleJob tracks the loading of a single Module, and the ModuleJobs of @@ -135,7 +135,7 @@ class ModuleJob { const parentFileUrl = RegExpPrototypeSymbolReplace( /:\d+$/, splitStack[0], - '' + '', ); const { 1: childSpecifier, 2: name } = RegExpPrototypeExec( /module '(.*)' does not provide an export named '(.+)'/, diff --git a/lib/internal/modules/esm/package_config.js b/lib/internal/modules/esm/package_config.js index a3fe2228e03c29..dc3c37f6042333 100644 --- a/lib/internal/modules/esm/package_config.js +++ b/lib/internal/modules/esm/package_config.js @@ -64,7 +64,7 @@ function getPackageConfig(path, specifier, base) { throw new ERR_INVALID_PACKAGE_CONFIG( path, (base ? `"${specifier}" from ` : '') + fileURLToPath(base || specifier), - error.message + error.message, ); } diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js index edb74a0395d26b..194d2ba37bf3b2 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js @@ -78,7 +78,7 @@ function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { base ? ` imported from ${fileURLToPath(base)}` : ''}. Mapping specifiers ending in "/" is no longer supported.`, 'DeprecationWarning', - 'DEP0155' + 'DEP0155', ); } @@ -94,7 +94,7 @@ function emitInvalidSegmentDeprecation(target, request, match, pjsonUrl, interna }in the "${internal ? 'imports' : 'exports'}" field module resolution of the package at ${ pjsonPath}${base ? ` imported from ${fileURLToPath(base)}` : ''}.`, 'DeprecationWarning', - 'DEP0166' + 'DEP0166', ); } @@ -120,7 +120,7 @@ function emitLegacyIndexDeprecation(url, packageJSONUrl, base, main) { basePath}.\n Automatic extension resolution of the "main" field is ` + 'deprecated for ES modules.', 'DeprecationWarning', - 'DEP0151' + 'DEP0151', ); else process.emitWarning( @@ -129,7 +129,7 @@ function emitLegacyIndexDeprecation(url, packageJSONUrl, base, main) { StringPrototypeSlice(path, pkgPath.length)}", imported from ${basePath }.\nDefault "index" lookups for the main are deprecated for ES modules.`, 'DeprecationWarning', - 'DEP0151' + 'DEP0151', ); } @@ -391,7 +391,7 @@ function resolvePackageTargetString( if (pattern) { return new URL( - RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) + RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath), ); } @@ -539,7 +539,7 @@ function packageExportsResolve( const target = exports[packageSubpath]; const resolveResult = resolvePackageTarget( packageJSONUrl, target, '', packageSubpath, base, false, false, false, - conditions + conditions, ); if (resolveResult == null) { @@ -638,7 +638,7 @@ function packageImportsResolve(name, base, conditions) { !StringPrototypeIncludes(name, '*')) { const resolveResult = resolvePackageTarget( packageJSONUrl, imports[name], '', name, base, false, true, false, - conditions + conditions, ); if (resolveResult != null) { return resolveResult; @@ -781,7 +781,7 @@ function packageResolve(specifier, base, conditions) { return legacyMainResolve( packageJSONUrl, packageConfig, - base + base, ); } @@ -913,7 +913,7 @@ function checkIfDisallowedImport(specifier, parsed, parsedParentURL) { throw new ERR_NETWORK_IMPORT_DISALLOWED( specifier, parsedParentURL, - 'remote imports cannot import from a local location.' + 'remote imports cannot import from a local location.', ); } @@ -924,14 +924,14 @@ function checkIfDisallowedImport(specifier, parsed, parsedParentURL) { throw new ERR_NETWORK_IMPORT_DISALLOWED( specifier, parsedParentURL, - 'remote imports cannot import from a local location.' + 'remote imports cannot import from a local location.', ); } throw new ERR_NETWORK_IMPORT_DISALLOWED( specifier, parsedParentURL, - 'only relative and absolute specifiers are supported.' + 'only relative and absolute specifiers are supported.', ); } } @@ -986,7 +986,7 @@ async function defaultResolve(specifier, context = {}) { reaction(new ERR_MANIFEST_DEPENDENCY_MISSING( parentURL, specifier, - ArrayPrototypeJoin([...conditions], ', ')) + ArrayPrototypeJoin([...conditions], ', ')), ); } } @@ -1059,7 +1059,7 @@ async function defaultResolve(specifier, context = {}) { specifier, parentURL, conditions, - isMain ? preserveSymlinksMain : preserveSymlinks + isMain ? preserveSymlinksMain : preserveSymlinks, ); } catch (error) { // Try to give the user a hint of what would have been the @@ -1113,7 +1113,7 @@ if (policy) { const $defaultResolve = defaultResolve; module.exports.defaultResolve = async function defaultResolve( specifier, - context + context, ) { const ret = await $defaultResolve(specifier, context); // This is a preflight check to avoid data exfiltration by query params etc. @@ -1121,8 +1121,8 @@ if (policy) { new ERR_MANIFEST_DEPENDENCY_MISSING( context.parentURL, specifier, - context.conditions - ) + context.conditions, + ), ); return ret; }; diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js index b21c3c18cf7383..1f5c537623c080 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js @@ -84,7 +84,7 @@ function assertBufferSource(body, allowString, hookName) { `${allowString ? 'string, ' : ''}array buffer, or typed array`, hookName, 'source', - body + body, ); } @@ -136,7 +136,7 @@ function enrichCJSError(err, content, filename) { // asynchronous warning would be emitted. emitWarningSync( 'To load an ES module, set "type": "module" in the package.json or use ' + - 'the .mjs extension.' + 'the .mjs extension.', ); } } diff --git a/lib/internal/modules/helpers.js b/lib/internal/modules/helpers.js index 3cda1b0cec1de8..cbfc6af663ef70 100644 --- a/lib/internal/modules/helpers.js +++ b/lib/internal/modules/helpers.js @@ -108,7 +108,7 @@ function makeRequireFunction(mod, redirects) { reaction(new ERR_MANIFEST_DEPENDENCY_MISSING( id, specifier, - ArrayPrototypeJoin([...conditions], ', ') + ArrayPrototypeJoin([...conditions], ', '), )); } return mod[require_private_symbol](mod, specifier); diff --git a/lib/internal/modules/package_json_reader.js b/lib/internal/modules/package_json_reader.js index 09eb12bd1533bf..bb175d0df54c04 100644 --- a/lib/internal/modules/package_json_reader.js +++ b/lib/internal/modules/package_json_reader.js @@ -19,7 +19,7 @@ function read(jsonPath) { } const { 0: string, 1: containsKeys } = internalModuleReadJSON( - toNamespacedPath(jsonPath) + toNamespacedPath(jsonPath), ); const result = { string, containsKeys }; const { getOptionValue } = require('internal/options'); diff --git a/lib/internal/per_context/primordials.js b/lib/internal/per_context/primordials.js index d7ca58d0469c07..047398465ec0cd 100644 --- a/lib/internal/per_context/primordials.js +++ b/lib/internal/per_context/primordials.js @@ -330,11 +330,11 @@ const createSafeIterator = (factory, next) => { primordials.SafeArrayIterator = createSafeIterator( primordials.ArrayPrototypeSymbolIterator, - primordials.ArrayIteratorPrototypeNext + primordials.ArrayIteratorPrototypeNext, ); primordials.SafeStringIterator = createSafeIterator( primordials.StringPrototypeSymbolIterator, - primordials.StringIteratorPrototypeNext + primordials.StringIteratorPrototypeNext, ); const copyProps = (src, dest) => { @@ -394,26 +394,26 @@ primordials.SafeMap = makeSafe( Map, class SafeMap extends Map { constructor(i) { super(i); } // eslint-disable-line no-useless-constructor - } + }, ); primordials.SafeWeakMap = makeSafe( WeakMap, class SafeWeakMap extends WeakMap { constructor(i) { super(i); } // eslint-disable-line no-useless-constructor - } + }, ); primordials.SafeSet = makeSafe( Set, class SafeSet extends Set { constructor(i) { super(i); } // eslint-disable-line no-useless-constructor - } + }, ); primordials.SafeWeakSet = makeSafe( WeakSet, class SafeWeakSet extends WeakSet { constructor(i) { super(i); } // eslint-disable-line no-useless-constructor - } + }, ); primordials.SafeFinalizationRegistry = makeSafe( @@ -421,14 +421,14 @@ primordials.SafeFinalizationRegistry = makeSafe( class SafeFinalizationRegistry extends FinalizationRegistry { // eslint-disable-next-line no-useless-constructor constructor(cleanupCallback) { super(cleanupCallback); } - } + }, ); primordials.SafeWeakRef = makeSafe( WeakRef, class SafeWeakRef extends WeakRef { // eslint-disable-next-line no-useless-constructor constructor(target) { super(target); } - } + }, ); const SafePromise = makeSafe( @@ -436,7 +436,7 @@ const SafePromise = makeSafe( class SafePromise extends Promise { // eslint-disable-next-line no-useless-constructor constructor(executor) { super(executor); } - } + }, ); /** @@ -454,7 +454,7 @@ primordials.SafePromisePrototypeFinally = (thisPromise, onFinally) => new Promise((a, b) => new SafePromise((a, b) => PromisePrototypeThen(thisPromise, a, b)) .finally(onFinally) - .then(a, b) + .then(a, b), ); primordials.AsyncIteratorPrototype = @@ -467,8 +467,8 @@ const arrayToSafePromiseIterable = (promises, mapFn) => ArrayPrototypeMap( promises, (promise, i) => - new SafePromise((a, b) => PromisePrototypeThen(mapFn == null ? promise : mapFn(promise, i), a, b)) - ) + new SafePromise((a, b) => PromisePrototypeThen(mapFn == null ? promise : mapFn(promise, i), a, b)), + ), ); /** @@ -481,7 +481,7 @@ primordials.SafePromiseAll = (promises, mapFn) => // Wrapping on a new Promise is necessary to not expose the SafePromise // prototype to user-land. new Promise((a, b) => - SafePromise.all(arrayToSafePromiseIterable(promises, mapFn)).then(a, b) + SafePromise.all(arrayToSafePromiseIterable(promises, mapFn)).then(a, b), ); /** @@ -541,7 +541,7 @@ primordials.SafePromiseAllSettled = (promises, mapFn) => // Wrapping on a new Promise is necessary to not expose the SafePromise // prototype to user-land. new Promise((a, b) => - SafePromise.allSettled(arrayToSafePromiseIterable(promises, mapFn)).then(a, b) + SafePromise.allSettled(arrayToSafePromiseIterable(promises, mapFn)).then(a, b), ); /** @@ -572,7 +572,7 @@ primordials.SafePromiseAny = (promises, mapFn) => // Wrapping on a new Promise is necessary to not expose the SafePromise // prototype to user-land. new Promise((a, b) => - SafePromise.any(arrayToSafePromiseIterable(promises, mapFn)).then(a, b) + SafePromise.any(arrayToSafePromiseIterable(promises, mapFn)).then(a, b), ); /** @@ -585,7 +585,7 @@ primordials.SafePromiseRace = (promises, mapFn) => // Wrapping on a new Promise is necessary to not expose the SafePromise // prototype to user-land. new Promise((a, b) => - SafePromise.race(arrayToSafePromiseIterable(promises, mapFn)).then(a, b) + SafePromise.race(arrayToSafePromiseIterable(promises, mapFn)).then(a, b), ); diff --git a/lib/internal/perf/event_loop_utilization.js b/lib/internal/perf/event_loop_utilization.js index 583bb72745fe88..d10f06b3e55bf5 100644 --- a/lib/internal/perf/event_loop_utilization.js +++ b/lib/internal/perf/event_loop_utilization.js @@ -15,7 +15,7 @@ function eventLoopUtilization(util1, util2) { milestones[NODE_PERFORMANCE_MILESTONE_LOOP_START] / 1e6, loopIdleTime(), util1, - util2 + util2, ); } diff --git a/lib/internal/perf/observe.js b/lib/internal/perf/observe.js index 9aab2dfbc13ed3..2529079fdc85d5 100644 --- a/lib/internal/perf/observe.js +++ b/lib/internal/perf/observe.js @@ -453,7 +453,7 @@ function bufferResourceTiming(entry) { // Calculate the number of items to be pushed to the global buffer. const numbersToPreserve = MathMax( MathMin(resourceTimingBufferSizeLimit - resourceTimingBuffer.length, resourceTimingSecondaryBuffer.length), - 0 + 0, ); const excessNumberAfter = resourceTimingSecondaryBuffer.length - numbersToPreserve; for (let idx = 0; idx < numbersToPreserve; idx++) { diff --git a/lib/internal/policy/manifest.js b/lib/internal/policy/manifest.js index 4e383c8b12e3ec..a65da87a255187 100644 --- a/lib/internal/policy/manifest.js +++ b/lib/internal/policy/manifest.js @@ -37,7 +37,7 @@ const BufferToString = uncurryThis(Buffer.prototype.toString); const kRelativeURLStringPattern = /^\.{0,2}\//; const { getOptionValue } = require('internal/options'); const shouldAbortOnUncaughtException = getOptionValue( - '--abort-on-uncaught-exception' + '--abort-on-uncaught-exception', ); const { exitCodes: { kGenericUserError } } = internalBinding('errors'); @@ -139,7 +139,7 @@ class DependencyMapperInstance { if (!target) { throw new ERR_MANIFEST_INVALID_SPECIFIER( this.href, - `${target}, pattern needs to have a single trailing "*" in target` + `${target}, pattern needs to have a single trailing "*" in target`, ); } const prefix = target[1]; @@ -193,7 +193,7 @@ class DependencyMapperInstance { const to = searchDependencies( this.href, dependencies[normalizedSpecifier], - conditions + conditions, ); debug({ to }); if (to === true) { @@ -218,7 +218,7 @@ class DependencyMapperInstance { if (parentDependencyMapper === undefined) { parentDependencyMapper = manifest.getScopeDependencyMapper( this.href, - this.allowSameHREFScope + this.allowSameHREFScope, ); this.#parentDependencyMapper = parentDependencyMapper; } @@ -228,7 +228,7 @@ class DependencyMapperInstance { return parentDependencyMapper._resolveAlreadyNormalized( normalizedSpecifier, conditions, - manifest + manifest, ); } } @@ -237,13 +237,13 @@ const kArbitraryDependencies = new DependencyMapperInstance( 'arbitrary dependencies', kFallThrough, false, - true + true, ); const kNoDependencies = new DependencyMapperInstance( 'no dependencies', null, false, - true + true, ); /** * @param {string} href @@ -257,7 +257,7 @@ const insertDependencyMap = ( dependencies, cascade, allowSameHREFScope, - store + store, ) => { if (cascade !== undefined && typeof cascade !== 'boolean') { throw new ERR_MANIFEST_INVALID_RESOURCE_FIELD(href, 'cascade'); @@ -271,7 +271,7 @@ const insertDependencyMap = ( href, cascade ? new DependencyMapperInstance(href, null, true, allowSameHREFScope) : - kNoDependencies + kNoDependencies, ); return; } @@ -282,8 +282,8 @@ const insertDependencyMap = ( href, dependencies, cascade, - allowSameHREFScope - ) + allowSameHREFScope, + ), ); return; } @@ -442,7 +442,7 @@ class Manifest { this.#reaction = reaction; const jsonResourcesEntries = ObjectEntries( - obj.resources ?? { __proto__: null } + obj.resources ?? { __proto__: null }, ); const jsonScopesEntries = ObjectEntries(obj.scopes ?? { __proto__: null }); const defaultDependencies = obj.dependencies ?? { __proto__: null }; @@ -450,7 +450,7 @@ class Manifest { this.#defaultDependencies = new DependencyMapperInstance( 'default', defaultDependencies === true ? kFallThrough : defaultDependencies, - false + false, ); for (let i = 0; i < jsonResourcesEntries.length; i++) { @@ -475,7 +475,7 @@ class Manifest { dependencies, cascade, true, - resourceDependencies + resourceDependencies, ); } @@ -519,12 +519,12 @@ class Manifest { resolve: (specifier, conditions) => { const normalizedSpecifier = canonicalizeSpecifier( specifier, - requesterHREF + requesterHREF, ); const result = instance._resolveAlreadyNormalized( normalizedSpecifier, conditions, - this + this, ); if (result === kFallThrough) return true; return result; @@ -640,7 +640,7 @@ class Manifest { const scopeHREF = findScopeHREF( href, this.#scopeDependencies, - allowSameHREFScope + allowSameHREFScope, ); if (scopeHREF === null) return this.#defaultDependencies; return this.#scopeDependencies.get(scopeHREF); @@ -694,7 +694,7 @@ const emptyOrProtocolOrResolve = (resourceHREF, base) => { // eslint-disable-next-line /^[\x00-\x1F\x20]|\x09\x0A\x0D|[\x00-\x1F\x20]$/g, resourceHREF, - '' + '', ); if (RegExpPrototypeExec(/^[a-zA-Z][a-zA-Z+\-.]*:$/, resourceHREF) !== null) { return resourceHREF; diff --git a/lib/internal/process/esm_loader.js b/lib/internal/process/esm_loader.js index d040d8e068ecfa..75808335b90786 100644 --- a/lib/internal/process/esm_loader.js +++ b/lib/internal/process/esm_loader.js @@ -99,7 +99,7 @@ exports.loadESM = async function loadESM(callback) { } internalBinding('errors').triggerUncaughtException( err, - true /* fromPromise */ + true, /* fromPromise */ ); } }; diff --git a/lib/internal/process/per_thread.js b/lib/internal/process/per_thread.js index 6397738ac085b1..b042698930c9f3 100644 --- a/lib/internal/process/per_thread.js +++ b/lib/internal/process/per_thread.js @@ -387,7 +387,7 @@ function buildAllowedFlags() { forEach(callback, thisArg = undefined) { ArrayPrototypeForEach( this[kInternal].array, - (v) => ReflectApply(callback, thisArg, [v, v, this]) + (v) => ReflectApply(callback, thisArg, [v, v, this]), ); } @@ -415,7 +415,7 @@ function buildAllowedFlags() { ObjectFreeze(NodeEnvironmentFlagsSet.prototype); return ObjectFreeze(new NodeEnvironmentFlagsSet( - allowedNodeEnvironmentFlags + allowedNodeEnvironmentFlags, )); } diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js index 77584fb2351101..32f1dbb4d75e9f 100644 --- a/lib/internal/process/pre_execution.js +++ b/lib/internal/process/pre_execution.js @@ -280,11 +280,11 @@ function setupWebCrypto() { if (this !== globalThis && this != null) throw new ERR_INVALID_THIS( 'nullish or must be the global object'); - } + }, ); exposeLazyInterfaces( globalThis, 'internal/crypto/webcrypto', - ['Crypto', 'CryptoKey', 'SubtleCrypto'] + ['Crypto', 'CryptoKey', 'SubtleCrypto'], ); } else { ObjectDefineProperty(globalThis, 'crypto', diff --git a/lib/internal/process/promises.js b/lib/internal/process/promises.js index 8d92afd9c29464..ecc4afc4f56c8a 100644 --- a/lib/internal/process/promises.js +++ b/lib/internal/process/promises.js @@ -130,7 +130,7 @@ function promiseRejectHandler(type, promise, reason) { const multipleResolvesDeprecate = deprecate( () => {}, 'The multipleResolves event has been deprecated.', - 'DEP0160' + 'DEP0160', ); function resolveError(type, promise, reason) { // We have to wrap this in a next tick. Otherwise the error could be caught by @@ -193,7 +193,7 @@ function emitUnhandledRejectionWarning(uid, reason) { 'To terminate the node process on unhandled promise ' + 'rejection, use the CLI flag `--unhandled-rejections=strict` (see ' + 'https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). ' + - `(rejection id: ${uid})` + `(rejection id: ${uid})`, ); try { if (isErrorLike(reason)) { @@ -250,7 +250,7 @@ function processPromiseRejections() { pushAsyncContext( promiseAsyncId, promiseTriggerAsyncId, - promise + promise, ); } try { @@ -264,7 +264,7 @@ function processPromiseRejections() { pushAsyncContext( promise[kAsyncIdSymbol], promise[kTriggerAsyncIdSymbol], - promise + promise, ); } const handled = emit(reason, promise, promiseInfo); diff --git a/lib/internal/process/task_queues.js b/lib/internal/process/task_queues.js index 77372d1fd7ef32..51ebe8c111abf7 100644 --- a/lib/internal/process/task_queues.js +++ b/lib/internal/process/task_queues.js @@ -151,7 +151,7 @@ function queueMicrotask(callback) { const asyncResource = new AsyncResource( 'Microtask', - defaultMicrotaskResourceOpts + defaultMicrotaskResourceOpts, ); asyncResource.callback = callback; diff --git a/lib/internal/readline/interface.js b/lib/internal/readline/interface.js index 64a752f18c8d1a..9b8ff459fa3573 100644 --- a/lib/internal/readline/interface.js +++ b/lib/internal/readline/interface.js @@ -171,7 +171,7 @@ function InterfaceConstructor(input, output, completer, terminal) { } else { throw new ERR_INVALID_ARG_VALUE( 'input.escapeCodeTimeout', - this.escapeCodeTimeout + this.escapeCodeTimeout, ); } } @@ -633,7 +633,7 @@ class Interface extends InterfaceConstructor { const end = StringPrototypeSlice( this.line, this.cursor, - this.line.length + this.line.length, ); this.line = beg + c + end; this.cursor += c.length; @@ -676,7 +676,7 @@ class Interface extends InterfaceConstructor { // If there is a common prefix to all matches, then apply that portion. const prefix = commonPrefix( - ArrayPrototypeFilter(completions, (e) => e !== '') + ArrayPrototypeFilter(completions, (e) => e !== ''), ); if (StringPrototypeStartsWith(prefix, completeOn) && prefix.length > completeOn.length) { @@ -703,7 +703,7 @@ class Interface extends InterfaceConstructor { // Apply/show completions. const completionsWidth = ArrayPrototypeMap(completions, (e) => - getStringWidth(e) + getStringWidth(e), ); const width = MathMaxApply(completionsWidth) + 2; // 2 space padding let maxColumns = MathFloor(this.columns / width) || 1; @@ -744,7 +744,7 @@ class Interface extends InterfaceConstructor { const leading = StringPrototypeSlice(this.line, 0, this.cursor); const reversed = ArrayPrototypeJoin( ArrayPrototypeReverse(ArrayFrom(leading)), - '' + '', ); const match = RegExpPrototypeExec(/^\s*(?:[^\w\s]+|\w+)?/, reversed); this[kMoveCursor](-match[0].length); @@ -783,7 +783,7 @@ class Interface extends InterfaceConstructor { StringPrototypeSlice( this.line, this.cursor + charSize, - this.line.length + this.line.length, ); this[kRefreshLine](); } @@ -797,13 +797,13 @@ class Interface extends InterfaceConstructor { let leading = StringPrototypeSlice(this.line, 0, this.cursor); const reversed = ArrayPrototypeJoin( ArrayPrototypeReverse(ArrayFrom(leading)), - '' + '', ); const match = RegExpPrototypeExec(/^\s*(?:[^\w\s]+|\w+)?/, reversed); leading = StringPrototypeSlice( leading, 0, - leading.length - match[0].length + leading.length - match[0].length, ); this.line = leading + @@ -1081,7 +1081,7 @@ class Interface extends InterfaceConstructor { this[kSubstringSearch] = StringPrototypeSlice( this.line, 0, - this.cursor + this.cursor, ); } } else if (this[kSubstringSearch] !== null) { diff --git a/lib/internal/readline/utils.js b/lib/internal/readline/utils.js index 83609b71fb5974..1758e17be16b84 100644 --- a/lib/internal/readline/utils.js +++ b/lib/internal/readline/utils.js @@ -336,7 +336,7 @@ function* emitKeys(stream) { } else if (!escaped && ch <= '\x1a') { // ctrl+letter key.name = StringFromCharCode( - StringPrototypeCharCodeAt(ch) + StringPrototypeCharCodeAt('a') - 1 + StringPrototypeCharCodeAt(ch) + StringPrototypeCharCodeAt('a') - 1, ); key.ctrl = true; } else if (RegExpPrototypeExec(/^[0-9A-Za-z]$/, ch) !== null) { diff --git a/lib/internal/repl/await.js b/lib/internal/repl/await.js index c53ffce581e37b..ed24de2d48eb46 100644 --- a/lib/internal/repl/await.js +++ b/lib/internal/repl/await.js @@ -33,7 +33,7 @@ const visitorsWithoutAncestors = { state.prepend(node, `${node.id.name}=`); ArrayPrototypePush( state.hoistedDeclarationStatements, - `let ${node.id.name}; ` + `let ${node.id.name}; `, ); } @@ -49,7 +49,7 @@ const visitorsWithoutAncestors = { state.prepend(node, `this.${node.id.name} = ${node.id.name}; `); ArrayPrototypePush( state.hoistedDeclarationStatements, - `var ${node.id.name}; ` + `var ${node.id.name}; `, ); }, FunctionExpression: noop, @@ -67,7 +67,7 @@ const visitorsWithoutAncestors = { const variableKind = node.kind; const isIterableForDeclaration = ArrayPrototypeIncludes( ['ForOfStatement', 'ForInStatement'], - state.ancestors[state.ancestors.length - 2].type + state.ancestors[state.ancestors.length - 2].type, ); if (variableKind === 'var' || isTopLevelDeclaration(state)) { @@ -76,7 +76,7 @@ const visitorsWithoutAncestors = { node.start + variableKind.length + (isIterableForDeclaration ? 1 : 0), variableKind === 'var' && isIterableForDeclaration ? '' : - 'void' + (node.declarations.length === 1 ? '' : ' (') + 'void' + (node.declarations.length === 1 ? '' : ' ('), ); if (!isIterableForDeclaration) { @@ -99,7 +99,7 @@ const visitorsWithoutAncestors = { case 'Identifier': ArrayPrototypePush( variableIdentifiersToHoist[variableKind === 'var' ? 0 : 1][1], - node.name + node.name, ); break; case 'ObjectPattern': @@ -125,10 +125,10 @@ const visitorsWithoutAncestors = { if (identifiers.length > 0) { ArrayPrototypePush( state.hoistedDeclarationStatements, - `${kind} ${ArrayPrototypeJoin(identifiers, ', ')}; ` + `${kind} ${ArrayPrototypeJoin(identifiers, ', ')}; `, ); } - } + }, ); } diff --git a/lib/internal/repl/history.js b/lib/internal/repl/history.js index 9300283e0015cc..d580c258a4271a 100644 --- a/lib/internal/repl/history.js +++ b/lib/internal/repl/history.js @@ -167,7 +167,7 @@ function _replHistoryMessage() { this, '\nPersistent history support disabled. ' + 'Set the NODE_REPL_HISTORY environment\nvariable to ' + - 'a valid, user-writable path to enable.\n' + 'a valid, user-writable path to enable.\n', ); } this._historyPrev = Interface.prototype._historyPrev; diff --git a/lib/internal/repl/utils.js b/lib/internal/repl/utils.js index 9e55b79fc7e86c..8405e6758fc7b7 100644 --- a/lib/internal/repl/utils.js +++ b/lib/internal/repl/utils.js @@ -123,7 +123,7 @@ function isRecoverableError(e, code) { super.raise(pos, message); } }; - } + }, ); // Try to parse the code with acorn. If the parse fails, ignore the acorn @@ -291,7 +291,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) { (e) => StringPrototypeReplaceAll( StringPrototypeToLowerCase(e), '_', - '-' + '-', )), '--use-strict'); } diff --git a/lib/internal/source_map/prepare_stack_trace.js b/lib/internal/source_map/prepare_stack_trace.js index 2052651765265a..860564f4a34ab5 100644 --- a/lib/internal/source_map/prepare_stack_trace.js +++ b/lib/internal/source_map/prepare_stack_trace.js @@ -115,7 +115,7 @@ function getOriginalSymbolName(sourceMap, trace, curIndex) { // First check for a symbol name associated with the enclosing function: const enclosingEntry = sourceMap.findEntry( trace[curIndex].getEnclosingLineNumber() - 1, - trace[curIndex].getEnclosingColumnNumber() - 1 + trace[curIndex].getEnclosingColumnNumber() - 1, ); if (enclosingEntry.name) return enclosingEntry.name; // Fallback to using the symbol name attached to the next stack frame: @@ -124,7 +124,7 @@ function getOriginalSymbolName(sourceMap, trace, curIndex) { if (nextCallSite && currentFileName === nextCallSite.getFileName()) { const { name } = sourceMap.findEntry( nextCallSite.getLineNumber() - 1, - nextCallSite.getColumnNumber() - 1 + nextCallSite.getColumnNumber() - 1, ); return name; } @@ -137,14 +137,14 @@ function getErrorSource( sourceMap, originalSourcePath, originalLine, - originalColumn + originalColumn, ) { const originalSourcePathNoScheme = StringPrototypeStartsWith(originalSourcePath, 'file://') ? fileURLToPath(originalSourcePath) : originalSourcePath; const source = getOriginalSource( sourceMap.payload, - originalSourcePath + originalSourcePath, ); if (typeof source !== 'string') { return; diff --git a/lib/internal/source_map/source_map.js b/lib/internal/source_map/source_map.js index ec10dbfdf84389..868f2d6f066cd3 100644 --- a/lib/internal/source_map/source_map.js +++ b/lib/internal/source_map/source_map.js @@ -264,7 +264,7 @@ class SourceMap { ArrayPrototypePush( this.#mappings, [lineNumber, columnNumber, sourceURL, sourceLineNumber, - sourceColumnNumber, name] + sourceColumnNumber, name], ); } } diff --git a/lib/internal/streams/compose.js b/lib/internal/streams/compose.js index 03bfa39e9f6f1b..14c68e37b2e7af 100644 --- a/lib/internal/streams/compose.js +++ b/lib/internal/streams/compose.js @@ -45,14 +45,14 @@ module.exports = function compose(...streams) { throw new ERR_INVALID_ARG_VALUE( `streams[${n}]`, orgStreams[n], - 'must be readable' + 'must be readable', ); } if (n > 0 && !isWritable(streams[n])) { throw new ERR_INVALID_ARG_VALUE( `streams[${n}]`, orgStreams[n], - 'must be writable' + 'must be writable', ); } } diff --git a/lib/internal/streams/duplexify.js b/lib/internal/streams/duplexify.js index 2198542706e4d4..f1395e9727e36b 100644 --- a/lib/internal/streams/duplexify.js +++ b/lib/internal/streams/duplexify.js @@ -109,7 +109,7 @@ module.exports = function duplexify(body, name) { }, (err) => { destroyer(d, err); - } + }, ); return d = new Duplexify({ @@ -186,7 +186,7 @@ module.exports = function duplexify(body, name) { }, (err) => { destroyer(d, err); - } + }, ); return d = new Duplexify({ diff --git a/lib/internal/streams/end-of-stream.js b/lib/internal/streams/end-of-stream.js index 04ceb72460adb0..e0620dcd457780 100644 --- a/lib/internal/streams/end-of-stream.js +++ b/lib/internal/streams/end-of-stream.js @@ -288,7 +288,7 @@ function eosWeb(stream, options, callback) { PromisePrototypeThen( stream[kIsClosedPromise].promise, resolverFn, - resolverFn + resolverFn, ); return nop; } diff --git a/lib/internal/streams/operators.js b/lib/internal/streams/operators.js index 485885ab5ca359..9841723622418b 100644 --- a/lib/internal/streams/operators.js +++ b/lib/internal/streams/operators.js @@ -56,7 +56,7 @@ function compose(stream, options) { // Not validating as we already validated before addAbortSignalNoValidate( options.signal, - composedStream + composedStream, ); } diff --git a/lib/internal/streams/readable.js b/lib/internal/streams/readable.js index aad4c594501ba6..ba4b12aed91082 100644 --- a/lib/internal/streams/readable.js +++ b/lib/internal/streams/readable.js @@ -671,7 +671,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) { if (!state.multiAwaitDrain) { state.multiAwaitDrain = true; state.awaitDrainWriters = new SafeSet( - state.awaitDrainWriters ? [state.awaitDrainWriters] : [] + state.awaitDrainWriters ? [state.awaitDrainWriters] : [], ); } } diff --git a/lib/internal/test_runner/coverage.js b/lib/internal/test_runner/coverage.js index 76907d9f5b32b9..8bcc053414ca42 100644 --- a/lib/internal/test_runner/coverage.js +++ b/lib/internal/test_runner/coverage.js @@ -221,15 +221,15 @@ class TestCoverage { coverageSummary.totals.coveredLinePercent = toPercentage( coverageSummary.totals.coveredLineCount, - coverageSummary.totals.totalLineCount + coverageSummary.totals.totalLineCount, ); coverageSummary.totals.coveredBranchPercent = toPercentage( coverageSummary.totals.coveredBranchCount, - coverageSummary.totals.totalBranchCount + coverageSummary.totals.totalBranchCount, ); coverageSummary.totals.coveredFunctionPercent = toPercentage( coverageSummary.totals.coveredFunctionCount, - coverageSummary.totals.totalFunctionCount + coverageSummary.totals.totalFunctionCount, ); coverageSummary.files.sort(sortCoverageFiles); diff --git a/lib/internal/test_runner/mock.js b/lib/internal/test_runner/mock.js index fea9ed694884d8..aa3014a7bc40c6 100644 --- a/lib/internal/test_runner/mock.js +++ b/lib/internal/test_runner/mock.js @@ -161,7 +161,7 @@ class MockTracker { if (setter && getter) { throw new ERR_INVALID_ARG_VALUE( - 'options.setter', setter, "cannot be used with 'options.getter'" + 'options.setter', setter, "cannot be used with 'options.getter'", ); } const descriptor = findMethodOnPrototypeChain(objectOrFunction, methodName); @@ -178,7 +178,7 @@ class MockTracker { if (typeof original !== 'function') { throw new ERR_INVALID_ARG_VALUE( - 'methodName', original, 'must be a method' + 'methodName', original, 'must be a method', ); } @@ -213,7 +213,7 @@ class MockTracker { object, methodName, implementation = kDefaultFunction, - options = kEmptyObject + options = kEmptyObject, ) { if (implementation !== null && typeof implementation === 'object') { options = implementation; @@ -226,7 +226,7 @@ class MockTracker { if (getter === false) { throw new ERR_INVALID_ARG_VALUE( - 'options.getter', getter, 'cannot be false' + 'options.getter', getter, 'cannot be false', ); } @@ -240,7 +240,7 @@ class MockTracker { object, methodName, implementation = kDefaultFunction, - options = kEmptyObject + options = kEmptyObject, ) { if (implementation !== null && typeof implementation === 'object') { options = implementation; @@ -253,7 +253,7 @@ class MockTracker { if (setter === false) { throw new ERR_INVALID_ARG_VALUE( - 'options.setter', setter, 'cannot be false' + 'options.setter', setter, 'cannot be false', ); } diff --git a/lib/internal/test_runner/reporter/tap.js b/lib/internal/test_runner/reporter/tap.js index 20514a88e1741a..c2de32000f8c7e 100644 --- a/lib/internal/test_runner/reporter/tap.js +++ b/lib/internal/test_runner/reporter/tap.js @@ -243,13 +243,13 @@ function jsToYaml(indent, name, value) { const processed = RegExpPrototypeSymbolReplace( kFrameStartRegExp, frame, - '' + '', ); if (processed.length > 0 && processed.length !== frame.length) { ArrayPrototypePush(frames, processed); } - } + }, ); if (frames.length > 0) { diff --git a/lib/internal/test_runner/runner.js b/lib/internal/test_runner/runner.js index 39670ccabd3b3c..d2b5335706e6e5 100644 --- a/lib/internal/test_runner/runner.js +++ b/lib/internal/test_runner/runner.js @@ -181,7 +181,7 @@ class FileTest extends Test { node.id, node.description, YAMLToJs(node.diagnostics), - directive + directive, ); } else { this.reporter.fail( @@ -190,7 +190,7 @@ class FileTest extends Test { node.id, node.description, YAMLToJs(node.diagnostics), - directive + directive, ); } break; diff --git a/lib/internal/test_runner/tap_checker.js b/lib/internal/test_runner/tap_checker.js index 1392fb7d3bd335..1b9945c5485a38 100644 --- a/lib/internal/test_runner/tap_checker.js +++ b/lib/internal/test_runner/tap_checker.js @@ -24,7 +24,7 @@ class TAPValidationStrategy { #validateVersion(ast) { const entry = ArrayPrototypeFind( ast, - (node) => node.kind === TokenKind.TAP_VERSION + (node) => node.kind === TokenKind.TAP_VERSION, ); if (!entry) { @@ -42,7 +42,7 @@ class TAPValidationStrategy { #validatePlan(ast) { const entry = ArrayPrototypeFind( ast, - (node) => node.kind === TokenKind.TAP_PLAN + (node) => node.kind === TokenKind.TAP_PLAN, ); if (!entry) { @@ -64,7 +64,7 @@ class TAPValidationStrategy { if (planEnd !== 0 && planStart > planEnd) { throw new ERR_TAP_VALIDATION_ERROR( - `plan start ${planStart} is greater than plan end ${planEnd}` + `plan start ${planStart} is greater than plan end ${planEnd}`, ); } } @@ -76,15 +76,15 @@ class TAPValidationStrategy { #validateTestPoints(ast) { const bailoutEntry = ArrayPrototypeFind( ast, - (node) => node.kind === TokenKind.TAP_BAIL_OUT + (node) => node.kind === TokenKind.TAP_BAIL_OUT, ); const planEntry = ArrayPrototypeFind( ast, - (node) => node.kind === TokenKind.TAP_PLAN + (node) => node.kind === TokenKind.TAP_PLAN, ); const testPointEntries = ArrayPrototypeFilter( ast, - (node) => node.kind === TokenKind.TAP_TEST_POINT + (node) => node.kind === TokenKind.TAP_TEST_POINT, ); const plan = planEntry.node; @@ -96,7 +96,7 @@ class TAPValidationStrategy { throw new ERR_TAP_VALIDATION_ERROR( `found ${testPointEntries.length} Test Point${ testPointEntries.length > 1 ? 's' : '' - } but plan is ${planStart}..0` + } but plan is ${planStart}..0`, ); } @@ -107,7 +107,7 @@ class TAPValidationStrategy { if (!bailoutEntry && testPointEntries.length !== planEnd) { throw new ERR_TAP_VALIDATION_ERROR( - `test Points count ${testPointEntries.length} does not match plan count ${planEnd}` + `test Points count ${testPointEntries.length} does not match plan count ${planEnd}`, ); } @@ -117,7 +117,7 @@ class TAPValidationStrategy { if (testId < planStart || testId > planEnd) { throw new ERR_TAP_VALIDATION_ERROR( - `test ${testId} is out of plan range ${planStart}..${planEnd}` + `test ${testId} is out of plan range ${planStart}..${planEnd}`, ); } } diff --git a/lib/internal/test_runner/tap_lexer.js b/lib/internal/test_runner/tap_lexer.js index 64ddafb4dba2da..79040e5f7bf99a 100644 --- a/lib/internal/test_runner/tap_lexer.js +++ b/lib/internal/test_runner/tap_lexer.js @@ -200,7 +200,7 @@ class TapLexer { throw new ERR_TAP_LEXER_ERROR( `Unexpected character: ${char} at line ${this.#line}, column ${ this.#column - }` + }`, ); } diff --git a/lib/internal/test_runner/tap_parser.js b/lib/internal/test_runner/tap_parser.js index f4d73bb12b9082..5bf483ad2b2ec1 100644 --- a/lib/internal/test_runner/tap_parser.js +++ b/lib/internal/test_runner/tap_parser.js @@ -141,7 +141,7 @@ class TapParser extends Transform { // TODO(@manekinekko): when running in async mode, it doesn't make sense to // validate the current chunk. Validation needs to whole AST to be available. throw new ERR_TAP_VALIDATION_ERROR( - 'TAP validation is not supported for async parsing' + 'TAP validation is not supported for async parsing', ); } // ----------------------------------------------------------------------// @@ -158,12 +158,12 @@ class TapParser extends Transform { chunkAsString = StringPrototypeReplaceAll( chunkAsString, '[out] ', - '' + '', ); chunkAsString = StringPrototypeReplaceAll( chunkAsString, '[err] ', - '' + '', ); if (StringPrototypeEndsWith(chunkAsString, '\n')) { chunkAsString = StringPrototypeSlice(chunkAsString, 0, -1); @@ -303,7 +303,7 @@ class TapParser extends Transform { message, `, received "${token.value}" (${token.kind})`, token, - this.#input + this.#input, ); } @@ -356,7 +356,7 @@ class TapParser extends Transform { TokenKind.WHITESPACE, TokenKind.ESCAPE, ], - nextToken.kind + nextToken.kind, ) ) { const word = this.#next(false).value; @@ -419,7 +419,7 @@ class TapParser extends Transform { if (this.#bufferedComments.length > 0) { currentNode.comments = ArrayPrototypeMap( this.#bufferedComments, - (c) => c.node.comment + (c) => c.node.comment, ); this.#bufferedComments = []; } @@ -496,7 +496,7 @@ class TapParser extends Transform { // Buffer this node (and also add any pending comments to it) ArrayPrototypePush( this.#bufferedTestPoints, - this.#addCommentsToCurrentNode(currentNode) + this.#addCommentsToCurrentNode(currentNode), ); break; @@ -510,7 +510,7 @@ class TapParser extends Transform { case TokenKind.TAP_YAML_END: // Emit either the last updated test point (w/ diagnostics) or the current diagnostics node alone this.#emit( - this.#addDiagnosticsToLastTestPoint(currentNode) || currentNode + this.#addDiagnosticsToLastTestPoint(currentNode) || currentNode, ); break; @@ -528,11 +528,11 @@ class TapParser extends Transform { ArrayPrototypeFilter( chunk, (token) => - token.kind !== TokenKind.NEWLINE && token.kind !== TokenKind.EOF + token.kind !== TokenKind.NEWLINE && token.kind !== TokenKind.EOF, ), - (token) => token.value + (token) => token.value, ), - '' + '', ); } @@ -947,7 +947,7 @@ class TapParser extends Transform { nextToken && ArrayPrototypeIncludes( [TokenKind.NEWLINE, TokenKind.EOF, TokenKind.EOL], - nextToken.kind + nextToken.kind, ) === false ) { let isEnabled = true; diff --git a/lib/internal/test_runner/test.js b/lib/internal/test_runner/test.js index 48271e2e71a80e..5bbbf4b19e9e8c 100644 --- a/lib/internal/test_runner/test.js +++ b/lib/internal/test_runner/test.js @@ -71,7 +71,7 @@ const testNamePatternFlag = isTestRunner ? null : const testNamePatterns = testNamePatternFlag?.length > 0 ? ArrayPrototypeMap( testNamePatternFlag, - (re) => convertStringToRegExp(re, '--test-name-pattern') + (re) => convertStringToRegExp(re, '--test-name-pattern'), ) : null; const kShouldAbort = Symbol('kShouldAbort'); const kFilename = process.argv?.[1]; @@ -88,7 +88,7 @@ function stopTest(timeout, signal) { return PromisePrototypeThen(setTimeout(timeout, null, { ref: false, signal }), () => { throw new ERR_TEST_FAILURE( `test timed out after ${timeout}ms`, - kTestTimeoutFailure + kTestTimeoutFailure, ); }); } @@ -238,7 +238,7 @@ class Test extends AsyncResource { // eslint-disable-next-line no-use-before-define const match = this instanceof TestHook || ArrayPrototypeSome( testNamePatterns, - (re) => RegExpPrototypeExec(re, name) !== null + (re) => RegExpPrototypeExec(re, name) !== null, ); if (!match) { @@ -380,8 +380,8 @@ class Test extends AsyncResource { test.fail( new ERR_TEST_FAILURE( 'test could not be started because its parent finished', - kParentAlreadyFinished - ) + kParentAlreadyFinished, + ), ); } @@ -401,8 +401,8 @@ class Test extends AsyncResource { this.fail(error || new ERR_TEST_FAILURE( 'test did not finish before its parent and was cancelled', - kCancelledByParent - ) + kCancelledByParent, + ), ); this.startTime = this.startTime || this.endTime; // If a test was canceled before it was started, e.g inside a hook this.cancelled = true; @@ -538,7 +538,7 @@ class Test extends AsyncResource { if (isPromise(ret)) { this.fail(new ERR_TEST_FAILURE( 'passed a callback but also returned a Promise', - kCallbackAndPromisePresent + kCallbackAndPromisePresent, )); await SafePromiseRace([ret, stopPromise]); } else { diff --git a/lib/internal/test_runner/utils.js b/lib/internal/test_runner/utils.js index a212e4ad37cc93..d981c0f6d4381b 100644 --- a/lib/internal/test_runner/utils.js +++ b/lib/internal/test_runner/utils.js @@ -47,7 +47,7 @@ function createDeferredCallback() { if (calledCount === 2) { throw new ERR_TEST_FAILURE( 'callback invoked multiple times', - kMultipleCallbackInvocations + kMultipleCallbackInvocations, ); } @@ -81,7 +81,7 @@ function convertStringToRegExp(str, name) { throw new ERR_INVALID_ARG_VALUE( name, str, - `is an invalid regular expression.${msg ? ` ${msg}` : ''}` + `is an invalid regular expression.${msg ? ` ${msg}` : ''}`, ); } } diff --git a/lib/internal/tls/secure-context.js b/lib/internal/tls/secure-context.js index 3d2e4d6623e859..d91df0e2a03846 100644 --- a/lib/internal/tls/secure-context.js +++ b/lib/internal/tls/secure-context.js @@ -80,7 +80,7 @@ function validateKeyOrCertOption(name, value) { 'TypedArray', 'DataView', ], - value + value, ); } } diff --git a/lib/internal/tty.js b/lib/internal/tty.js index 4f285e92829637..a1a4f790a12cc3 100644 --- a/lib/internal/tty.js +++ b/lib/internal/tty.js @@ -94,7 +94,7 @@ function warnOnDeactivatedColors(env) { if (name !== '') { process.emitWarning( `The '${name}' env is ignored due to the 'FORCE_COLOR' env being set.`, - 'Warning' + 'Warning', ); warned = true; } diff --git a/lib/internal/url.js b/lib/internal/url.js index 886c70a13b806b..a1b61a4c1127c9 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -260,7 +260,7 @@ class URLSearchParams { const length = ArrayPrototypeReduce( output, (prev, cur) => prev + removeColors(cur).length + separator.length, - -separator.length + -separator.length, ); if (length > ctx.breakLength) { return `${this.constructor.name} {\n` + @@ -1158,7 +1158,7 @@ defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', { } return prev; }, - [] + [], ); const breakLn = StringPrototypeIncludes(inspect(output, innerOpts), '\n'); const outputStrs = ArrayPrototypeMap(output, (p) => inspect(p, innerOpts)); @@ -1222,7 +1222,7 @@ function getPathFromURLWin32(url) { if ((pathname[n + 1] === '2' && third === 102) || // 2f 2F / (pathname[n + 1] === '5' && third === 99)) { // 5c 5C \ throw new ERR_INVALID_FILE_URL_PATH( - 'must not include encoded \\ or / characters' + 'must not include encoded \\ or / characters', ); } } @@ -1258,7 +1258,7 @@ function getPathFromURLPosix(url) { const third = StringPrototypeCodePointAt(pathname, n + 2) | 0x20; if (pathname[n + 1] === '2' && third === 102) { throw new ERR_INVALID_FILE_URL_PATH( - 'must not include encoded / characters' + 'must not include encoded / characters', ); } } @@ -1317,14 +1317,14 @@ function pathToFileURL(filepath) { throw new ERR_INVALID_ARG_VALUE( 'filepath', filepath, - 'Missing UNC resource path' + 'Missing UNC resource path', ); } if (hostnameEndIndex === 2) { throw new ERR_INVALID_ARG_VALUE( 'filepath', filepath, - 'Empty UNC servername' + 'Empty UNC servername', ); } const hostname = StringPrototypeSlice(filepath, 2, hostnameEndIndex); diff --git a/lib/internal/util/comparisons.js b/lib/internal/util/comparisons.js index e41fcf2daf92a0..aa0973baa45c8b 100644 --- a/lib/internal/util/comparisons.js +++ b/lib/internal/util/comparisons.js @@ -259,7 +259,7 @@ function innerDeepEqual(val1, val2, strict, memos) { function getEnumerables(val, keys) { return ArrayPrototypeFilter( keys, - (k) => ObjectPrototypePropertyIsEnumerable(val, k) + (k) => ObjectPrototypePropertyIsEnumerable(val, k), ); } diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index b03a2c0a66bdbf..61a6093ae293e0 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -167,8 +167,8 @@ function pathToFileUrlHref(filepath) { const builtInObjects = new SafeSet( ArrayPrototypeFilter( ObjectGetOwnPropertyNames(globalThis), - (e) => RegExpPrototypeExec(/^[A-Z][a-zA-Z0-9]+$/, e) !== null - ) + (e) => RegExpPrototypeExec(/^[A-Z][a-zA-Z0-9]+$/, e) !== null, + ), ); // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot @@ -807,7 +807,7 @@ function formatValue(ctx, value, recurseTimes, typedArray) { context, depth, getUserOptions(ctx, isCrossContext), - inspect + inspect, ); // If the custom inspection method returned `this`, don't go into // infinite recursion. @@ -861,7 +861,7 @@ function formatRaw(ctx, value, recurseTimes, typedArray) { (ctx.showHidden ? ObjectPrototypeHasOwnProperty : ObjectPrototypePropertyIsEnumerable)( - value, SymbolToStringTag + value, SymbolToStringTag, ))) { tag = ''; } @@ -961,7 +961,7 @@ function formatRaw(ctx, value, recurseTimes, typedArray) { } else if (isRegExp(value)) { // Make RegExps say that they are RegExps base = RegExpPrototypeToString( - constructor !== null ? value : new RegExp(value) + constructor !== null ? value : new RegExp(value), ); const prefix = getPrefix(constructor, tag, 'RegExp'); if (prefix !== 'RegExp ') @@ -1468,8 +1468,8 @@ function groupArrayElements(ctx, output, value) { // The added bias increases the columns for short entries. MathRound( MathSqrt( - approxCharHeights * biasedMax * outputLength - ) / biasedMax + approxCharHeights * biasedMax * outputLength, + ) / biasedMax, ), // Do not exceed the breakLength. MathFloor((ctx.breakLength - ctx.indentationLvl) / actualMax), @@ -1477,7 +1477,7 @@ function groupArrayElements(ctx, output, value) { // minimal grouping. ctx.compact * 4, // Limit the columns to a maximum of fifteen. - 15 + 15, ); // Return with the original output if no grouping should happen. if (columns <= 1) { @@ -1542,7 +1542,7 @@ function handleMaxCallStackSize(ctx, err, constructorName, indentationLvl) { return ctx.stylize( `[${constructorName}: Inspection interrupted ` + 'prematurely. Maximum call stack size exceeded.]', - 'special' + 'special', ); } /* c8 ignore next */ @@ -1597,7 +1597,7 @@ function formatNumber(fn, number, numericSeparator) { addNumericSeparator(string) }.${ addNumericSeparatorEnd( - StringPrototypeSlice(String(number), string.length + 1) + StringPrototypeSlice(String(number), string.length + 1), ) }`, 'number'); } @@ -1978,7 +1978,7 @@ function formatProperty(ctx, value, recurseTimes, key, type, desc, const tmp = RegExpPrototypeSymbolReplace( strEscapeSequencesReplacer, SymbolPrototypeToString(key), - escapeFn + escapeFn, ); name = `[${ctx.stylize(tmp, 'symbol')}]`; } else if (key === '__proto__') { @@ -2157,7 +2157,7 @@ function formatNumberNoColor(number, options) { return formatNumber( stylizeNoColor, number, - options?.numericSeparator ?? inspectDefaultOptions.numericSeparator + options?.numericSeparator ?? inspectDefaultOptions.numericSeparator, ); } @@ -2165,7 +2165,7 @@ function formatBigIntNoColor(bigint, options) { return formatBigInt( stylizeNoColor, bigint, - options?.numericSeparator ?? inspectDefaultOptions.numericSeparator + options?.numericSeparator ?? inspectDefaultOptions.numericSeparator, ); } diff --git a/lib/internal/util/inspector.js b/lib/internal/util/inspector.js index 6940da82a29bac..8072f33482abe1 100644 --- a/lib/internal/util/inspector.js +++ b/lib/internal/util/inspector.js @@ -87,7 +87,7 @@ function wrapConsole(consoleFromNode) { consoleCall, consoleFromNode, consoleFromVM[key], - consoleFromNode[key] + consoleFromNode[key], ); ObjectDefineProperty(consoleFromNode[key], 'name', { __proto__: null, diff --git a/lib/internal/util/parse_args/parse_args.js b/lib/internal/util/parse_args/parse_args.js index afe50ea02728e6..68a9fddff50fd0 100644 --- a/lib/internal/util/parse_args/parse_args.js +++ b/lib/internal/util/parse_args/parse_args.js @@ -195,7 +195,7 @@ function argsToTokens(args, options) { ArrayPrototypePushApply( tokens, ArrayPrototypeMap(remainingArgs, (arg) => { return { kind: 'positional', index: ++index, value: arg }; - }) + }), ); break; // Finished processing args, leave while loop. } @@ -321,7 +321,7 @@ const parseArgs = (config = kEmptyObject) => { throw new ERR_INVALID_ARG_VALUE( `options.${longOption}.short`, shortOption, - 'must be a single character' + 'must be a single character', ); } } @@ -345,7 +345,7 @@ const parseArgs = (config = kEmptyObject) => { } validator(defaultValue, `options.${longOption}.default`); } - } + }, ); // Phase 1: identify tokens diff --git a/lib/internal/util/parse_args/utils.js b/lib/internal/util/parse_args/utils.js index 2e9863b54d62aa..eb70257cfba095 100644 --- a/lib/internal/util/parse_args/utils.js +++ b/lib/internal/util/parse_args/utils.js @@ -165,7 +165,7 @@ function findLongOptionForShort(shortOption, options) { validateObject(options, 'options'); const longOptionEntry = ArrayPrototypeFind( ObjectEntries(options), - ({ 1: optionConfig }) => objectGetOwn(optionConfig, 'short') === shortOption + ({ 1: optionConfig }) => objectGetOwn(optionConfig, 'short') === shortOption, ); return longOptionEntry?.[0] ?? shortOption; } diff --git a/lib/internal/validators.js b/lib/internal/validators.js index 50b3016ab78ec2..8127bd66fe3609 100644 --- a/lib/internal/validators.js +++ b/lib/internal/validators.js @@ -98,7 +98,7 @@ const validateInteger = hideStackFrames( throw new ERR_OUT_OF_RANGE(name, 'an integer', value); if (value < min || value > max) throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value); - } + }, ); /** @@ -123,7 +123,7 @@ const validateInt32 = hideStackFrames( if (value < min || value > max) { throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value); } - } + }, ); /** @@ -473,7 +473,7 @@ function validateLinkHeaderFormat(value, name) { throw new ERR_INVALID_ARG_VALUE( name, value, - 'must be an array or string of format "; rel=preload; as=style"' + 'must be an array or string of format "; rel=preload; as=style"', ); } } @@ -516,7 +516,7 @@ function validateLinkHeaderValue(hints) { throw new ERR_INVALID_ARG_VALUE( 'hints', hints, - 'must be an array or string of format "; rel=preload; as=style"' + 'must be an array or string of format "; rel=preload; as=style"', ); } diff --git a/lib/internal/vm.js b/lib/internal/vm.js index bf0a7902a17f42..b14ba13e7e4cfb 100644 --- a/lib/internal/vm.js +++ b/lib/internal/vm.js @@ -60,7 +60,7 @@ function internalCompileFunction(code, params, options) { throw new ERR_INVALID_ARG_TYPE( 'options.parsingContext', 'Context', - parsingContext + parsingContext, ); } } @@ -79,7 +79,7 @@ function internalCompileFunction(code, params, options) { produceCachedData, parsingContext, contextExtensions, - params + params, ); if (produceCachedData) { diff --git a/lib/internal/vm/module.js b/lib/internal/vm/module.js index ae9d8f2756632d..5d6999ffa3b14d 100644 --- a/lib/internal/vm/module.js +++ b/lib/internal/vm/module.js @@ -219,7 +219,7 @@ class Module { status !== kEvaluated && status !== kErrored) { throw new ERR_VM_MODULE_STATUS( - 'must be one of linked, evaluated, or errored' + 'must be one of linked, evaluated, or errored', ); } await this[kWrap].evaluate(timeout, breakOnSigint); diff --git a/lib/internal/webstreams/adapters.js b/lib/internal/webstreams/adapters.js index 2ebc18d7645cc9..3e5fd69d4d6a03 100644 --- a/lib/internal/webstreams/adapters.js +++ b/lib/internal/webstreams/adapters.js @@ -111,7 +111,7 @@ function newWritableStreamFromStreamWritable(streamWritable) { throw new ERR_INVALID_ARG_TYPE( 'streamWritable', 'stream.Writable', - streamWritable + streamWritable, ); } diff --git a/lib/internal/webstreams/queuingstrategies.js b/lib/internal/webstreams/queuingstrategies.js index 719fa254f5cf8d..df114a44cc8adc 100644 --- a/lib/internal/webstreams/queuingstrategies.js +++ b/lib/internal/webstreams/queuingstrategies.js @@ -52,7 +52,7 @@ const nameDescriptor = { __proto__: null, value: 'size' }; const byteSizeFunction = ObjectDefineProperty( (chunk) => chunk.byteLength, 'name', - nameDescriptor + nameDescriptor, ); const countSizeFunction = ObjectDefineProperty(() => 1, 'name', nameDescriptor); diff --git a/lib/internal/webstreams/readablestream.js b/lib/internal/webstreams/readablestream.js index 44df1805df0454..cc683e956db5f5 100644 --- a/lib/internal/webstreams/readablestream.js +++ b/lib/internal/webstreams/readablestream.js @@ -756,7 +756,7 @@ function createReadableStreamBYOBRequest(controller, view) { }; }, [], - ReadableStreamBYOBRequest + ReadableStreamBYOBRequest, ); } @@ -1592,7 +1592,7 @@ function readableByteStreamTee(stream) { if (!canceled1 || !canceled2) { cancelDeferred.resolve(); } - } + }, ); } @@ -1617,11 +1617,11 @@ function readableByteStreamTee(stream) { } catch (error) { readableByteStreamControllerError( branch1[kState].controller, - error + error, ); readableByteStreamControllerError( branch2[kState].controller, - error + error, ); cancelDeferred.resolve(readableStreamCancel(stream, error)); return; @@ -1630,13 +1630,13 @@ function readableByteStreamTee(stream) { if (!canceled1) { readableByteStreamControllerEnqueue( branch1[kState].controller, - chunk1 + chunk1, ); } if (!canceled2) { readableByteStreamControllerEnqueue( branch2[kState].controller, - chunk2 + chunk2, ); } reading = false; @@ -1700,11 +1700,11 @@ function readableByteStreamTee(stream) { } catch (error) { readableByteStreamControllerError( byobBranch[kState].controller, - error + error, ); readableByteStreamControllerError( otherBranch[kState].controller, - error + error, ); cancelDeferred.resolve(readableStreamCancel(stream, error)); return; @@ -1712,18 +1712,18 @@ function readableByteStreamTee(stream) { if (!byobCanceled) { readableByteStreamControllerRespondWithNewView( byobBranch[kState].controller, - chunk + chunk, ); } readableByteStreamControllerEnqueue( otherBranch[kState].controller, - clonedChunk + clonedChunk, ); } else if (!byobCanceled) { readableByteStreamControllerRespondWithNewView( byobBranch[kState].controller, - chunk + chunk, ); } reading = false; @@ -1751,7 +1751,7 @@ function readableByteStreamTee(stream) { if (!byobCanceled) { readableByteStreamControllerRespondWithNewView( byobBranch[kState].controller, - chunk + chunk, ); } if ( @@ -1760,7 +1760,7 @@ function readableByteStreamTee(stream) { ) { readableByteStreamControllerRespond( otherBranch[kState].controller, - 0 + 0, ); } } @@ -2673,13 +2673,13 @@ function readableByteStreamControllerEnqueue(controller, chunk) { readableByteStreamControllerInvalidateBYOBRequest(controller); firstPendingPullInto.buffer = transferArrayBuffer( - firstPendingPullInto.buffer + firstPendingPullInto.buffer, ); if (firstPendingPullInto.type === 'none') { readableByteStreamControllerEnqueueDetachedPullIntoToQueue( controller, - firstPendingPullInto + firstPendingPullInto, ); } } @@ -2725,14 +2725,14 @@ function readableByteStreamControllerEnqueueClonedChunkToQueue( controller, buffer, byteOffset, - byteLength + byteLength, ) { let cloneResult; try { cloneResult = ArrayBufferPrototypeSlice( buffer, byteOffset, - byteOffset + byteLength + byteOffset + byteLength, ); } catch (error) { readableByteStreamControllerError(controller, error); @@ -2742,7 +2742,7 @@ function readableByteStreamControllerEnqueueClonedChunkToQueue( controller, cloneResult, 0, - byteLength + byteLength, ); } @@ -2763,7 +2763,7 @@ function readableByteStreamControllerEnqueueChunkToQueue( function readableByteStreamControllerEnqueueDetachedPullIntoToQueue( controller, - desc + desc, ) { const { buffer, @@ -2778,7 +2778,7 @@ function readableByteStreamControllerEnqueueDetachedPullIntoToQueue( controller, buffer, byteOffset, - bytesFilled + bytesFilled, ); } readableByteStreamControllerShiftPendingPullInto(controller); @@ -2893,10 +2893,10 @@ function readableByteStreamControllerRespondInReadableState( if (type === 'none') { readableByteStreamControllerEnqueueDetachedPullIntoToQueue( controller, - desc + desc, ); readableByteStreamControllerProcessPullIntoDescriptorsUsingQueue( - controller + controller, ); return; } @@ -3068,7 +3068,7 @@ function readableByteStreamControllerPullSteps(controller, readRequest) { assert(!readableStreamGetNumReadRequests(stream)); readableByteStreamControllerFillReadRequestFromQueue( controller, - readRequest + readRequest, ); return; } diff --git a/lib/internal/webstreams/util.js b/lib/internal/webstreams/util.js index a7273833d1f180..91f487b98f19f3 100644 --- a/lib/internal/webstreams/util.js +++ b/lib/internal/webstreams/util.js @@ -108,7 +108,7 @@ function cloneAsUint8Array(view) { const byteOffset = ArrayBufferViewGetByteOffset(view); const byteLength = ArrayBufferViewGetByteLength(view); return new Uint8Array( - ArrayBufferPrototypeSlice(buffer, byteOffset, byteOffset + byteLength) + ArrayBufferPrototypeSlice(buffer, byteOffset, byteOffset + byteLength), ); } diff --git a/lib/internal/worker.js b/lib/internal/worker.js index 5351fd5d28afbc..0120bc6f4d87dd 100644 --- a/lib/internal/worker.js +++ b/lib/internal/worker.js @@ -141,7 +141,7 @@ class Worker extends EventEmitter { throw new ERR_INVALID_ARG_VALUE( 'options.eval', options.eval, - 'must be false when \'filename\' is not a string' + 'must be false when \'filename\' is not a string', ); } url = null; @@ -159,7 +159,7 @@ class Worker extends EventEmitter { throw new ERR_INVALID_ARG_TYPE( 'filename', ['string', 'URL'], - filename + filename, ); } else if (path.isAbsolute(filename) || RegExpPrototypeExec(/^\.\.?[\\/]/, filename) !== null) { @@ -175,7 +175,7 @@ class Worker extends EventEmitter { env = { __proto__: null }; ArrayPrototypeForEach( ObjectEntries(options.env), - ({ 0: key, 1: value }) => { env[key] = `${value}`; } + ({ 0: key, 1: value }) => { env[key] = `${value}`; }, ); } else if (options.env == null) { env = process.env; @@ -489,7 +489,7 @@ function eventLoopUtilization(util1, util2) { this[kLoopStartTime], this[kHandle].loopIdleTime(), util1, - util2 + util2, ); } diff --git a/lib/net.js b/lib/net.js index 6f821651d1ce29..0eddec2e59fe4b 100644 --- a/lib/net.js +++ b/lib/net.js @@ -160,13 +160,13 @@ function createHandle(fd, is_server) { const type = guessHandleType(fd); if (type === 'PIPE') { return new Pipe( - is_server ? PipeConstants.SERVER : PipeConstants.SOCKET + is_server ? PipeConstants.SERVER : PipeConstants.SOCKET, ); } if (type === 'TCP') { return new TCP( - is_server ? TCPConstants.SERVER : TCPConstants.SOCKET + is_server ? TCPConstants.SERVER : TCPConstants.SOCKET, ); } @@ -335,7 +335,7 @@ function Socket(options) { throw new ERR_INVALID_ARG_VALUE( 'options.objectMode', options.objectMode, - 'is not supported' + 'is not supported', ); } else if (options?.readableObjectMode || options?.writableObjectMode) { throw new ERR_INVALID_ARG_VALUE( @@ -343,12 +343,12 @@ function Socket(options) { options.readableObjectMode ? 'readableObjectMode' : 'writableObjectMode' }`, options.readableObjectMode || options.writableObjectMode, - 'is not supported' + 'is not supported', ); } if (typeof options?.keepAliveInitialDelay !== 'undefined') { validateNumber( - options?.keepAliveInitialDelay, 'options.keepAliveInitialDelay' + options?.keepAliveInitialDelay, 'options.keepAliveInitialDelay', ); if (options.keepAliveInitialDelay < 0) { @@ -534,7 +534,7 @@ function writeAfterFIN(chunk, encoding, cb) { const er = genericNodeError( 'This socket has been ended by the other party', - { code: 'EPIPE' } + { code: 'EPIPE' }, ); if (typeof cb === 'function') { defaultTriggerAsyncIdScope(this[async_id_symbol], process.nextTick, cb, er); @@ -1182,7 +1182,7 @@ Socket.prototype.connect = function(...args) { if (pipe) { validateString(path, 'options.path'); defaultTriggerAsyncIdScope( - this[async_id_symbol], internalConnect, this, path + this[async_id_symbol], internalConnect, this, path, ); } else { lookupAndConnect(this, options); @@ -1248,7 +1248,7 @@ function lookupAndConnect(self, options) { defaultTriggerAsyncIdScope( self[async_id_symbol], internalConnect, - self, host, port, addressType, localAddress, localPort + self, host, port, addressType, localAddress, localPort, ); }); return; @@ -1288,7 +1288,7 @@ function lookupAndConnect(self, options) { dnsopts, port, localPort, - autoSelectFamilyAttemptTimeout + autoSelectFamilyAttemptTimeout, ); return; @@ -1321,7 +1321,7 @@ function lookupAndConnect(self, options) { defaultTriggerAsyncIdScope( self[async_id_symbol], internalConnect, - self, ip, port, addressType, localAddress, localPort + self, ip, port, addressType, localAddress, localPort, ); } }); @@ -1553,7 +1553,7 @@ function afterConnectMultiple(context, status, handle, req, readable, writable) startPerf( self, kPerfHooksNetConnectContext, - { type: 'net', name: 'connect', detail: { host: req.address, port: req.port } } + { type: 'net', name: 'connect', detail: { host: req.address, port: req.port } }, ); } @@ -1603,7 +1603,7 @@ function Server(options, connectionListener) { } if (typeof options.keepAliveInitialDelay !== 'undefined') { validateNumber( - options.keepAliveInitialDelay, 'options.keepAliveInitialDelay' + options.keepAliveInitialDelay, 'options.keepAliveInitialDelay', ); if (options.keepAliveInitialDelay < 0) { diff --git a/lib/repl.js b/lib/repl.js index 40851e4dcd6fcf..3875858871ebfb 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -153,7 +153,7 @@ const { validateObject, } = require('internal/validators'); const experimentalREPLAwait = getOptionValue( - '--experimental-repl-await' + '--experimental-repl-await', ); const pendingDeprecation = getOptionValue('--pending-deprecation'); const { @@ -652,7 +652,7 @@ function REPLServer(prompt, // find the first frame with a null function name const idx = ArrayPrototypeFindIndex( ArrayPrototypeReverse(stackFrames), - (frame) => frame.getFunctionName() === null + (frame) => frame.getFunctionName() === null, ); // If found, get rid of it and everything below it frames = ArrayPrototypeSplice(stackFrames, idx + 1); @@ -697,7 +697,7 @@ function REPLServer(prompt, e.stack = SideEffectFreeRegExpPrototypeSymbolReplace( /(\s+at\s+REPL\d+:)(\d+)/, e.stack, - (_, pre, line) => pre + (line - 1) + (_, pre, line) => pre + (line - 1), ); } } @@ -838,7 +838,7 @@ function REPLServer(prompt, return; } self.output.write( - '(To exit, press Ctrl+C again or Ctrl+D or type .exit)\n' + '(To exit, press Ctrl+C again or Ctrl+D or type .exit)\n', ); sawSIGINT = true; } else { @@ -972,7 +972,7 @@ function REPLServer(prompt, this, kContextId, kBufferedCommandSymbol, - preview + preview, ); // Wrap readline tty to enable editor mode and pausing. @@ -1056,13 +1056,13 @@ REPLServer.prototype.close = function close() { if (this.terminal && this._flushing && !this._closingOnFlush) { this._closingOnFlush = true; this.once('flushHistory', () => - ReflectApply(Interface.prototype.close, this, []) + ReflectApply(Interface.prototype.close, this, []), ); return; } process.nextTick(() => - ReflectApply(Interface.prototype.close, this, []) + ReflectApply(Interface.prototype.close, this, []), ); }; @@ -1274,9 +1274,9 @@ function completeFSFunctions(match) { const completions = ArrayPrototypeMap( ArrayPrototypeFilter( fileList, - (dirent) => StringPrototypeStartsWith(dirent.name, baseName) + (dirent) => StringPrototypeStartsWith(dirent.name, baseName), ), - (d) => d.name + (d) => d.name, ); return [[completions], baseName]; @@ -1358,7 +1358,7 @@ function complete(line, callback) { const absolute = path.resolve(dir, dirent.name); if (ArrayPrototypeSome( gracefulReaddir(absolute) || [], - (subfile) => ArrayPrototypeIncludes(indexes, subfile) + (subfile) => ArrayPrototypeIncludes(indexes, subfile), )) { ArrayPrototypePush(group, `${subdir}${dirent.name}`); } @@ -1550,7 +1550,7 @@ function complete(line, callback) { // behavior. return StringPrototypeStartsWith( StringPrototypeToLocaleLowerCase(str), - lowerCaseFilter + lowerCaseFilter, ); }); if (filteredGroup.length) { @@ -1744,7 +1744,7 @@ function defineDefaultCommands(repl) { action: function() { const names = ArrayPrototypeSort(ObjectKeys(this.commands)); const longestNameLength = MathMaxApply( - ArrayPrototypeMap(names, (name) => name.length) + ArrayPrototypeMap(names, (name) => name.length), ); ArrayPrototypeForEach(names, (name) => { const cmd = this.commands[name]; @@ -1785,7 +1785,7 @@ function defineDefaultCommands(repl) { this.write('\n'); } else { this.output.write( - `Failed to load: ${file} is not a valid file\n` + `Failed to load: ${file} is not a valid file\n`, ); } } catch { @@ -1834,12 +1834,12 @@ ObjectDefineProperty(module.exports, '_builtinLibs', { get: pendingDeprecation ? deprecate( () => _builtinLibs, 'repl._builtinLibs is deprecated. Check module.builtinModules instead', - 'DEP0142' + 'DEP0142', ) : () => _builtinLibs, set: pendingDeprecation ? deprecate( (val) => _builtinLibs = val, 'repl._builtinLibs is deprecated. Check module.builtinModules instead', - 'DEP0142' + 'DEP0142', ) : (val) => _builtinLibs = val, enumerable: false, configurable: true diff --git a/lib/tls.js b/lib/tls.js index 1e5a7298dbf8e7..ede721a9b7f043 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -98,7 +98,7 @@ else exports.getCiphers = internalUtil.cachedResult( - () => internalUtil.filterDuplicateStrings(getSSLCiphers(), true) + () => internalUtil.filterDuplicateStrings(getSSLCiphers(), true), ); let rootCertificates; @@ -152,7 +152,7 @@ exports.convertALPNProtocols = function convertALPNProtocols(protocols, out) { } else if (isArrayBufferView(protocols)) { out.ALPNProtocols = Buffer.from(protocols.buffer.slice( protocols.byteOffset, - protocols.byteOffset + protocols.byteLength + protocols.byteOffset + protocols.byteLength, )); } }; @@ -170,7 +170,7 @@ function toLowerCase(c) { function splitHost(host) { return StringPrototypeSplit( RegExpPrototypeSymbolReplace(/[A-Z]/g, unfqdn(host), toLowerCase), - '.' + '.', ); } diff --git a/lib/trace_events.js b/lib/trace_events.js index 672095cec41a30..277f90ba442629 100644 --- a/lib/trace_events.js +++ b/lib/trace_events.js @@ -47,7 +47,7 @@ class Tracing { if (enabledTracingObjects.size > kMaxTracingCount) { process.emitWarning( 'Possible trace_events memory leak detected. There are more than ' + - `${kMaxTracingCount} enabled Tracing objects.` + `${kMaxTracingCount} enabled Tracing objects.`, ); } } diff --git a/lib/util.js b/lib/util.js index 4ee13a28f58512..483cb83e2f5b6b 100644 --- a/lib/util.js +++ b/lib/util.js @@ -402,17 +402,17 @@ module.exports = { defineLazyProperties( module.exports, 'internal/util/parse_args/parse_args', - ['parseArgs'] + ['parseArgs'], ); defineLazyProperties( module.exports, 'internal/encoding', - ['TextDecoder', 'TextEncoder'] + ['TextDecoder', 'TextEncoder'], ); defineLazyProperties( module.exports, 'internal/mime', - ['MIMEType', 'MIMEParams'] + ['MIMEType', 'MIMEParams'], ); diff --git a/lib/wasi.js b/lib/wasi.js index 2a0770bf6dbbb0..54786a4eb1b556 100644 --- a/lib/wasi.js +++ b/lib/wasi.js @@ -66,7 +66,7 @@ class WASI { ArrayPrototypeForEach( ObjectEntries(options.preopens), ({ 0: key, 1: value }) => - ArrayPrototypePush(preopens, String(key), String(value)) + ArrayPrototypePush(preopens, String(key), String(value)), ); } diff --git a/lib/zlib.js b/lib/zlib.js index 9bde1997d95720..76cd6386dfa1d9 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -171,7 +171,7 @@ function zlibBufferSync(engine, buffer) { throw new ERR_INVALID_ARG_TYPE( 'buffer', ['string', 'Buffer', 'TypedArray', 'DataView', 'ArrayBuffer'], - buffer + buffer, ); } } @@ -231,7 +231,7 @@ const checkRangesOrGetDefault = hideStackFrames( `>= ${lower} and <= ${upper}`, number); } return number; - } + }, ); const FLUSH_BOUND = [ @@ -673,7 +673,7 @@ function Zlib(opts, mode) { throw new ERR_INVALID_ARG_TYPE( 'options.dictionary', ['Buffer', 'TypedArray', 'DataView', 'ArrayBuffer'], - dictionary + dictionary, ); } } @@ -805,7 +805,7 @@ const kMaxBrotliParam = MathMaxApply(ArrayPrototypeMap( ObjectKeys(constants), (key) => (StringPrototypeStartsWith(key, 'BROTLI_PARAM_') ? constants[key] : - 0) + 0), )); const brotliInitParamsArray = new Uint32Array(kMaxBrotliParam + 1);