From 00712dcf33e267b90c5affdb60de85043f99f2a5 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sat, 27 Sep 2025 20:27:16 -0400 Subject: [PATCH 01/15] chore: Improve grammar: `; otherwise,` Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- lib/commands/diff.js | 2 +- lib/utils/queryable.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/commands/diff.js b/lib/commands/diff.js index 0ab7f6fccc9c6..5a0720e491340 100644 --- a/lib/commands/diff.js +++ b/lib/commands/diff.js @@ -182,7 +182,7 @@ class Diff extends BaseCommand { const aSpec = `file:${node.realpath}` // finds what version of the package to compare against, if a exact - // version or tag was passed than it should use that, otherwise + // version or tag was passed than it should use that; otherwise, // work from the top of the arborist tree to find the original semver // range declared in the package that depends on the package. let bSpec diff --git a/lib/utils/queryable.js b/lib/utils/queryable.js index a5fb25a845eaf..1c45214966f11 100644 --- a/lib/utils/queryable.js +++ b/lib/utils/queryable.js @@ -206,7 +206,7 @@ const setter = ({ data, key, value, force }) => { } // sets items from the parsed array of keys as objects, recurses to - // setKeys in case there are still items to be handled, otherwise it + // setKeys in case there are still items to be handled; otherwise, it // just sets the original value set by the user if (keys.length) { _data[_key] = setKeys(next(), keys.shift()) @@ -270,7 +270,7 @@ class Queryable { } } - // return the value for a single query if found, otherwise returns undefined + // return the value for a single query if found; otherwise, returns undefined get (query) { const obj = this.query(query) if (obj) { From 905ff28deb12eb68f4f31d70888012394fcd3a3b Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sun, 28 Sep 2025 16:48:45 -0400 Subject: [PATCH 02/15] chore: fix spelling: already Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- lib/commands/outdated.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commands/outdated.js b/lib/commands/outdated.js index 5421b1ddaab89..6c2d4cdcd9581 100644 --- a/lib/commands/outdated.js +++ b/lib/commands/outdated.js @@ -278,7 +278,7 @@ class Outdated extends ArboristWorkspaceCmd { dependedByLocation: d.dependedByLocation } : {}, } acc[d.name] = acc[d.name] - // If this item alread has an outdated dep then we turn it into an array + // If this item already has an outdated dep then we turn it into an array ? (Array.isArray(acc[d.name]) ? acc[d.name] : [acc[d.name]]).concat(dep) : dep return acc From 98ed75d7bf1edcf6ad73636d229b950ef2510a11 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sat, 27 Sep 2025 20:27:24 -0400 Subject: [PATCH 03/15] chore: fix grammar: an Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- lib/commands/diff.js | 2 +- lib/utils/verify-signatures.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/commands/diff.js b/lib/commands/diff.js index 5a0720e491340..f2a43c135c0e1 100644 --- a/lib/commands/diff.js +++ b/lib/commands/diff.js @@ -181,7 +181,7 @@ class Diff extends BaseCommand { const aSpec = `file:${node.realpath}` - // finds what version of the package to compare against, if a exact + // finds what version of the package to compare against, if an exact // version or tag was passed than it should use that; otherwise, // work from the top of the arborist tree to find the original semver // range declared in the package that depends on the package. diff --git a/lib/utils/verify-signatures.js b/lib/utils/verify-signatures.js index cf9fafd17745d..d0e30b82264a7 100644 --- a/lib/utils/verify-signatures.js +++ b/lib/utils/verify-signatures.js @@ -264,7 +264,7 @@ class VerifySignatures { const { version } = node.package || {} if (node.isWorkspace || // Skip local workspaces packages - !version || // Skip packages that don't have a installed version, e.g. optonal dependencies + !version || // Skip packages that don't have an installed version, e.g. optonal dependencies !spec.registry) { // Skip if not from registry, e.g. git package return } From 3a95f68030815ff82416fcc234b3868e44490e76 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sat, 27 Sep 2025 22:13:11 -0400 Subject: [PATCH 04/15] chore: fix spelling: array Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- lib/utils/queryable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/queryable.js b/lib/utils/queryable.js index 1c45214966f11..7e51194eaf1fc 100644 --- a/lib/utils/queryable.js +++ b/lib/utils/queryable.js @@ -101,7 +101,7 @@ const getter = ({ data, key }, { unwrapSingleItemArrays = true } = {}) => { // extra logic to take into account printing array, along with its // special syntax in which using a dot-sep property name after an - // arry will expand it's results, e.g: + // array will expand it's results, e.g: // arr.name -> arr[0].name=value, arr[1].name=value, ... const maybeIndex = Number(k) if (Array.isArray(_data) && !Number.isInteger(maybeIndex)) { From c1424a89dea3730b11af6e0e631330fa613d2967 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sat, 27 Sep 2025 20:52:01 -0400 Subject: [PATCH 05/15] fix: spelling: cannot Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- lib/base-cmd.js | 2 +- lib/commands/audit.js | 2 +- lib/commands/config.js | 6 +++--- test/lib/npm.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/base-cmd.js b/lib/base-cmd.js index dcbad88a8b35e..3e6c4758cbd58 100644 --- a/lib/base-cmd.js +++ b/lib/base-cmd.js @@ -84,7 +84,7 @@ class BaseCommand { } if (config.get('workspaces') === false && config.get('workspace').length) { - throw new Error('Can not use --no-workspaces and --workspace at the same time') + throw new Error('Cannot use --no-workspaces and --workspace at the same time') } } diff --git a/lib/commands/audit.js b/lib/commands/audit.js index 486bef1bb5dc1..97d0729da9618 100644 --- a/lib/commands/audit.js +++ b/lib/commands/audit.js @@ -53,7 +53,7 @@ class Audit extends ArboristWorkspaceCmd { async auditAdvisories (args) { const fix = args[0] === 'fix' if (this.npm.config.get('package-lock') === false && fix) { - throw this.usageError('fix can not be used without a package-lock') + throw this.usageError('fix cannot be used without a package-lock') } const reporter = this.npm.config.get('json') ? 'json' : 'detail' const Arborist = require('@npmcli/arborist') diff --git a/lib/commands/config.js b/lib/commands/config.js index 31dbc074a8372..b657029b2d2fe 100644 --- a/lib/commands/config.js +++ b/lib/commands/config.js @@ -15,7 +15,7 @@ const { redact } = require('@npmcli/redact') // validate valid configs during "npm config set", and folks may have old // invalid entries lying around in a config file that we still want to protect // when running "npm config list" -// This is a more general list of values to consider protected. You can not +// This is a more general list of values to consider protected. You cannot // "npm config get" them, and they will not display during "npm config list" const protected = [ 'auth', @@ -176,7 +176,7 @@ class Config extends BaseCommand { const deprecated = this.npm.config.definitions[baseKey]?.deprecated if (deprecated) { throw new Error( - `The \`${baseKey}\` option is deprecated, and can not be set in this way${deprecated}` + `The \`${baseKey}\` option is deprecated, and cannot be set in this way${deprecated}` ) } @@ -203,7 +203,7 @@ class Config extends BaseCommand { for (const key of keys) { const val = this.npm.config.get(key) if (isPrivate(key, val)) { - throw new Error(`The ${key} option is protected, and can not be retrieved in this way`) + throw new Error(`The ${key} option is protected, and cannot be retrieved in this way`) } const pref = keys.length > 1 ? `${key}=` : '' diff --git a/test/lib/npm.js b/test/lib/npm.js index 1c4033b083e64..b4ac509adb495 100644 --- a/test/lib/npm.js +++ b/test/lib/npm.js @@ -180,7 +180,7 @@ t.test('npm.load', async t => { }) await t.rejects( npm.exec('run', []), - /Can not use --no-workspaces and --workspace at the same time/ + /Cannot use --no-workspaces and --workspace at the same time/ ) }) From 50facaab4b7b0459fb5a24ee5b18d26261e3fea6 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sat, 27 Sep 2025 22:43:23 -0400 Subject: [PATCH 06/15] chore: fix spelling: currently Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- lib/utils/display.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/display.js b/lib/utils/display.js index da86d20ac2fee..23e10bc2388dc 100644 --- a/lib/utils/display.js +++ b/lib/utils/display.js @@ -480,7 +480,7 @@ class Progress { this.#render() } - // If we are currenting rendering the spinner we clear it + // If we are currently rendering the spinner we clear it // before writing our line and then re-render the spinner after. // If not then all we need to do is write the line write (write) { From 8875873b19a76d70261d7168d10ed23385ac8fd7 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sun, 28 Sep 2025 19:04:03 -0400 Subject: [PATCH 07/15] chore: fix spelling: don't Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- lib/cli/entry.js | 4 ++-- lib/commands/exec.js | 2 +- lib/commands/publish.js | 2 +- lib/npm.js | 2 +- lib/utils/display.js | 2 +- lib/utils/log-file.js | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/cli/entry.js b/lib/cli/entry.js index dd9b39973f8a1..a068d22c55cbf 100644 --- a/lib/cli/entry.js +++ b/lib/cli/entry.js @@ -20,7 +20,7 @@ module.exports = async (process, validateEngines) => { log.info('using', 'npm@%s', npm.version) log.info('using', 'node@%s', process.version) - // At this point we've required a few files and can be pretty sure we dont contain invalid syntax for this version of node. It's possible a lazy require would, but that's unlikely enough that it's not worth catching anymore and we attach the more important exit handlers. + // At this point we've required a few files and can be pretty sure we don't contain invalid syntax for this version of node. It's possible a lazy require would, but that's unlikely enough that it's not worth catching anymore and we attach the more important exit handlers. validateEngines.off() exitHandler.registerUncaughtHandlers() @@ -57,7 +57,7 @@ module.exports = async (process, validateEngines) => { const execPromise = npm.exec(command, args) - // this is async but we dont await it, since its ok if it doesnt + // this is async but we don't await it, since its ok if it doesnt // finish before the command finishes running. it uses command and argv // so it must be initiated here, after the command name is set const updateNotifier = require('./update-notifier.js') diff --git a/lib/commands/exec.js b/lib/commands/exec.js index 57ee8efe2c98f..c91222ffe3230 100644 --- a/lib/commands/exec.js +++ b/lib/commands/exec.js @@ -82,7 +82,7 @@ class Exec extends BaseCommand { // when we try to install a missing package, we won't actually install it packageLockOnly: false, // what the user asked to run args[0] is run by default - args: [...args], // copy args so they dont get mutated + args: [...args], // copy args so they don't get mutated // specify a custom command to be run instead of args[0] call, chalk, diff --git a/lib/commands/publish.js b/lib/commands/publish.js index 6586e652c7b81..162e3d65ba5ce 100644 --- a/lib/commands/publish.js +++ b/lib/commands/publish.js @@ -188,7 +188,7 @@ class Publish extends BaseCommand { await otplease(this.npm, opts, o => libpub(manifest, tarballData, o)) } - // In json mode we dont log until the publish has completed as this will + // In json mode we don't log until the publish has completed as this will // add it to the output only if completes successfully if (json) { logPkg() diff --git a/lib/npm.js b/lib/npm.js index 9a7103f135d5d..c635f3e05a7b3 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -130,7 +130,7 @@ class Npm { process.env.COLOR = this.color ? '1' : '0' // npm -v - // return from here early so we dont create any caches/logfiles/timers etc + // return from here early so we don't create any caches/logfiles/timers etc if (this.config.get('version', 'cli')) { output.standard(this.version) return { exec: false } diff --git a/lib/utils/display.js b/lib/utils/display.js index 23e10bc2388dc..76303644daacd 100644 --- a/lib/utils/display.js +++ b/lib/utils/display.js @@ -323,7 +323,7 @@ class Display { // Silent mode and some specific commands always hide run script banners break } else if (this.#json) { - // In json mode, change output to stderr since we dont want to break json + // In json mode, change output to stderr since we don't want to break json // parsing on stdout if the user is piping to jq or something. // XXX: in a future (breaking?) change it might make sense for run-script to // always output these banners with proc-log.output.error if we think they diff --git a/lib/utils/log-file.js b/lib/utils/log-file.js index 6c9bcd7ff8d86..c7c1d754009a3 100644 --- a/lib/utils/log-file.js +++ b/lib/utils/log-file.js @@ -118,7 +118,7 @@ class LogFiles { } if (this.#isBuffered) { - // Cant do anything but buffer the output if we dont + // Cant do anything but buffer the output if we don't // have a file stream yet this.#logStream.push([level, ...args]) return From 30cc62d3bb2ea3761646c5157bc844d67de66098 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sat, 27 Sep 2025 20:54:08 -0400 Subject: [PATCH 08/15] chore: fix spelling: fall back Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- lib/commands/dist-tag.js | 2 +- lib/utils/verify-signatures.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/commands/dist-tag.js b/lib/commands/dist-tag.js index 3fdecd926a564..655ec0d17539e 100644 --- a/lib/commands/dist-tag.js +++ b/lib/commands/dist-tag.js @@ -77,7 +77,7 @@ class DistTag extends BaseCommand { } // anything else is just a regular dist-tag command - // so we fallback to the non-workspaces implementation + // so we fall back to the non-workspaces implementation log.warn('dist-tag', 'Ignoring workspaces for specified package') return this.exec([cmdName, pkg, tag]) } diff --git a/lib/utils/verify-signatures.js b/lib/utils/verify-signatures.js index d0e30b82264a7..d5028e45673ac 100644 --- a/lib/utils/verify-signatures.js +++ b/lib/utils/verify-signatures.js @@ -190,7 +190,7 @@ class VerifySignatures { } }) - // If keys not found in Sigstore TUF repo, fallback to registry keys API + // If keys not found in Sigstore TUF repo, fall back to registry keys API if (!keys) { log.warn(`Fetching verification keys using TUF failed. Fetching directly from ${registry}.`) keys = await npmFetch.json('/-/npm/v1/keys', { From 4ba454a24baa636dbdd63d8adb2c8de70dea3ab0 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sun, 28 Sep 2025 17:14:51 -0400 Subject: [PATCH 09/15] chore: fix spelling: highlight Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- lib/commands/help-search.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/commands/help-search.js b/lib/commands/help-search.js index 72dd03ac7406e..f5f6ec05cfa59 100644 --- a/lib/commands/help-search.js +++ b/lib/commands/help-search.js @@ -163,18 +163,18 @@ class HelpSearch extends BaseCommand { return } - const hilitLine = [] + const highlightLine = [] for (const arg of args) { const finder = line.toLowerCase().split(arg.toLowerCase()) let p = 0 for (const f of finder) { - hilitLine.push(line.slice(p, p + f.length)) + highlightLine.push(line.slice(p, p + f.length)) const word = line.slice(p + f.length, p + f.length + arg.length) - hilitLine.push(this.npm.chalk.blue(word)) + highlightLine.push(this.npm.chalk.blue(word)) p += f.length + arg.length } } - out.push(hilitLine.join('') + '\n') + out.push(highlightLine.join('') + '\n') }) return out.join('') From 1c8b97f93aeb4b4b4e1ce3c1d6fb23733a0e5553 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sun, 28 Sep 2025 18:32:17 -0400 Subject: [PATCH 10/15] chore: fix spelling: manual sections Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- lib/commands/help.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commands/help.js b/lib/commands/help.js index 057090da0036c..71cb5734843c5 100644 --- a/lib/commands/help.js +++ b/lib/commands/help.js @@ -13,7 +13,7 @@ const globify = pattern => pattern.split('\\').join('/') // We don't currently compress our man pages but if we ever did this would // seamlessly continue supporting it const manNumberRegex = /\.(\d+)(\.[^/\\]*)?$/ -// hardcoded names for mansections +// hardcoded names for manual sections // XXX: these are used in the docs workspace and should be exported // from npm so section names can changed more easily const manSectionNames = { From 4424ca8e02e0b44c38f1a2bb56a4162b018b6a36 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sat, 27 Sep 2025 20:28:13 -0400 Subject: [PATCH 11/15] chore: fix spelling: optional Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- lib/utils/verify-signatures.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils/verify-signatures.js b/lib/utils/verify-signatures.js index d5028e45673ac..baadb2b1227d9 100644 --- a/lib/utils/verify-signatures.js +++ b/lib/utils/verify-signatures.js @@ -264,7 +264,7 @@ class VerifySignatures { const { version } = node.package || {} if (node.isWorkspace || // Skip local workspaces packages - !version || // Skip packages that don't have an installed version, e.g. optonal dependencies + !version || // Skip packages that don't have an installed version, e.g. optional dependencies !spec.registry) { // Skip if not from registry, e.g. git package return } From ebc2f8a16abc43d1ecb306f061d92ccd0eb19e7d Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sat, 27 Sep 2025 20:56:48 -0400 Subject: [PATCH 12/15] chore: Improve grammar: `otherwise,` Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- lib/cli/exit-handler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli/exit-handler.js b/lib/cli/exit-handler.js index e76b08c80a635..4347310c02892 100644 --- a/lib/cli/exit-handler.js +++ b/lib/cli/exit-handler.js @@ -158,7 +158,7 @@ class ExitHandler { this.#exitErrorMessage = err?.suppressError === true ? false : !!err // Prefer the exit code of the error, then the current process exit code, - // then set it to 1 if we still have an error. Otherwise we call process.exit + // then set it to 1 if we still have an error. Otherwise, we call process.exit // with undefined so that it can determine the final exit code const exitCode = err?.exitCode ?? this.#process.exitCode ?? (err ? 1 : undefined) From 4f95566708d41746982232d934f443103bfd2324 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sun, 28 Sep 2025 18:35:58 -0400 Subject: [PATCH 13/15] chore: fix spelling: process Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- lib/cli/exit-handler.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cli/exit-handler.js b/lib/cli/exit-handler.js index 4347310c02892..f4fbcd9d834f1 100644 --- a/lib/cli/exit-handler.js +++ b/lib/cli/exit-handler.js @@ -37,7 +37,7 @@ class ExitHandler { constructor ({ process }) { this.#process = process - this.#process.on('exit', this.#handleProcesExitAndReset) + this.#process.on('exit', this.#handleProcessExitAndReset) } registerUncaughtHandlers () { @@ -49,12 +49,12 @@ class ExitHandler { this.#handleExit(err) } - #handleProcesExitAndReset = (code) => { + #handleProcessExitAndReset = (code) => { this.#handleProcessExit(code) // Reset all the state. This is only relevant for tests since // in reality the process fully exits here. - this.#process.off('exit', this.#handleProcesExitAndReset) + this.#process.off('exit', this.#handleProcessExitAndReset) this.#process.off('uncaughtException', this.#handleExit) this.#process.off('unhandledRejection', this.#handleExit) if (this.#loaded) { From 15003062d26a72f47833d65537176ddf4db0a22d Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Sun, 28 Sep 2025 18:42:14 -0400 Subject: [PATCH 14/15] chore: fix spelling: thus far Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- lib/commands/completion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commands/completion.js b/lib/commands/completion.js index f8c2e00c6baee..1a1cb901ee5a0 100644 --- a/lib/commands/completion.js +++ b/lib/commands/completion.js @@ -4,7 +4,7 @@ // zsh or bash when calling a function for completion, based on the cursor // position and the command line thus far. These are: // COMP_CWORD: the index of the "word" in the command line being completed -// COMP_LINE: the full command line thusfar as a string +// COMP_LINE: the full command line thus far as a string // COMP_POINT: the cursor index at the point of triggering completion // // We parse the command line with nopt, like npm does, and then create an From f98071ae47a3219a1a92bc4588deb4b821a1fb24 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Wed, 1 Oct 2025 12:52:27 -0400 Subject: [PATCH 15/15] fix: spelling: man Co-authored-by: Gar --- lib/commands/help.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commands/help.js b/lib/commands/help.js index 71cb5734843c5..6eca85b4b0fe0 100644 --- a/lib/commands/help.js +++ b/lib/commands/help.js @@ -13,7 +13,7 @@ const globify = pattern => pattern.split('\\').join('/') // We don't currently compress our man pages but if we ever did this would // seamlessly continue supporting it const manNumberRegex = /\.(\d+)(\.[^/\\]*)?$/ -// hardcoded names for manual sections +// hardcoded names for man sections // XXX: these are used in the docs workspace and should be exported // from npm so section names can changed more easily const manSectionNames = {