diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 3bff01c0fd84c4..31aaa6125b42cd 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 774c5824658434..3cdb48dc6b52eb 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -395,7 +395,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 b46e7b0906dfea..d70ce51d8fced4 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -604,7 +604,7 @@ function checkConnections() { function connectionListener(socket) { defaultTriggerAsyncIdScope( - getOrSetAsyncId(socket), connectionListenerInternal, this, socket + getOrSetAsyncId(socket), connectionListenerInternal, this, socket, ); } @@ -807,15 +807,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 674e03babaf569..5d8c87b9358766 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -335,7 +335,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, ); }; @@ -745,7 +745,7 @@ function byteLength(string, encoding) { } throw new ERR_INVALID_ARG_TYPE( - 'string', ['string', 'Buffer', 'ArrayBuffer'], string + 'string', ['string', 'Buffer', 'ArrayBuffer'], string, ); } @@ -966,7 +966,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, ); } @@ -1222,7 +1222,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; }; 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 77debb9471f03c..0a2315563fe706 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -307,7 +307,7 @@ function getRandomBytesAlias(key) { configurable: true, writable: true, value: value - } + }, ); return value; }, @@ -321,7 +321,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 d0dccee9002132..c34eda38caa562 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -171,7 +171,7 @@ const isOSX = process.platform === 'darwin'; const showStringCoercionDeprecation = deprecate( () => {}, 'Implicit coercion of objects with own toString property is deprecated.', - 'DEP0162' + 'DEP0162', ); function showTruncateDeprecation() { if (truncateWarn) { diff --git a/lib/internal/assert/assertion_error.js b/lib/internal/assert/assertion_error.js index 17e261bd4cb1ef..4f8f3760a2e82e 100644 --- a/lib/internal/assert/assertion_error.js +++ b/lib/internal/assert/assertion_error.js @@ -73,7 +73,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 25f0075bf45a07..6cc01d94adbe12 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 47bd830570fa9f..03c6fc202c3b00 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -202,7 +202,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 1156bcb3150fb5..6a882c2b9b2db3 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -115,7 +115,7 @@ const deprecationHandler = { if (!this.warned) { process.emitWarning(this.message, { type: 'DeprecationWarning', - code: this.code + code: this.code, }); this.warned = true; } diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 9ad7bf8fd8593c..0a50c57b737b17 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -940,7 +940,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 9fb1d449a579e4..b71c8c5c0c982e 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -491,7 +491,7 @@ const consoleMethods = { this[kGroupIndent] = StringPrototypeSlice( this[kGroupIndent], 0, - this[kGroupIndent].length - this[kGroupIndentationWidth] + this[kGroupIndent].length - this[kGroupIndentationWidth], ); }, @@ -654,7 +654,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 e6ec2e556f00f6..b0a86f8c494129 100644 --- a/lib/internal/debugger/inspect.js +++ b/lib/internal/debugger/inspect.js @@ -272,7 +272,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 511d857b59191c..5d41c055266829 100644 --- a/lib/internal/dns/utils.js +++ b/lib/internal/dns/utils.js @@ -268,7 +268,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 aee099fc4cd1da..b437b1f03731c6 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 f00d75e150166f..2f9717dd633e2c 100644 --- a/lib/internal/event_target.js +++ b/lib/internal/event_target.js @@ -387,7 +387,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 2463fd0c5e65dd..e717f1ef422fbf 100644 --- a/lib/internal/fs/promises.js +++ b/lib/internal/fs/promises.js @@ -228,7 +228,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( @@ -239,7 +239,7 @@ class FileHandle extends EventEmitterMixin(JSTransferable) { this[kClosePromise] = undefined; this[kCloseReject] = undefined; this[kCloseResolve] = undefined; - } + }, ); } @@ -345,7 +345,7 @@ class FileHandle extends EventEmitterMixin(JSTransferable) { PromisePrototypeThen( this[kHandle].close(), this[kCloseResolve], - this[kCloseReject] + this[kCloseReject], ); } } @@ -359,8 +359,8 @@ async function handleFdClose(fileOpPromise, closeFunc) { PromisePrototypeThen( closeFunc(), () => PromiseReject(opError), - (closeError) => PromiseReject(aggregateTwoErrors(closeError, opError)) - ) + (closeError) => PromiseReject(aggregateTwoErrors(closeError, opError)), + ), ); } @@ -419,7 +419,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 bce9d344574188..1a4b56d4178968 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -119,7 +119,7 @@ const kMinimumCopyMode = MathMin( kDefaultCopyMode, COPYFILE_EXCL, COPYFILE_FICLONE, - COPYFILE_FICLONE_FORCE + COPYFILE_FICLONE_FORCE, ); const kMaximumCopyMode = COPYFILE_EXCL | COPYFILE_FICLONE | @@ -371,7 +371,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; @@ -542,7 +542,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( @@ -553,7 +553,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]), ); } @@ -571,7 +571,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], ); } @@ -667,7 +667,7 @@ const validateOffsetLengthRead = hideStackFrames( throw new ERR_OUT_OF_RANGE('length', `<= ${bufferLength - offset}`, length); } - } + }, ); const validateOffsetLengthWrite = hideStackFrames( @@ -685,7 +685,7 @@ const validateOffsetLengthWrite = hideStackFrames( } validateInt32(length, 'length', 0); - } + }, ); const validatePath = hideStackFrames((path, propName = 'path') => { @@ -845,7 +845,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; } @@ -901,7 +901,7 @@ const validateStringAfterArrayBufferView = hideStackFrames((buffer, name) => { throw new ERR_INVALID_ARG_TYPE( name, ['string', 'Buffer', 'TypedArray', 'DataView'], - buffer + buffer, ); }); @@ -910,7 +910,7 @@ const validatePrimitiveStringAfterArrayBufferView = hideStackFrames((buffer, nam throw new ERR_INVALID_ARG_TYPE( name, ['string', 'Buffer', 'TypedArray', 'DataView'], - buffer + buffer, ); } }); @@ -969,5 +969,5 @@ module.exports = { validateRmdirOptions, validateStringAfterArrayBufferView, validatePrimitiveStringAfterArrayBufferView, - warnOnNonPortableTemplate + warnOnNonPortableTemplate, }; diff --git a/lib/internal/http2/compat.js b/lib/internal/http2/compat.js index 8ece2d912c6e9d..3540a752f520df 100644 --- a/lib/internal/http2/compat.js +++ b/lib/internal/http2/compat.js @@ -120,7 +120,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; } @@ -137,7 +137,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 9503fbf891336e..d18365efaafbfe 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -538,7 +538,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) @@ -2126,7 +2126,7 @@ class Http2Stream extends Duplex { this.once( 'ready', FunctionPrototypeBind(this[kWriteGeneric], - this, writev, data, encoding, cb) + this, writev, data, encoding, cb), ); return; } @@ -3099,7 +3099,7 @@ function initializeOptions(options) { if (options.maxSessionRejectedStreams !== undefined) { validateUint32( options.maxSessionRejectedStreams, - 'maxSessionRejectedStreams' + 'maxSessionRejectedStreams', ); } @@ -3236,7 +3236,7 @@ function setupCompat(ev) { this.on('stream', FunctionPrototypeBind(onServerStream, this, this[kOptions].Http2ServerRequest, - this[kOptions].Http2ServerResponse) + this[kOptions].Http2ServerResponse), ); } } @@ -3396,7 +3396,7 @@ binding.setCallbackFunctions( onAltSvc, onOrigin, onStreamTrailers, - onStreamClose + onStreamClose, ); // Exports diff --git a/lib/internal/http2/util.js b/lib/internal/http2/util.js index ecb943c9b8e37d..b1caa50c38acea 100644 --- a/lib/internal/http2/util.js +++ b/lib/internal/http2/util.js @@ -377,7 +377,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; @@ -584,7 +584,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 ca43a19bda65c2..ac4a036cd10bcd 100644 --- a/lib/internal/main/mksnapshot.js +++ b/lib/internal/main/mksnapshot.js @@ -98,7 +98,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 fe2e132af1166a..1a0ce5d2b37f8d 100644 --- a/lib/internal/main/worker_thread.js +++ b/lib/internal/main/worker_thread.js @@ -166,7 +166,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/helpers.js b/lib/internal/modules/cjs/helpers.js index ce0c2703434488..cd8aaa6a700683 100644 --- a/lib/internal/modules/cjs/helpers.js +++ b/lib/internal/modules/cjs/helpers.js @@ -99,7 +99,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/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 42e5cc50105560..f5d63cafb7d427 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -250,7 +250,7 @@ for (const { 0: id, 1: mod } of BuiltinModule.map) { } const allBuiltins = new SafeSet( - ArrayPrototypeFlatMap(builtinModules, (bm) => [bm, `node:${bm}`]) + ArrayPrototypeFlatMap(builtinModules, (bm) => [bm, `node:${bm}`]), ); BuiltinModule.getSchemeOnlyModuleNames().forEach((builtin) => allBuiltins.add(`node:${builtin}`)); @@ -331,13 +331,13 @@ ObjectDefineProperty(Module.prototype, 'parent', { 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, }); @@ -435,7 +435,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'); @@ -448,7 +448,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', ); } } @@ -727,7 +727,7 @@ if (isWindows) { if (p !== nmLen) ArrayPrototypePush( paths, - StringPrototypeSlice(from, 0, last) + '\\node_modules' + StringPrototypeSlice(from, 0, last) + '\\node_modules', ); last = i; p = 0; @@ -762,7 +762,7 @@ if (isWindows) { if (p !== nmLen) ArrayPrototypePush( paths, - StringPrototypeSlice(from, 0, last) + '/node_modules' + StringPrototypeSlice(from, 0, last) + '/node_modules', ); last = i; p = 0; @@ -833,7 +833,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', ); } @@ -1399,7 +1399,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 f71e6ae689c277..b52a31ff54080e 100644 --- a/lib/internal/modules/esm/formats.js +++ b/lib/internal/modules/esm/formats.js @@ -37,7 +37,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 a7329d279bb075..eb5f0be49395b0 100644 --- a/lib/internal/modules/esm/get_format.js +++ b/lib/internal/modules/esm/get_format.js @@ -93,7 +93,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 120ab8ccb0beae..7b6b67f3392a70 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.`, ); }; } @@ -247,7 +247,7 @@ class ESMLoader { ) { process.emitWarning( 'The Node.js specifier resolution flag is experimental. It could change or be removed at any time.', - 'ExperimentalWarning' + 'ExperimentalWarning', ); emittedSpecifierResolutionWarning = true; } @@ -276,12 +276,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, @@ -371,7 +371,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, callbackMap } = internalBinding('module_wrap'); @@ -483,7 +483,7 @@ class ESMLoader { importAssertions, moduleProvider, parentURL === undefined, - inspectBrk + inspectBrk, ); this.moduleMap.set(url, importAssertions.type, job); @@ -671,7 +671,7 @@ class ESMLoader { 'a string, an ArrayBuffer, or a TypedArray', hookErrIdentifier, 'source', - source + source, ); } @@ -720,7 +720,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 ddf574b07a8e8a..f1fe73eec6edb6 100644 --- a/lib/internal/modules/esm/module_job.js +++ b/lib/internal/modules/esm/module_job.js @@ -43,7 +43,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 @@ -136,7 +136,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 7271d065de9461..1327bf1470d0eb 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 646b12382f6ebd..f74b0b29bd120b 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js @@ -95,7 +95,7 @@ function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { base ? ` imported from ${fileURLToPath(base)}` : ''}. Mapping specifiers ending in "/" is no longer supported.`, 'DeprecationWarning', - 'DEP0155' + 'DEP0155', ); } @@ -112,7 +112,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', ); } @@ -138,7 +138,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( @@ -147,7 +147,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', ); } @@ -486,7 +486,7 @@ function resolvePackageTargetString( if (pattern) { return new URL( - RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath) + RegExpPrototypeSymbolReplace(patternRegEx, resolved.href, () => subpath), ); } @@ -634,7 +634,7 @@ function packageExportsResolve( const target = exports[packageSubpath]; const resolveResult = resolvePackageTarget( packageJSONUrl, target, '', packageSubpath, base, false, false, false, - conditions + conditions, ); if (resolveResult == null) { @@ -733,7 +733,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; @@ -876,7 +876,7 @@ function packageResolve(specifier, base, conditions) { return legacyMainResolve( packageJSONUrl, packageConfig, - base + base, ); } @@ -1008,7 +1008,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.', ); } @@ -1019,14 +1019,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.', ); } } @@ -1081,7 +1081,7 @@ async function defaultResolve(specifier, context = {}) { reaction(new ERR_MANIFEST_DEPENDENCY_MISSING( parentURL, specifier, - ArrayPrototypeJoin([...conditions], ', ')) + ArrayPrototypeJoin([...conditions], ', ')), ); } } @@ -1154,7 +1154,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 @@ -1208,7 +1208,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. @@ -1216,8 +1216,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 6f25b2e67ab776..2df2228376452e 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js @@ -87,7 +87,7 @@ function assertBufferSource(body, allowString, hookName) { `${allowString ? 'string, ' : ''}array buffer, or typed array`, hookName, 'source', - body + body, ); } @@ -137,7 +137,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/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/observe.js b/lib/internal/perf/observe.js index d7f797d492085e..ca0b57a81bcc23 100644 --- a/lib/internal/perf/observe.js +++ b/lib/internal/perf/observe.js @@ -410,7 +410,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 062e1ba219bbe8..508e1802dbf47c 100644 --- a/lib/internal/policy/manifest.js +++ b/lib/internal/policy/manifest.js @@ -38,7 +38,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 { abort, exit, _rawDebug } = process; // #endregion @@ -138,7 +138,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]; @@ -192,7 +192,7 @@ class DependencyMapperInstance { const to = searchDependencies( this.href, dependencies[normalizedSpecifier], - conditions + conditions, ); debug({ to }); if (to === true) { @@ -217,7 +217,7 @@ class DependencyMapperInstance { if (parentDependencyMapper === undefined) { parentDependencyMapper = manifest.getScopeDependencyMapper( this.href, - this.allowSameHREFScope + this.allowSameHREFScope, ); this.#parentDependencyMapper = parentDependencyMapper; } @@ -227,7 +227,7 @@ class DependencyMapperInstance { return parentDependencyMapper._resolveAlreadyNormalized( normalizedSpecifier, conditions, - manifest + manifest, ); } } @@ -236,13 +236,13 @@ const kArbitraryDependencies = new DependencyMapperInstance( 'arbitrary dependencies', kFallThrough, false, - true + true, ); const kNoDependencies = new DependencyMapperInstance( 'no dependencies', null, false, - true + true, ); /** * @param {string} href @@ -256,7 +256,7 @@ const insertDependencyMap = ( dependencies, cascade, allowSameHREFScope, - store + store, ) => { if (cascade !== undefined && typeof cascade !== 'boolean') { throw new ERR_MANIFEST_INVALID_RESOURCE_FIELD(href, 'cascade'); @@ -270,7 +270,7 @@ const insertDependencyMap = ( href, cascade ? new DependencyMapperInstance(href, null, true, allowSameHREFScope) : - kNoDependencies + kNoDependencies, ); return; } @@ -281,8 +281,8 @@ const insertDependencyMap = ( href, dependencies, cascade, - allowSameHREFScope - ) + allowSameHREFScope, + ), ); return; } @@ -441,7 +441,7 @@ class Manifest { this.#reaction = reaction; const jsonResourcesEntries = ObjectEntries( - obj.resources ?? ObjectCreate(null) + obj.resources ?? ObjectCreate(null), ); const jsonScopesEntries = ObjectEntries(obj.scopes ?? ObjectCreate(null)); const defaultDependencies = obj.dependencies ?? ObjectCreate(null); @@ -449,7 +449,7 @@ class Manifest { this.#defaultDependencies = new DependencyMapperInstance( 'default', defaultDependencies === true ? kFallThrough : defaultDependencies, - false + false, ); for (let i = 0; i < jsonResourcesEntries.length; i++) { @@ -474,7 +474,7 @@ class Manifest { dependencies, cascade, true, - resourceDependencies + resourceDependencies, ); } @@ -518,12 +518,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; @@ -639,7 +639,7 @@ class Manifest { const scopeHREF = findScopeHREF( href, this.#scopeDependencies, - allowSameHREFScope + allowSameHREFScope, ); if (scopeHREF === null) return this.#defaultDependencies; return this.#scopeDependencies.get(scopeHREF); @@ -693,7 +693,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 eeb6ad77a7ec88..53c226463ba55e 100644 --- a/lib/internal/process/esm_loader.js +++ b/lib/internal/process/esm_loader.js @@ -96,7 +96,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 18c0abb40df4e4..0a09a11710a5ba 100644 --- a/lib/internal/process/per_thread.js +++ b/lib/internal/process/per_thread.js @@ -370,7 +370,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]), ); } @@ -398,7 +398,7 @@ function buildAllowedFlags() { ObjectFreeze(NodeEnvironmentFlagsSet.prototype); return ObjectFreeze(new NodeEnvironmentFlagsSet( - allowedNodeEnvironmentFlags + allowedNodeEnvironmentFlags, )); } diff --git a/lib/internal/process/promises.js b/lib/internal/process/promises.js index 421538373e0399..308337fa3dd5c4 100644 --- a/lib/internal/process/promises.js +++ b/lib/internal/process/promises.js @@ -129,7 +129,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 @@ -192,7 +192,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)) { @@ -249,7 +249,7 @@ function processPromiseRejections() { pushAsyncContext( promiseAsyncId, promiseTriggerAsyncId, - promise + promise, ); } try { @@ -263,7 +263,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 2e9d43626be402..72ee6f54948ae4 100644 --- a/lib/internal/readline/interface.js +++ b/lib/internal/readline/interface.js @@ -170,7 +170,7 @@ function InterfaceConstructor(input, output, completer, terminal) { } else { throw new ERR_INVALID_ARG_VALUE( 'input.escapeCodeTimeout', - this.escapeCodeTimeout + this.escapeCodeTimeout, ); } } @@ -632,7 +632,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; @@ -675,7 +675,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) { @@ -702,7 +702,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; @@ -743,7 +743,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); @@ -782,7 +782,7 @@ class Interface extends InterfaceConstructor { StringPrototypeSlice( this.line, this.cursor + charSize, - this.line.length + this.line.length, ); this[kRefreshLine](); } @@ -796,13 +796,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 + @@ -1080,7 +1080,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 bfcd51233ac786..b47a9d00c2fe09 100644 --- a/lib/internal/streams/duplexify.js +++ b/lib/internal/streams/duplexify.js @@ -108,7 +108,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/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 655a9d16dceead..a27e6ab35ea1d1 100644 --- a/lib/internal/test_runner/tap_lexer.js +++ b/lib/internal/test_runner/tap_lexer.js @@ -202,7 +202,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 c720c21261c82c..5d206337158c83 100644 --- a/lib/internal/test_runner/test.js +++ b/lib/internal/test_runner/test.js @@ -78,7 +78,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, ); }); } @@ -228,7 +228,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) { @@ -376,8 +376,8 @@ class Test extends AsyncResource { test.fail( new ERR_TEST_FAILURE( 'test could not be started because its parent finished', - kParentAlreadyFinished - ) + kParentAlreadyFinished, + ), ); } @@ -399,8 +399,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; @@ -536,7 +536,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 e5ba57b055fecb..6d0b58c5325f67 100644 --- a/lib/internal/test_runner/utils.js +++ b/lib/internal/test_runner/utils.js @@ -51,7 +51,7 @@ function createDeferredCallback() { if (calledCount === 2) { throw new ERR_TEST_FAILURE( 'callback invoked multiple times', - kMultipleCallbackInvocations + kMultipleCallbackInvocations, ); } @@ -85,7 +85,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 32a33b81f79ad2..f303a2d109fcbc 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -278,7 +278,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` + @@ -1375,7 +1375,7 @@ defineIDLClass(URLSearchParamsIteratorPrototype, 'URLSearchParams Iterator', { } return prev; }, - [] + [], ); const breakLn = StringPrototypeIncludes(inspect(output, innerOpts), '\n'); const outputStrs = ArrayPrototypeMap(output, (p) => inspect(p, innerOpts)); @@ -1439,7 +1439,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', ); } } @@ -1475,7 +1475,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', ); } } @@ -1534,14 +1534,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 2379f3679a1f5b..9a4267edc30336 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -168,8 +168,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 @@ -808,7 +808,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. @@ -862,7 +862,7 @@ function formatRaw(ctx, value, recurseTimes, typedArray) { (ctx.showHidden ? ObjectPrototypeHasOwnProperty : ObjectPrototypePropertyIsEnumerable)( - value, SymbolToStringTag + value, SymbolToStringTag, ))) { tag = ''; } @@ -962,7 +962,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 ') @@ -1469,8 +1469,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), @@ -1478,7 +1478,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) { @@ -1543,7 +1543,7 @@ function handleMaxCallStackSize(ctx, err, constructorName, indentationLvl) { return ctx.stylize( `[${constructorName}: Inspection interrupted ` + 'prematurely. Maximum call stack size exceeded.]', - 'special' + 'special', ); } /* c8 ignore next */ @@ -1596,7 +1596,7 @@ function formatNumber(fn, number, numericSeparator) { addNumericSeparator(string) }.${ addNumericSeparatorEnd( - StringPrototypeSlice(String(number), string.length + 1) + StringPrototypeSlice(String(number), string.length + 1), ) }`, 'number'); } @@ -1797,7 +1797,7 @@ function formatMap(value, ctx, ignored, recurseTimes) { for (const { 0: k, 1: v } of value) { ArrayPrototypePush( output, - `${formatValue(ctx, k, recurseTimes)} => ${formatValue(ctx, v, recurseTimes)}` + `${formatValue(ctx, k, recurseTimes)} => ${formatValue(ctx, v, recurseTimes)}`, ); } ctx.indentationLvl -= 2; @@ -1960,7 +1960,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__') { @@ -2139,7 +2139,7 @@ function formatNumberNoColor(number, options) { return formatNumber( stylizeNoColor, number, - options?.numericSeparator ?? inspectDefaultOptions.numericSeparator + options?.numericSeparator ?? inspectDefaultOptions.numericSeparator, ); } @@ -2147,7 +2147,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 b3e7ceaabf7fdf..99d23d8647dd27 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 ad1621dac966e3..de9d500e9e794a 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"', ); } } @@ -510,7 +510,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 0e2e275aa3c1a5..4f87ce87cc29a2 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 7c0890c967ebc6..ff70c51fe78f8d 100644 --- a/lib/internal/vm/module.js +++ b/lib/internal/vm/module.js @@ -220,7 +220,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 377eb02a348eaf..0b48b0b2fc2ec9 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 fe1202ec00bce3..73b9ddf141941e 100644 --- a/lib/internal/webstreams/util.js +++ b/lib/internal/webstreams/util.js @@ -118,7 +118,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 8e396195209b83..1a8bddfb2b5fe9 100644 --- a/lib/internal/worker.js +++ b/lib/internal/worker.js @@ -137,7 +137,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; @@ -155,7 +155,7 @@ class Worker extends EventEmitter { throw new ERR_INVALID_ARG_TYPE( 'filename', ['string', 'URL'], - filename + filename, ); } else if (path.isAbsolute(filename) || RegExpPrototypeExec(/^\.\.?[\\/]/, filename) !== null) { @@ -171,7 +171,7 @@ class Worker extends EventEmitter { env = ObjectCreate(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; diff --git a/lib/net.js b/lib/net.js index 412dd66d209556..57e6dca068cdfa 100644 --- a/lib/net.js +++ b/lib/net.js @@ -174,13 +174,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, ); } @@ -341,7 +341,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( @@ -349,12 +349,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) { @@ -540,7 +540,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); @@ -1187,7 +1187,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); @@ -1250,7 +1250,7 @@ function lookupAndConnect(self, options) { defaultTriggerAsyncIdScope( self[async_id_symbol], internalConnect, - self, host, port, addressType, localAddress, localPort + self, host, port, addressType, localAddress, localPort, ); }); return; @@ -1290,7 +1290,7 @@ function lookupAndConnect(self, options) { dnsopts, port, localPort, - autoSelectFamilyAttemptTimeout + autoSelectFamilyAttemptTimeout, ); return; @@ -1323,7 +1323,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 711a85497885fc..f2ec5e246cc111 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -154,7 +154,7 @@ const { validateObject, } = require('internal/validators'); const experimentalREPLAwait = getOptionValue( - '--experimental-repl-await' + '--experimental-repl-await', ); const pendingDeprecation = getOptionValue('--pending-deprecation'); const { @@ -654,7 +654,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); @@ -699,7 +699,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), ); } } @@ -840,7 +840,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 { @@ -974,7 +974,7 @@ function REPLServer(prompt, this, kContextId, kBufferedCommandSymbol, - preview + preview, ); // Wrap readline tty to enable editor mode and pausing. @@ -1058,13 +1058,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, []), ); }; @@ -1276,9 +1276,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]; @@ -1360,7 +1360,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}`); } @@ -1555,7 +1555,7 @@ function complete(line, callback) { // behavior. return StringPrototypeStartsWith( StringPrototypeToLocaleLowerCase(str), - lowerCaseFilter + lowerCaseFilter, ); }); if (filteredGroup.length) { @@ -1749,7 +1749,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]; @@ -1790,7 +1790,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 { @@ -1839,12 +1839,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/vm.js b/lib/vm.js index ec91c8a2651775..71d4209d835e16 100644 --- a/lib/vm.js +++ b/lib/vm.js @@ -88,7 +88,7 @@ class Script extends ContextifyScript { throw new ERR_INVALID_ARG_TYPE( 'options.cachedData', ['Buffer', 'TypedArray', 'DataView'], - cachedData + cachedData, ); } validateBoolean(produceCachedData, 'options.produceCachedData'); 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);