diff --git a/doc/api/http2.md b/doc/api/http2.md index e523bc13f20ea6..8df14ab04a6ba3 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -3640,7 +3640,8 @@ will be emitted. const body = 'hello world'; response.writeHead(200, { 'Content-Length': Buffer.byteLength(body), - 'Content-Type': 'text/plain; charset=utf-8' }); + 'Content-Type': 'text/plain; charset=utf-8', +}); ``` `Content-Length` is given in bytes not characters. The diff --git a/lib/internal/async_hooks.js b/lib/internal/async_hooks.js index a9c5a171c73447..71ffd26396b590 100644 --- a/lib/internal/async_hooks.js +++ b/lib/internal/async_hooks.js @@ -91,9 +91,10 @@ const { resource_symbol, owner_symbol } = internalBinding('symbols'); // Each constant tracks how many callbacks there are for any given step of // async execution. These are tracked so if the user didn't include callbacks // for a given step, that step can bail out early. -const { kInit, kBefore, kAfter, kDestroy, kTotals, kPromiseResolve, - kCheck, kExecutionAsyncId, kAsyncIdCounter, kTriggerAsyncId, - kDefaultTriggerAsyncId, kStackLength, kUsesExecutionAsyncResource +const { + kInit, kBefore, kAfter, kDestroy, kTotals, kPromiseResolve, + kCheck, kExecutionAsyncId, kAsyncIdCounter, kTriggerAsyncId, + kDefaultTriggerAsyncId, kStackLength, kUsesExecutionAsyncResource, } = async_wrap.constants; const { async_id_symbol, diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js index 17d83cc6b26c67..8f1cd57ade8e9f 100644 --- a/lib/internal/encoding.js +++ b/lib/internal/encoding.js @@ -364,10 +364,8 @@ ObjectDefineProperties( 'encode': { enumerable: true }, 'encodeInto': { enumerable: true }, 'encoding': { enumerable: true }, - [SymbolToStringTag]: { - configurable: true, - value: 'TextEncoder' - } }); + [SymbolToStringTag]: { configurable: true, value: 'TextEncoder' }, + }); const TextDecoder = internalBinding('config').hasIntl ? diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 7314e3a8365c2d..cca254be3f8559 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -108,9 +108,10 @@ const { } = require('internal/validators'); const fsPromisesInternal = require('internal/fs/promises'); const { utcDate } = require('internal/http'); -const { onServerStream, - Http2ServerRequest, - Http2ServerResponse, +const { + Http2ServerRequest, + Http2ServerResponse, + onServerStream, } = require('internal/http2/compat'); const { diff --git a/test/doctool/test-doctool-json.js b/test/doctool/test-doctool-json.js index 2767b48ef2104b..84c2d8f65230d5 100644 --- a/test/doctool/test-doctool-json.js +++ b/test/doctool/test-doctool-json.js @@ -121,8 +121,7 @@ const testData = [ { 'version': 'v4.2.0', 'pr-url': 'https://github.com/nodejs/node/pull/3276', 'description': 'The `error` parameter can now be ' + - 'an arrow function.' - } + 'an arrow function.' } ] }, desc: '

Describe Foobar II in more detail ' + diff --git a/test/node-api/test_threadsafe_function/test.js b/test/node-api/test_threadsafe_function/test.js index ccd3f4228a793a..ff8a7d80849079 100644 --- a/test/node-api/test_threadsafe_function/test.js +++ b/test/node-api/test_threadsafe_function/test.js @@ -36,7 +36,8 @@ function testWithJSMarshaller({ quitAfter, abort, maxQueueSize, - launchSecondary }) { + launchSecondary, +}) { return new Promise((resolve) => { const array = []; binding[threadStarter](function testCallback(value) { diff --git a/test/parallel/test-dns.js b/test/parallel/test-dns.js index 09fd02c3f148d6..796d0d12da1337 100644 --- a/test/parallel/test-dns.js +++ b/test/parallel/test-dns.js @@ -362,18 +362,15 @@ assert.throws(() => { expire: 1800, minttl: 3333333333 }, - ] - }, + ] }, { method: 'resolve4', options: { ttl: true }, - answers: [ { type: 'A', address: '1.2.3.4', ttl: 3333333333 } ] - }, + answers: [ { type: 'A', address: '1.2.3.4', ttl: 3333333333 } ] }, { method: 'resolve6', options: { ttl: true }, - answers: [ { type: 'AAAA', address: '::42', ttl: 3333333333 } ] - }, + answers: [ { type: 'AAAA', address: '::42', ttl: 3333333333 } ] }, { method: 'resolveSoa', answers: [ @@ -387,8 +384,7 @@ assert.throws(() => { expire: 1800, minttl: 3333333333 } - ] - }, + ] }, ]; const server = dgram.createSocket('udp4'); diff --git a/test/parallel/test-fs-open-flags.js b/test/parallel/test-fs-open-flags.js index 00922e260c69c0..8b2eddffbe0a92 100644 --- a/test/parallel/test-fs-open-flags.js +++ b/test/parallel/test-fs-open-flags.js @@ -38,8 +38,7 @@ const { O_APPEND = 0, O_SYNC = 0, O_DSYNC = 0, O_TRUNC = 0, - O_WRONLY = 0 -} = fs.constants; + O_WRONLY = 0 } = fs.constants; const { stringToFlags } = require('internal/fs/utils'); diff --git a/test/parallel/test-fs-readfile.js b/test/parallel/test-fs-readfile.js index 9be20d1a003de0..f31d356291fa4c 100644 --- a/test/parallel/test-fs-readfile.js +++ b/test/parallel/test-fs-readfile.js @@ -16,20 +16,15 @@ tmpdir.refresh(); const fileInfo = [ { name: path.join(tmpdir.path, `${prefix}-1K.txt`), - len: 1024, - }, + len: 1024 }, { name: path.join(tmpdir.path, `${prefix}-64K.txt`), - len: 64 * 1024, - }, + len: 64 * 1024 }, { name: path.join(tmpdir.path, `${prefix}-64KLessOne.txt`), - len: (64 * 1024) - 1, - }, + len: (64 * 1024) - 1 }, { name: path.join(tmpdir.path, `${prefix}-1M.txt`), - len: 1 * 1024 * 1024, - }, + len: 1 * 1024 * 1024 }, { name: path.join(tmpdir.path, `${prefix}-1MPlusOne.txt`), - len: (1 * 1024 * 1024) + 1, - }, + len: (1 * 1024 * 1024) + 1 }, ]; // Populate each fileInfo (and file) with unique fill. diff --git a/test/parallel/test-http2-max-settings.js b/test/parallel/test-http2-max-settings.js index 2eae223d21bcc7..0ae792855ae3d5 100644 --- a/test/parallel/test-http2-max-settings.js +++ b/test/parallel/test-http2-max-settings.js @@ -27,7 +27,8 @@ server.listen(0, common.mustCall(() => { // The actual settings values do not matter. headerTableSize: 1000, enablePush: false, - } }); + }, + }); client.on('error', common.mustCall(() => { server.close(); diff --git a/test/parallel/test-inspector-esm.js b/test/parallel/test-inspector-esm.js index b9813e50c29ded..da3bd17e33f4bc 100644 --- a/test/parallel/test-inspector-esm.js +++ b/test/parallel/test-inspector-esm.js @@ -48,15 +48,14 @@ async function testBreakpoint(session) { 'params': { 'lineNumber': 7, 'url': session.scriptURL(), 'columnNumber': 0, - 'condition': '' - } - }, + 'condition': '' } }, { 'method': 'Debugger.resume' }, ]; await session.send(commands); const { scriptSource } = await session.send({ 'method': 'Debugger.getScriptSource', - 'params': { 'scriptId': session.mainScriptId } }); + 'params': { 'scriptId': session.mainScriptId }, + }); assert(scriptSource && (scriptSource.includes(session.script())), `Script source is wrong: ${scriptSource}`); diff --git a/test/parallel/test-npm-install.js b/test/parallel/test-npm-install.js index 17deacdbc14d2a..d3ba8ab8b55561 100644 --- a/test/parallel/test-npm-install.js +++ b/test/parallel/test-npm-install.js @@ -44,8 +44,7 @@ const env = { ...process.env, NPM_CONFIG_TMP: path.join(npmSandbox, 'npm-tmp'), NPM_CONFIG_AUDIT: false, NPM_CONFIG_UPDATE_NOTIFIER: false, - HOME: homeDir, -}; + HOME: homeDir }; exec(`${process.execPath} ${npmPath} install`, { cwd: installDir, diff --git a/test/parallel/test-path-parse-format.js b/test/parallel/test-path-parse-format.js index 97c7227ac7e0eb..cd1e84eae05790 100644 --- a/test/parallel/test-path-parse-format.js +++ b/test/parallel/test-path-parse-format.js @@ -132,8 +132,7 @@ const trailingTests = [ dir: 'D:\\foo\\\\', base: 'bar.baz', ext: '.baz', - name: 'bar' - } + name: 'bar' } ] ] ], diff --git a/test/parallel/test-process-env-allowed-flags-are-documented.js b/test/parallel/test-process-env-allowed-flags-are-documented.js index 6f4537bd3e88fa..1c91444d65509a 100644 --- a/test/parallel/test-process-env-allowed-flags-are-documented.js +++ b/test/parallel/test-process-env-allowed-flags-are-documented.js @@ -41,12 +41,13 @@ for (const line of [...nodeOptionsLines, ...v8OptionsLines]) { // Filter out options that are conditionally present. const conditionalOpts = [ - { include: common.hasCrypto, + { + include: common.hasCrypto, filter: (opt) => { return ['--openssl-config', '--tls-cipher-list', '--use-bundled-ca', '--use-openssl-ca' ].includes(opt); - } }, - { + } + }, { // We are using openssl_is_fips from the configuration because it could be // the case that OpenSSL is FIPS compatible but fips has not been enabled // (starting node with --enable-fips). If we use common.hasFipsCrypto @@ -54,11 +55,14 @@ const conditionalOpts = [ // want to check options which will be available regardless of whether fips // is enabled at runtime or not. include: process.config.variables.openssl_is_fips, - filter: (opt) => opt.includes('-fips') }, - { include: common.hasIntl, - filter: (opt) => opt === '--icu-data-dir' }, - { include: process.features.inspector, - filter: (opt) => opt.startsWith('--inspect') || opt === '--debug-port' }, + filter: (opt) => opt.includes('-fips') + }, { + include: common.hasIntl, + filter: (opt) => opt === '--icu-data-dir' + }, { + include: process.features.inspector, + filter: (opt) => opt.startsWith('--inspect') || opt === '--debug-port' + }, ]; documented.forEach((opt) => { conditionalOpts.forEach(({ include, filter }) => { diff --git a/test/parallel/test-readline-interface.js b/test/parallel/test-readline-interface.js index 4fa633758b769a..80e3063fe33bb3 100644 --- a/test/parallel/test-readline-interface.js +++ b/test/parallel/test-readline-interface.js @@ -53,7 +53,8 @@ function getInterface(options) { const rli = new readline.Interface({ input: fi, output: fi, - ...options }); + ...options, + }); return [rli, fi]; } diff --git a/test/parallel/test-stdin-script-child.js b/test/parallel/test-stdin-script-child.js index 7e73d82bfb5ab9..cf83b278acd6d3 100644 --- a/test/parallel/test-stdin-script-child.js +++ b/test/parallel/test-stdin-script-child.js @@ -6,8 +6,7 @@ const { spawn } = require('child_process'); for (const args of [[], ['-']]) { const child = spawn(process.execPath, args, { env: { ...process.env, - NODE_DEBUG: process.argv[2] - } + NODE_DEBUG: process.argv[2] } }); const wanted = `${child.pid}\n`; let found = ''; diff --git a/test/parallel/test-tls-check-server-identity.js b/test/parallel/test-tls-check-server-identity.js index 04c77305eb3b89..deeeecdec9ec50 100644 --- a/test/parallel/test-tls-check-server-identity.js +++ b/test/parallel/test-tls-check-server-identity.js @@ -124,12 +124,13 @@ const tests = [ cert: { subject: { CN: '*n.b.com' } }, error: 'Host: \n.b.com. is not cert\'s CN: *n.b.com' }, - { host: 'b.a.com', cert: { - subjectaltname: 'DNS:omg.com', - subject: { CN: '*.a.com' } }, + { host: 'b.a.com', + cert: { + subjectaltname: 'DNS:omg.com', + subject: { CN: '*.a.com' }, + }, error: 'Host: b.a.com. is not in the cert\'s altnames: ' + - 'DNS:omg.com' - }, + 'DNS:omg.com' }, { host: 'b.a.com', cert: { subject: { CN: 'b*b.a.com' } }, diff --git a/test/parallel/test-tls-client-verify.js b/test/parallel/test-tls-client-verify.js index 12d2514eed3a89..e584c51cf20746 100644 --- a/test/parallel/test-tls-client-verify.js +++ b/test/parallel/test-tls-client-verify.js @@ -36,8 +36,7 @@ const testCases = [ { ok: true, key: 'agent1-key', cert: 'agent1-cert' }, { ok: false, key: 'agent2-key', cert: 'agent2-cert' }, { ok: false, key: 'agent3-key', cert: 'agent3-cert' } - ] - }, + ] }, { ca: [], key: 'agent2-key', @@ -46,8 +45,7 @@ const testCases = [ { ok: false, key: 'agent1-key', cert: 'agent1-cert' }, { ok: false, key: 'agent2-key', cert: 'agent2-cert' }, { ok: false, key: 'agent3-key', cert: 'agent3-cert' } - ] - }, + ] }, { ca: ['ca1-cert', 'ca2-cert'], key: 'agent2-key', @@ -56,8 +54,7 @@ const testCases = [ { ok: true, key: 'agent1-key', cert: 'agent1-cert' }, { ok: false, key: 'agent2-key', cert: 'agent2-cert' }, { ok: true, key: 'agent3-key', cert: 'agent3-cert' } - ] - } + ] } ]; diff --git a/test/parallel/test-tls-server-verify.js b/test/parallel/test-tls-server-verify.js index da47d93c7613b5..fe525b2fd1d5af 100644 --- a/test/parallel/test-tls-server-verify.js +++ b/test/parallel/test-tls-server-verify.js @@ -54,8 +54,7 @@ const testCases = { name: 'agent2', shouldReject: false, shouldAuth: false }, { name: 'agent3', shouldReject: false, shouldAuth: false }, { name: 'nocert', shouldReject: false, shouldAuth: false } - ] - }, + ] }, { title: 'Allow both authed and unauthed connections with CA1', requestCert: true, @@ -67,8 +66,7 @@ const testCases = { name: 'agent2', shouldReject: false, shouldAuth: false }, { name: 'agent3', shouldReject: false, shouldAuth: false }, { name: 'nocert', shouldReject: false, shouldAuth: false } - ] - }, + ] }, { title: 'Do not request certs at connection. Do that later', requestCert: false, @@ -80,8 +78,7 @@ const testCases = { name: 'agent2', shouldReject: false, shouldAuth: false }, { name: 'agent3', shouldReject: false, shouldAuth: false }, { name: 'nocert', shouldReject: false, shouldAuth: false } - ] - }, + ] }, { title: 'Allow only authed connections with CA1', requestCert: true, @@ -93,8 +90,7 @@ const testCases = { name: 'agent2', shouldReject: true }, { name: 'agent3', shouldReject: true }, { name: 'nocert', shouldReject: true } - ] - }, + ] }, { title: 'Allow only authed connections with CA1 and CA2', requestCert: true, @@ -106,8 +102,7 @@ const testCases = { name: 'agent2', shouldReject: true }, { name: 'agent3', shouldReject: false, shouldAuth: true }, { name: 'nocert', shouldReject: true } - ] - }, + ] }, { title: 'Allow only certs signed by CA2 but not in the CRL', @@ -123,8 +118,7 @@ const testCases = // Agent4 has a cert in the CRL. { name: 'agent4', shouldReject: true, shouldAuth: false }, { name: 'nocert', shouldReject: true } - ] - } + ] } ]; function filenamePEM(n) { diff --git a/test/parallel/test-trace-events-async-hooks-dynamic.js b/test/parallel/test-trace-events-async-hooks-dynamic.js index b660f7f8d49ee8..a1b59d48c03875 100644 --- a/test/parallel/test-trace-events-async-hooks-dynamic.js +++ b/test/parallel/test-trace-events-async-hooks-dynamic.js @@ -31,8 +31,7 @@ const proc = cp.spawnSync( cwd: tmpdir.path, env: { ...process.env, 'NODE_DEBUG_NATIVE': 'tracing', - 'NODE_DEBUG': 'tracing' - } + 'NODE_DEBUG': 'tracing' } }); console.log('process exit with signal:', proc.signal); diff --git a/test/parallel/test-trace-events-async-hooks-worker.js b/test/parallel/test-trace-events-async-hooks-worker.js index 185f310f89e13a..7807a29925ca11 100644 --- a/test/parallel/test-trace-events-async-hooks-worker.js +++ b/test/parallel/test-trace-events-async-hooks-worker.js @@ -38,8 +38,7 @@ const proc = cp.spawnSync( cwd: tmpdir.path, env: { ...process.env, 'NODE_DEBUG_NATIVE': 'tracing', - 'NODE_DEBUG': 'tracing' - } + 'NODE_DEBUG': 'tracing' } }); console.log('process exit with signal:', proc.signal); diff --git a/test/sequential/test-inspector-break-when-eval.js b/test/sequential/test-inspector-break-when-eval.js index 7a834e9934b1ab..0dd66588ed23b9 100644 --- a/test/sequential/test-inspector-break-when-eval.js +++ b/test/sequential/test-inspector-break-when-eval.js @@ -36,9 +36,7 @@ async function breakOnLine(session) { 'params': { 'lineNumber': 9, 'url': pathToFileURL(script).toString(), 'columnNumber': 0, - 'condition': '' - } - }, + 'condition': '' } }, { 'method': 'Runtime.evaluate', 'params': { 'expression': 'sum()', 'objectGroup': 'console', @@ -48,9 +46,7 @@ async function breakOnLine(session) { 'returnByValue': false, 'generatePreview': true, 'userGesture': true, - 'awaitPromise': false - } - } + 'awaitPromise': false } } ]; session.send(commands); await session.waitForBreakOnLine(9, pathToFileURL(script).toString()); diff --git a/test/sequential/test-inspector-port-cluster.js b/test/sequential/test-inspector-port-cluster.js index 0b950df64e17ec..2d1534fc959f59 100644 --- a/test/sequential/test-inspector-port-cluster.js +++ b/test/sequential/test-inspector-port-cluster.js @@ -330,8 +330,7 @@ function spawnMaster({ execArgv, workers, clusterSettings = {} }) { env: { ...process.env, workers: JSON.stringify(workers), clusterSettings: JSON.stringify(clusterSettings), - testProcess: true - }, + testProcess: true }, execArgv: execArgv.concat(['--expose-internals']) }).on('exit', common.mustCall((code, signal) => { checkExitCode(code, signal); diff --git a/test/sequential/test-inspector.js b/test/sequential/test-inspector.js index b58d70c864263a..d1fa08a35f9561 100644 --- a/test/sequential/test-inspector.js +++ b/test/sequential/test-inspector.js @@ -86,15 +86,14 @@ async function testBreakpoint(session) { 'params': { 'lineNumber': 5, 'url': session.scriptURL(), 'columnNumber': 0, - 'condition': '' - } - }, + 'condition': '' } }, { 'method': 'Debugger.resume' }, ]; await session.send(commands); const { scriptSource } = await session.send({ 'method': 'Debugger.getScriptSource', - 'params': { 'scriptId': session.mainScriptId } }); + 'params': { 'scriptId': session.mainScriptId }, + }); assert(scriptSource && (scriptSource.includes(session.script())), `Script source is wrong: ${scriptSource}`); diff --git a/test/sequential/test-stream2-stderr-sync.js b/test/sequential/test-stream2-stderr-sync.js index 7384cf6e74f502..db0ed180edc51b 100644 --- a/test/sequential/test-stream2-stderr-sync.js +++ b/test/sequential/test-stream2-stderr-sync.js @@ -67,7 +67,8 @@ function child2() { const socket = new net.Socket({ fd: 2, readable: false, - writable: true }); + writable: true, + }); socket.write('child 2\n'); socket.write('foo\n'); socket.write('bar\n');