From 958ba5e7d0e3322ad3a595f9f21f082176d12ae9 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 13 May 2019 20:59:13 +0200 Subject: [PATCH 1/4] doc: update comments to use capital letters --- benchmark/fixtures/simple-http-server.js | 2 +- doc/api/console.md | 2 +- doc/api/punycode.md | 4 ++-- doc/api/util.md | 2 +- lib/_http_client.js | 2 +- lib/internal/freeze_intrinsics.js | 2 +- lib/internal/fs/sync_write_stream.js | 2 +- lib/internal/fs/utils.js | 2 +- lib/internal/readline.js | 2 +- lib/readline.js | 4 ++-- lib/url.js | 2 +- test/async-hooks/test-ttywrap.readstream.js | 2 +- test/async-hooks/test-ttywrap.writestream.js | 2 +- test/message/undefined_reference_in_new_context.js | 2 +- test/parallel/test-buffer-includes.js | 2 +- test/parallel/test-buffer-indexof.js | 2 +- test/parallel/test-child-process-no-deprecation.js | 2 +- .../parallel/test-child-process-stdout-flush-exit.js | 2 +- test/parallel/test-fs-utimes.js | 2 +- test/parallel/test-module-version.js | 2 +- test/parallel/test-os.js | 2 +- test/parallel/test-readline-interface.js | 2 +- test/parallel/test-repl-pretty-custom-stack.js | 2 +- test/parallel/test-tls-alpn-server-client.js | 12 ++++++------ test/parallel/test-tls-handshake-nohang.js | 2 +- test/parallel/test-tls-inception.js | 2 +- test/sequential/test-cli-syntax-file-not-found.js | 2 +- test/sequential/test-stream2-stderr-sync.js | 2 +- 28 files changed, 35 insertions(+), 35 deletions(-) diff --git a/benchmark/fixtures/simple-http-server.js b/benchmark/fixtures/simple-http-server.js index 2b4f1ea956d7..794815c270c6 100644 --- a/benchmark/fixtures/simple-http-server.js +++ b/benchmark/fixtures/simple-http-server.js @@ -127,7 +127,7 @@ module.exports = http.createServer((req, res) => { }); } } - // send body in chunks + // Send body in chunks if (n_chunks > 1) { const step = Math.floor(len / n_chunks) || 1; for (i = 0, n = (n_chunks - 1); i < n; ++i) diff --git a/doc/api/console.md b/doc/api/console.md index a8369290dfbf..3f2d1b683086 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -116,7 +116,7 @@ const output = fs.createWriteStream('./stdout.log'); const errorOutput = fs.createWriteStream('./stderr.log'); // Custom simple logger const logger = new Console({ stdout: output, stderr: errorOutput }); -// use it like console +// Use it like console const count = 5; logger.log('count: %d', count); // In stdout.log: count 5 diff --git a/doc/api/punycode.md b/doc/api/punycode.md index b8a3b7d629f9..be32c3784ee1 100644 --- a/doc/api/punycode.md +++ b/doc/api/punycode.md @@ -80,7 +80,7 @@ domain name will be converted. Calling `punycode.toASCII()` on a string that already only contains ASCII characters will have no effect. ```js -// encode domain names +// Encode domain names punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' punycode.toASCII('example.com'); // 'example.com' @@ -98,7 +98,7 @@ containing [Punycode][] encoded characters into Unicode. Only the [Punycode][] encoded parts of the domain name are be converted. ```js -// decode domain names +// Decode domain names punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' punycode.toUnicode('example.com'); // 'example.com' diff --git a/doc/api/util.md b/doc/api/util.md index c0b909d438d1..eca0bfb42d3e 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -770,7 +770,7 @@ const arr = Array(101).fill(0); console.log(arr); // Logs the truncated array util.inspect.defaultOptions.maxArrayLength = null; -console.log(arr); // logs the full array +console.log(arr); // Logs the full array ``` ## util.isDeepStrictEqual(val1, val2) diff --git a/lib/_http_client.js b/lib/_http_client.js index 75c86acf2c51..7f13cab21524 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -269,7 +269,7 @@ function ClientRequest(input, options, cb) { this._deferToConnect(null, null, () => this._flush()); }; - // initiate connection + // Initiate connection if (this.agent) { this.agent.addRequest(this, options); } else { diff --git a/lib/internal/freeze_intrinsics.js b/lib/internal/freeze_intrinsics.js index 753fb00acbcc..c70811f6845b 100644 --- a/lib/internal/freeze_intrinsics.js +++ b/lib/internal/freeze_intrinsics.js @@ -218,7 +218,7 @@ module.exports = function() { // this is a data property. const desc = descs[name]; if ('value' in desc) { - // todo uncurried form + // TODO: Uncurried form enqueue(desc.value); } else { enqueue(desc.get); diff --git a/lib/internal/fs/sync_write_stream.js b/lib/internal/fs/sync_write_stream.js index 522bfc829df3..509dcdbdbf57 100644 --- a/lib/internal/fs/sync_write_stream.js +++ b/lib/internal/fs/sync_write_stream.js @@ -25,7 +25,7 @@ SyncWriteStream.prototype._write = function(chunk, encoding, cb) { }; SyncWriteStream.prototype._destroy = function(err, cb) { - if (this.fd === null) // already destroy()ed + if (this.fd === null) // Already destroy()ed return cb(err); if (this.autoClose) diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index dde78654e0f9..0d871988d13e 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -447,7 +447,7 @@ function warnOnNonPortableTemplate(template) { // This handles errors following the convention of the fs binding. function handleErrorFromBinding(ctx) { - if (ctx.errno !== undefined) { // libuv error numbers + if (ctx.errno !== undefined) { // Libuv error numbers const err = uvException(ctx); // eslint-disable-next-line no-restricted-syntax Error.captureStackTrace(err, handleErrorFromBinding); diff --git a/lib/internal/readline.js b/lib/internal/readline.js index a5611942977d..febda517baf2 100644 --- a/lib/internal/readline.js +++ b/lib/internal/readline.js @@ -392,7 +392,7 @@ function* emitKeys(stream) { // tab key.name = 'tab'; } else if (ch === '\b' || ch === '\x7f') { - // backspace or ctrl+h + // Backspace or ctrl+h key.name = 'backspace'; key.meta = escaped; } else if (ch === kEscape) { diff --git a/lib/readline.js b/lib/readline.js index c8d0a8040ad9..d9619a9056ef 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -885,7 +885,7 @@ Interface.prototype._ttyWrite = function(s, key) { this._deleteLeft(); break; - case 'd': // delete right or EOF + case 'd': // Delete right or EOF if (this.cursor === 0 && this.line.length === 0) { // This readline instance is finished this.close(); @@ -988,7 +988,7 @@ Interface.prototype._ttyWrite = function(s, key) { this._wordRight(); break; - case 'd': // delete forward word + case 'd': // Delete forward word case 'delete': this._deleteWordRight(); break; diff --git a/lib/url.js b/lib/url.js index 665bd4361488..37f39f647fc8 100644 --- a/lib/url.js +++ b/lib/url.js @@ -280,7 +280,7 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) { if (!hostlessProtocol.has(lowerProto) && (slashes || (proto && !slashedProtocol.has(proto)))) { - // there's a hostname. + // There's a hostname. // the first instance of /, ?, ;, or # ends the host. // // If there is an @ in the hostname, then non-host chars *are* allowed diff --git a/test/async-hooks/test-ttywrap.readstream.js b/test/async-hooks/test-ttywrap.readstream.js index e6fb3cdc28a4..78d401191b90 100644 --- a/test/async-hooks/test-ttywrap.readstream.js +++ b/test/async-hooks/test-ttywrap.readstream.js @@ -14,7 +14,7 @@ hooks.enable(); if (!process.stdin.isTTY) return common.skip('no valid readable TTY available'); -// test specific setup +// Test specific setup const checkInitOpts = { init: 1 }; const checkEndedOpts = { init: 1, before: 1, after: 1, destroy: 1 }; diff --git a/test/async-hooks/test-ttywrap.writestream.js b/test/async-hooks/test-ttywrap.writestream.js index bcc164c659be..29d7d28826d6 100644 --- a/test/async-hooks/test-ttywrap.writestream.js +++ b/test/async-hooks/test-ttywrap.writestream.js @@ -14,7 +14,7 @@ hooks.enable(); if (!process.stdout.isTTY) return common.skip('no valid writable TTY available'); -// test specific setup +// Test specific setup const checkInitOpts = { init: 1 }; const checkEndedOpts = { init: 1, before: 1, after: 1, destroy: 1 }; diff --git a/test/message/undefined_reference_in_new_context.js b/test/message/undefined_reference_in_new_context.js index 7cb68ec5b3b3..d3d2cddf7c85 100644 --- a/test/message/undefined_reference_in_new_context.js +++ b/test/message/undefined_reference_in_new_context.js @@ -25,7 +25,7 @@ const vm = require('vm'); console.error('before'); -// undefined reference +// Undefined reference vm.runInNewContext('foo.bar = 5;'); console.error('after'); diff --git a/test/parallel/test-buffer-includes.js b/test/parallel/test-buffer-includes.js index ca5b94f9d9fa..79e3332e4e3f 100644 --- a/test/parallel/test-buffer-includes.js +++ b/test/parallel/test-buffer-includes.js @@ -100,7 +100,7 @@ assert.strictEqual( true ); -// test ascii encoding +// Test ascii encoding assert.strictEqual( Buffer.from(b.toString('ascii'), 'ascii') .includes('d', 0, 'ascii'), diff --git a/test/parallel/test-buffer-indexof.js b/test/parallel/test-buffer-indexof.js index 3f0449ceb084..3c3c9e8a659c 100644 --- a/test/parallel/test-buffer-indexof.js +++ b/test/parallel/test-buffer-indexof.js @@ -108,7 +108,7 @@ assert.strictEqual( 3 ); -// test ascii encoding +// Test ascii encoding assert.strictEqual( Buffer.from(b.toString('ascii'), 'ascii') .indexOf('d', 0, 'ascii'), diff --git a/test/parallel/test-child-process-no-deprecation.js b/test/parallel/test-child-process-no-deprecation.js index d12e5b882f63..8adecde21005 100644 --- a/test/parallel/test-child-process-no-deprecation.js +++ b/test/parallel/test-child-process-no-deprecation.js @@ -8,7 +8,7 @@ if (process.argv[2] === 'child') { // parent process const spawn = require('child_process').spawn; - // spawn self as child + // Spawn self as child const child = spawn(process.execPath, [process.argv[1], 'child']); child.stderr.on('data', common.mustNotCall()); diff --git a/test/parallel/test-child-process-stdout-flush-exit.js b/test/parallel/test-child-process-stdout-flush-exit.js index cc1fa83fa9aa..231071ab81f8 100644 --- a/test/parallel/test-child-process-stdout-flush-exit.js +++ b/test/parallel/test-child-process-stdout-flush-exit.js @@ -35,7 +35,7 @@ if (process.argv[2] === 'child') { // parent process const spawn = require('child_process').spawn; - // spawn self as child + // Spawn self as child const child = spawn(process.argv[0], [process.argv[1], 'child']); let stdout = ''; diff --git a/test/parallel/test-fs-utimes.js b/test/parallel/test-fs-utimes.js index e34953423bd1..d45e437b7a0f 100644 --- a/test/parallel/test-fs-utimes.js +++ b/test/parallel/test-fs-utimes.js @@ -95,7 +95,7 @@ function runTests(iter) { fs.utimes('foobarbaz', atime, mtime, common.mustCall((err) => { expect_errno('utimes', 'foobarbaz', err, 'ENOENT'); - // don't close this fd + // Don't close this fd if (common.isWindows) { fd = fs.openSync(tmpdir.path, 'r+'); } else { diff --git a/test/parallel/test-module-version.js b/test/parallel/test-module-version.js index 61b84914e216..c881015c206a 100644 --- a/test/parallel/test-module-version.js +++ b/test/parallel/test-module-version.js @@ -2,7 +2,7 @@ require('../common'); const assert = require('assert'); -// check for existence +// Check for existence assert(process.config.variables.hasOwnProperty('node_module_version')); // Ensure that `node_module_version` is an Integer > 0 diff --git a/test/parallel/test-os.js b/test/parallel/test-os.js index 9b86d3af8b26..dbaa90beba1c 100644 --- a/test/parallel/test-os.js +++ b/test/parallel/test-os.js @@ -122,7 +122,7 @@ is.string(arch); assert.ok(arch.length > 0); if (!common.isSunOS) { - // not implemented yet + // Not implemented yet assert.ok(os.loadavg().length > 0); assert.ok(os.freemem() > 0); assert.ok(os.totalmem() > 0); diff --git a/test/parallel/test-readline-interface.js b/test/parallel/test-readline-interface.js index 2dff11f2a27e..02eb65743004 100644 --- a/test/parallel/test-readline-interface.js +++ b/test/parallel/test-readline-interface.js @@ -111,7 +111,7 @@ function isWarned(emitter) { rli.close(); } - // sending a full line + // Sending a full line { const fi = new FakeInput(); const rli = new readline.Interface( diff --git a/test/parallel/test-repl-pretty-custom-stack.js b/test/parallel/test-repl-pretty-custom-stack.js index b65287c5f55b..ed5ce12a4da0 100644 --- a/test/parallel/test-repl-pretty-custom-stack.js +++ b/test/parallel/test-repl-pretty-custom-stack.js @@ -60,7 +60,7 @@ const tests = [ command: 'foo = bar;', expected: 'Thrown:\nReferenceError: bar is not defined\n' }, - // test anonymous IIFE + // Test anonymous IIFE { command: '(function() { throw new Error(\'Whoops!\'); })()', expected: 'Thrown:\nError: Whoops!--->\nrepl:1:21\n' diff --git a/test/parallel/test-tls-alpn-server-client.js b/test/parallel/test-tls-alpn-server-client.js index 3da24c67fbe5..cfabca4b273f 100644 --- a/test/parallel/test-tls-alpn-server-client.js +++ b/test/parallel/test-tls-alpn-server-client.js @@ -128,13 +128,13 @@ function Test3() { }]; runTest(clientsOptions, serverOptions, function(results) { - // nothing is selected + // Nothing is selected checkResults(results[0], { server: { ALPN: false }, client: { ALPN: false } }); - // nothing is selected + // Nothing is selected checkResults(results[1], { server: { ALPN: false }, client: { ALPN: false } }); - // nothing is selected + // Nothing is selected checkResults(results[2], { server: { ALPN: false }, client: { ALPN: false } }); @@ -150,13 +150,13 @@ function Test4() { const clientsOptions = [{}, {}, {}]; runTest(clientsOptions, serverOptions, function(results) { - // nothing is selected + // Nothing is selected checkResults(results[0], { server: { ALPN: false }, client: { ALPN: false } }); - // nothing is selected + // Nothing is selected checkResults(results[1], { server: { ALPN: false }, client: { ALPN: false } }); - // nothing is selected + // Nothing is selected checkResults(results[2], { server: { ALPN: false }, client: { ALPN: false } }); diff --git a/test/parallel/test-tls-handshake-nohang.js b/test/parallel/test-tls-handshake-nohang.js index e724fcd3422b..ddaa8f83aa85 100644 --- a/test/parallel/test-tls-handshake-nohang.js +++ b/test/parallel/test-tls-handshake-nohang.js @@ -27,6 +27,6 @@ if (!common.hasCrypto) const tls = require('tls'); -// neither should hang +// Neither should hang tls.createSecurePair(null, false, false, false); tls.createSecurePair(null, true, false, false); diff --git a/test/parallel/test-tls-inception.js b/test/parallel/test-tls-inception.js index f28f92373c55..c2dfafb18c77 100644 --- a/test/parallel/test-tls-inception.js +++ b/test/parallel/test-tls-inception.js @@ -54,7 +54,7 @@ const a = tls.createServer(options, function(socket) { }); }); -// the "target" server +// The "target" server const b = tls.createServer(options, function(socket) { socket.end(body); }); diff --git a/test/sequential/test-cli-syntax-file-not-found.js b/test/sequential/test-cli-syntax-file-not-found.js index 3e1f3ec56118..945e8941b847 100644 --- a/test/sequential/test-cli-syntax-file-not-found.js +++ b/test/sequential/test-cli-syntax-file-not-found.js @@ -15,7 +15,7 @@ const syntaxArgs = [ const notFoundRE = /^Error: Cannot find module/m; -// test file not found +// Test file not found [ 'syntax/file_not_found.js', 'syntax/file_not_found' diff --git a/test/sequential/test-stream2-stderr-sync.js b/test/sequential/test-stream2-stderr-sync.js index 7384cf6e74f5..c4956ee6b626 100644 --- a/test/sequential/test-stream2-stderr-sync.js +++ b/test/sequential/test-stream2-stderr-sync.js @@ -45,7 +45,7 @@ function parent() { }); } -// using console.error +// Using console.error function child0() { console.error('child 0'); console.error('foo'); From 69a0035cc24fe3242b5a28be8f37761d040a500e Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 13 May 2019 14:38:44 +0200 Subject: [PATCH 2/4] tools: update capitalized-comments eslint rule This makes sure comments from 10 characters on are validated instead of 20 characters as lower bound. The regular expression was also updated to ignore variable declarations which might happen while commenting out some code during development. --- .eslintrc.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index b8ce85fa8224..356295dd10eb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -64,9 +64,10 @@ module.exports = { 'brace-style': ['error', '1tbs', { allowSingleLine: true }], 'capitalized-comments': ['error', 'always', { line: { - // Ignore all lines that have less characters than 20 and all lines that + // Ignore all lines that have less characters than 18 and all lines that // start with something that looks like a variable name or code. - ignorePattern: '.{0,20}$|[a-z]+ ?[0-9A-Z_.(/=:[#-]|std', + // eslint-disable-next-line max-len + ignorePattern: '.{0,18}$|[a-z]+ ?[0-9A-Z_.(/=:[#-]|std|http|ssh|ftp|(let|var|const) [a-z_A-Z0-9]+ =|[b-z] |[a-z]*[0-9].* ', ignoreInlineComments: true, ignoreConsecutiveComments: true, }, From 1130ad34b8f7c3e782c1d6f1e374f6d1905e1c49 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 13 May 2019 23:58:12 +0200 Subject: [PATCH 3/4] fixup! tools: update capitalized-comments eslint rule --- .eslintrc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 356295dd10eb..ff117624f5bd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -64,10 +64,10 @@ module.exports = { 'brace-style': ['error', '1tbs', { allowSingleLine: true }], 'capitalized-comments': ['error', 'always', { line: { - // Ignore all lines that have less characters than 18 and all lines that + // Ignore all lines that have less characters than 20 and all lines that // start with something that looks like a variable name or code. // eslint-disable-next-line max-len - ignorePattern: '.{0,18}$|[a-z]+ ?[0-9A-Z_.(/=:[#-]|std|http|ssh|ftp|(let|var|const) [a-z_A-Z0-9]+ =|[b-z] |[a-z]*[0-9].* ', + ignorePattern: '.{0,20}$|[a-z]+ ?[0-9A-Z_.(/=:[#-]|std|http|ssh|ftp|(let|var|const) [a-z_A-Z0-9]+ =|[b-z] |[a-z]*[0-9].* ', ignoreInlineComments: true, ignoreConsecutiveComments: true, }, From 96c48d5f50b7f60bc72a3e1ca210840a36162708 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 13 May 2019 23:58:41 +0200 Subject: [PATCH 4/4] Revert "doc: update comments to use capital letters" This reverts commit 958ba5e7d0e3322ad3a595f9f21f082176d12ae9. --- benchmark/fixtures/simple-http-server.js | 2 +- doc/api/console.md | 2 +- doc/api/punycode.md | 4 ++-- doc/api/util.md | 2 +- lib/_http_client.js | 2 +- lib/internal/freeze_intrinsics.js | 2 +- lib/internal/fs/sync_write_stream.js | 2 +- lib/internal/fs/utils.js | 2 +- lib/internal/readline.js | 2 +- lib/readline.js | 4 ++-- lib/url.js | 2 +- test/async-hooks/test-ttywrap.readstream.js | 2 +- test/async-hooks/test-ttywrap.writestream.js | 2 +- test/message/undefined_reference_in_new_context.js | 2 +- test/parallel/test-buffer-includes.js | 2 +- test/parallel/test-buffer-indexof.js | 2 +- test/parallel/test-child-process-no-deprecation.js | 2 +- .../parallel/test-child-process-stdout-flush-exit.js | 2 +- test/parallel/test-fs-utimes.js | 2 +- test/parallel/test-module-version.js | 2 +- test/parallel/test-os.js | 2 +- test/parallel/test-readline-interface.js | 2 +- test/parallel/test-repl-pretty-custom-stack.js | 2 +- test/parallel/test-tls-alpn-server-client.js | 12 ++++++------ test/parallel/test-tls-handshake-nohang.js | 2 +- test/parallel/test-tls-inception.js | 2 +- test/sequential/test-cli-syntax-file-not-found.js | 2 +- test/sequential/test-stream2-stderr-sync.js | 2 +- 28 files changed, 35 insertions(+), 35 deletions(-) diff --git a/benchmark/fixtures/simple-http-server.js b/benchmark/fixtures/simple-http-server.js index 794815c270c6..2b4f1ea956d7 100644 --- a/benchmark/fixtures/simple-http-server.js +++ b/benchmark/fixtures/simple-http-server.js @@ -127,7 +127,7 @@ module.exports = http.createServer((req, res) => { }); } } - // Send body in chunks + // send body in chunks if (n_chunks > 1) { const step = Math.floor(len / n_chunks) || 1; for (i = 0, n = (n_chunks - 1); i < n; ++i) diff --git a/doc/api/console.md b/doc/api/console.md index 3f2d1b683086..a8369290dfbf 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -116,7 +116,7 @@ const output = fs.createWriteStream('./stdout.log'); const errorOutput = fs.createWriteStream('./stderr.log'); // Custom simple logger const logger = new Console({ stdout: output, stderr: errorOutput }); -// Use it like console +// use it like console const count = 5; logger.log('count: %d', count); // In stdout.log: count 5 diff --git a/doc/api/punycode.md b/doc/api/punycode.md index be32c3784ee1..b8a3b7d629f9 100644 --- a/doc/api/punycode.md +++ b/doc/api/punycode.md @@ -80,7 +80,7 @@ domain name will be converted. Calling `punycode.toASCII()` on a string that already only contains ASCII characters will have no effect. ```js -// Encode domain names +// encode domain names punycode.toASCII('mañana.com'); // 'xn--maana-pta.com' punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' punycode.toASCII('example.com'); // 'example.com' @@ -98,7 +98,7 @@ containing [Punycode][] encoded characters into Unicode. Only the [Punycode][] encoded parts of the domain name are be converted. ```js -// Decode domain names +// decode domain names punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com' punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' punycode.toUnicode('example.com'); // 'example.com' diff --git a/doc/api/util.md b/doc/api/util.md index eca0bfb42d3e..c0b909d438d1 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -770,7 +770,7 @@ const arr = Array(101).fill(0); console.log(arr); // Logs the truncated array util.inspect.defaultOptions.maxArrayLength = null; -console.log(arr); // Logs the full array +console.log(arr); // logs the full array ``` ## util.isDeepStrictEqual(val1, val2) diff --git a/lib/_http_client.js b/lib/_http_client.js index 7f13cab21524..75c86acf2c51 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -269,7 +269,7 @@ function ClientRequest(input, options, cb) { this._deferToConnect(null, null, () => this._flush()); }; - // Initiate connection + // initiate connection if (this.agent) { this.agent.addRequest(this, options); } else { diff --git a/lib/internal/freeze_intrinsics.js b/lib/internal/freeze_intrinsics.js index c70811f6845b..753fb00acbcc 100644 --- a/lib/internal/freeze_intrinsics.js +++ b/lib/internal/freeze_intrinsics.js @@ -218,7 +218,7 @@ module.exports = function() { // this is a data property. const desc = descs[name]; if ('value' in desc) { - // TODO: Uncurried form + // todo uncurried form enqueue(desc.value); } else { enqueue(desc.get); diff --git a/lib/internal/fs/sync_write_stream.js b/lib/internal/fs/sync_write_stream.js index 509dcdbdbf57..522bfc829df3 100644 --- a/lib/internal/fs/sync_write_stream.js +++ b/lib/internal/fs/sync_write_stream.js @@ -25,7 +25,7 @@ SyncWriteStream.prototype._write = function(chunk, encoding, cb) { }; SyncWriteStream.prototype._destroy = function(err, cb) { - if (this.fd === null) // Already destroy()ed + if (this.fd === null) // already destroy()ed return cb(err); if (this.autoClose) diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index 0d871988d13e..dde78654e0f9 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -447,7 +447,7 @@ function warnOnNonPortableTemplate(template) { // This handles errors following the convention of the fs binding. function handleErrorFromBinding(ctx) { - if (ctx.errno !== undefined) { // Libuv error numbers + if (ctx.errno !== undefined) { // libuv error numbers const err = uvException(ctx); // eslint-disable-next-line no-restricted-syntax Error.captureStackTrace(err, handleErrorFromBinding); diff --git a/lib/internal/readline.js b/lib/internal/readline.js index febda517baf2..a5611942977d 100644 --- a/lib/internal/readline.js +++ b/lib/internal/readline.js @@ -392,7 +392,7 @@ function* emitKeys(stream) { // tab key.name = 'tab'; } else if (ch === '\b' || ch === '\x7f') { - // Backspace or ctrl+h + // backspace or ctrl+h key.name = 'backspace'; key.meta = escaped; } else if (ch === kEscape) { diff --git a/lib/readline.js b/lib/readline.js index d9619a9056ef..c8d0a8040ad9 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -885,7 +885,7 @@ Interface.prototype._ttyWrite = function(s, key) { this._deleteLeft(); break; - case 'd': // Delete right or EOF + case 'd': // delete right or EOF if (this.cursor === 0 && this.line.length === 0) { // This readline instance is finished this.close(); @@ -988,7 +988,7 @@ Interface.prototype._ttyWrite = function(s, key) { this._wordRight(); break; - case 'd': // Delete forward word + case 'd': // delete forward word case 'delete': this._deleteWordRight(); break; diff --git a/lib/url.js b/lib/url.js index 37f39f647fc8..665bd4361488 100644 --- a/lib/url.js +++ b/lib/url.js @@ -280,7 +280,7 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) { if (!hostlessProtocol.has(lowerProto) && (slashes || (proto && !slashedProtocol.has(proto)))) { - // There's a hostname. + // there's a hostname. // the first instance of /, ?, ;, or # ends the host. // // If there is an @ in the hostname, then non-host chars *are* allowed diff --git a/test/async-hooks/test-ttywrap.readstream.js b/test/async-hooks/test-ttywrap.readstream.js index 78d401191b90..e6fb3cdc28a4 100644 --- a/test/async-hooks/test-ttywrap.readstream.js +++ b/test/async-hooks/test-ttywrap.readstream.js @@ -14,7 +14,7 @@ hooks.enable(); if (!process.stdin.isTTY) return common.skip('no valid readable TTY available'); -// Test specific setup +// test specific setup const checkInitOpts = { init: 1 }; const checkEndedOpts = { init: 1, before: 1, after: 1, destroy: 1 }; diff --git a/test/async-hooks/test-ttywrap.writestream.js b/test/async-hooks/test-ttywrap.writestream.js index 29d7d28826d6..bcc164c659be 100644 --- a/test/async-hooks/test-ttywrap.writestream.js +++ b/test/async-hooks/test-ttywrap.writestream.js @@ -14,7 +14,7 @@ hooks.enable(); if (!process.stdout.isTTY) return common.skip('no valid writable TTY available'); -// Test specific setup +// test specific setup const checkInitOpts = { init: 1 }; const checkEndedOpts = { init: 1, before: 1, after: 1, destroy: 1 }; diff --git a/test/message/undefined_reference_in_new_context.js b/test/message/undefined_reference_in_new_context.js index d3d2cddf7c85..7cb68ec5b3b3 100644 --- a/test/message/undefined_reference_in_new_context.js +++ b/test/message/undefined_reference_in_new_context.js @@ -25,7 +25,7 @@ const vm = require('vm'); console.error('before'); -// Undefined reference +// undefined reference vm.runInNewContext('foo.bar = 5;'); console.error('after'); diff --git a/test/parallel/test-buffer-includes.js b/test/parallel/test-buffer-includes.js index 79e3332e4e3f..ca5b94f9d9fa 100644 --- a/test/parallel/test-buffer-includes.js +++ b/test/parallel/test-buffer-includes.js @@ -100,7 +100,7 @@ assert.strictEqual( true ); -// Test ascii encoding +// test ascii encoding assert.strictEqual( Buffer.from(b.toString('ascii'), 'ascii') .includes('d', 0, 'ascii'), diff --git a/test/parallel/test-buffer-indexof.js b/test/parallel/test-buffer-indexof.js index 3c3c9e8a659c..3f0449ceb084 100644 --- a/test/parallel/test-buffer-indexof.js +++ b/test/parallel/test-buffer-indexof.js @@ -108,7 +108,7 @@ assert.strictEqual( 3 ); -// Test ascii encoding +// test ascii encoding assert.strictEqual( Buffer.from(b.toString('ascii'), 'ascii') .indexOf('d', 0, 'ascii'), diff --git a/test/parallel/test-child-process-no-deprecation.js b/test/parallel/test-child-process-no-deprecation.js index 8adecde21005..d12e5b882f63 100644 --- a/test/parallel/test-child-process-no-deprecation.js +++ b/test/parallel/test-child-process-no-deprecation.js @@ -8,7 +8,7 @@ if (process.argv[2] === 'child') { // parent process const spawn = require('child_process').spawn; - // Spawn self as child + // spawn self as child const child = spawn(process.execPath, [process.argv[1], 'child']); child.stderr.on('data', common.mustNotCall()); diff --git a/test/parallel/test-child-process-stdout-flush-exit.js b/test/parallel/test-child-process-stdout-flush-exit.js index 231071ab81f8..cc1fa83fa9aa 100644 --- a/test/parallel/test-child-process-stdout-flush-exit.js +++ b/test/parallel/test-child-process-stdout-flush-exit.js @@ -35,7 +35,7 @@ if (process.argv[2] === 'child') { // parent process const spawn = require('child_process').spawn; - // Spawn self as child + // spawn self as child const child = spawn(process.argv[0], [process.argv[1], 'child']); let stdout = ''; diff --git a/test/parallel/test-fs-utimes.js b/test/parallel/test-fs-utimes.js index d45e437b7a0f..e34953423bd1 100644 --- a/test/parallel/test-fs-utimes.js +++ b/test/parallel/test-fs-utimes.js @@ -95,7 +95,7 @@ function runTests(iter) { fs.utimes('foobarbaz', atime, mtime, common.mustCall((err) => { expect_errno('utimes', 'foobarbaz', err, 'ENOENT'); - // Don't close this fd + // don't close this fd if (common.isWindows) { fd = fs.openSync(tmpdir.path, 'r+'); } else { diff --git a/test/parallel/test-module-version.js b/test/parallel/test-module-version.js index c881015c206a..61b84914e216 100644 --- a/test/parallel/test-module-version.js +++ b/test/parallel/test-module-version.js @@ -2,7 +2,7 @@ require('../common'); const assert = require('assert'); -// Check for existence +// check for existence assert(process.config.variables.hasOwnProperty('node_module_version')); // Ensure that `node_module_version` is an Integer > 0 diff --git a/test/parallel/test-os.js b/test/parallel/test-os.js index dbaa90beba1c..9b86d3af8b26 100644 --- a/test/parallel/test-os.js +++ b/test/parallel/test-os.js @@ -122,7 +122,7 @@ is.string(arch); assert.ok(arch.length > 0); if (!common.isSunOS) { - // Not implemented yet + // not implemented yet assert.ok(os.loadavg().length > 0); assert.ok(os.freemem() > 0); assert.ok(os.totalmem() > 0); diff --git a/test/parallel/test-readline-interface.js b/test/parallel/test-readline-interface.js index 02eb65743004..2dff11f2a27e 100644 --- a/test/parallel/test-readline-interface.js +++ b/test/parallel/test-readline-interface.js @@ -111,7 +111,7 @@ function isWarned(emitter) { rli.close(); } - // Sending a full line + // sending a full line { const fi = new FakeInput(); const rli = new readline.Interface( diff --git a/test/parallel/test-repl-pretty-custom-stack.js b/test/parallel/test-repl-pretty-custom-stack.js index ed5ce12a4da0..b65287c5f55b 100644 --- a/test/parallel/test-repl-pretty-custom-stack.js +++ b/test/parallel/test-repl-pretty-custom-stack.js @@ -60,7 +60,7 @@ const tests = [ command: 'foo = bar;', expected: 'Thrown:\nReferenceError: bar is not defined\n' }, - // Test anonymous IIFE + // test anonymous IIFE { command: '(function() { throw new Error(\'Whoops!\'); })()', expected: 'Thrown:\nError: Whoops!--->\nrepl:1:21\n' diff --git a/test/parallel/test-tls-alpn-server-client.js b/test/parallel/test-tls-alpn-server-client.js index cfabca4b273f..3da24c67fbe5 100644 --- a/test/parallel/test-tls-alpn-server-client.js +++ b/test/parallel/test-tls-alpn-server-client.js @@ -128,13 +128,13 @@ function Test3() { }]; runTest(clientsOptions, serverOptions, function(results) { - // Nothing is selected + // nothing is selected checkResults(results[0], { server: { ALPN: false }, client: { ALPN: false } }); - // Nothing is selected + // nothing is selected checkResults(results[1], { server: { ALPN: false }, client: { ALPN: false } }); - // Nothing is selected + // nothing is selected checkResults(results[2], { server: { ALPN: false }, client: { ALPN: false } }); @@ -150,13 +150,13 @@ function Test4() { const clientsOptions = [{}, {}, {}]; runTest(clientsOptions, serverOptions, function(results) { - // Nothing is selected + // nothing is selected checkResults(results[0], { server: { ALPN: false }, client: { ALPN: false } }); - // Nothing is selected + // nothing is selected checkResults(results[1], { server: { ALPN: false }, client: { ALPN: false } }); - // Nothing is selected + // nothing is selected checkResults(results[2], { server: { ALPN: false }, client: { ALPN: false } }); diff --git a/test/parallel/test-tls-handshake-nohang.js b/test/parallel/test-tls-handshake-nohang.js index ddaa8f83aa85..e724fcd3422b 100644 --- a/test/parallel/test-tls-handshake-nohang.js +++ b/test/parallel/test-tls-handshake-nohang.js @@ -27,6 +27,6 @@ if (!common.hasCrypto) const tls = require('tls'); -// Neither should hang +// neither should hang tls.createSecurePair(null, false, false, false); tls.createSecurePair(null, true, false, false); diff --git a/test/parallel/test-tls-inception.js b/test/parallel/test-tls-inception.js index c2dfafb18c77..f28f92373c55 100644 --- a/test/parallel/test-tls-inception.js +++ b/test/parallel/test-tls-inception.js @@ -54,7 +54,7 @@ const a = tls.createServer(options, function(socket) { }); }); -// The "target" server +// the "target" server const b = tls.createServer(options, function(socket) { socket.end(body); }); diff --git a/test/sequential/test-cli-syntax-file-not-found.js b/test/sequential/test-cli-syntax-file-not-found.js index 945e8941b847..3e1f3ec56118 100644 --- a/test/sequential/test-cli-syntax-file-not-found.js +++ b/test/sequential/test-cli-syntax-file-not-found.js @@ -15,7 +15,7 @@ const syntaxArgs = [ const notFoundRE = /^Error: Cannot find module/m; -// Test file not found +// test file not found [ 'syntax/file_not_found.js', 'syntax/file_not_found' diff --git a/test/sequential/test-stream2-stderr-sync.js b/test/sequential/test-stream2-stderr-sync.js index c4956ee6b626..7384cf6e74f5 100644 --- a/test/sequential/test-stream2-stderr-sync.js +++ b/test/sequential/test-stream2-stderr-sync.js @@ -45,7 +45,7 @@ function parent() { }); } -// Using console.error +// using console.error function child0() { console.error('child 0'); console.error('foo');