From 1c4aae7d099a91a2e0b392333b165d77d4937490 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 20 May 2026 04:18:39 +0000 Subject: [PATCH 1/2] refactor: normalize callback validation error in `@stdlib/_tools/lint/namespace-aliases` Replaces "Last argument" with "Callback argument" in the `TypeError` thrown by `lib/async.js` when the callback parameter is not a function, and updates the matching `@throws` JSDoc tag. The "Callback argument" phrasing is used by 7 of the 8 sibling `@stdlib/_tools/lint/*` packages with a callback validation (87.5% conformance); `namespace-aliases` was the only outlier. --- .../@stdlib/_tools/lint/namespace-aliases/lib/async.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/_tools/lint/namespace-aliases/lib/async.js b/lib/node_modules/@stdlib/_tools/lint/namespace-aliases/lib/async.js index 41f393c721ca..c5d81e0f6a48 100644 --- a/lib/node_modules/@stdlib/_tools/lint/namespace-aliases/lib/async.js +++ b/lib/node_modules/@stdlib/_tools/lint/namespace-aliases/lib/async.js @@ -45,7 +45,7 @@ var debug = logger( 'lint-namespace-aliases:async' ); * @param {Callback} clbk - callback to invoke upon completion * @throws {TypeError} options argument must be an object * @throws {TypeError} must provide valid options -* @throws {TypeError} last argument must be a function +* @throws {TypeError} callback argument must be a function * * @example * lint( onLint ); @@ -78,7 +78,7 @@ function lint( options, clbk ) { cb = options; } if ( !isFunction( cb ) ) { - throw new TypeError( format( 'invalid argument. Last argument must be a function. Value: `%s`.', cb ) ); + throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', cb ) ); } debug( 'Options: %s', JSON.stringify( opts ) ); From 99c2c84e482f4631ca12767f6a342d805d34faf9 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 20 May 2026 04:19:09 +0000 Subject: [PATCH 2/2] docs: document `options` throw and pad usage banner in `@stdlib/_tools/lint/pkg-json-names` Adds the missing `@throws {TypeError} options argument must be an object` line to the `lib/async.js` JSDoc; the throw is already present in `lib/validate.js` but was undocumented at the public entry. All 6 sibling `@stdlib/_tools/lint/*` packages with `options` validation document this throw (100% conformance among comparable siblings). Prepends a leading blank line to `docs/usage.txt` so the CLI `--help` banner matches the vertical spacing produced by the other 8 sibling packages, all of which start their `docs/usage.txt` with `\n`. --- .../@stdlib/_tools/lint/pkg-json-names/docs/usage.txt | 1 + lib/node_modules/@stdlib/_tools/lint/pkg-json-names/lib/async.js | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/node_modules/@stdlib/_tools/lint/pkg-json-names/docs/usage.txt b/lib/node_modules/@stdlib/_tools/lint/pkg-json-names/docs/usage.txt index e4c58f1f0112..ec47477ddae0 100644 --- a/lib/node_modules/@stdlib/_tools/lint/pkg-json-names/docs/usage.txt +++ b/lib/node_modules/@stdlib/_tools/lint/pkg-json-names/docs/usage.txt @@ -1,3 +1,4 @@ + Usage: lint-pkg-json-names [options] [] Options: diff --git a/lib/node_modules/@stdlib/_tools/lint/pkg-json-names/lib/async.js b/lib/node_modules/@stdlib/_tools/lint/pkg-json-names/lib/async.js index 06de6f8e880e..e371d7bc7390 100644 --- a/lib/node_modules/@stdlib/_tools/lint/pkg-json-names/lib/async.js +++ b/lib/node_modules/@stdlib/_tools/lint/pkg-json-names/lib/async.js @@ -45,6 +45,7 @@ var debug = logger( 'lint:pkg-json-names:async' ); * @param {string} [options.pattern] - glob pattern * @param {(string|StringArray)} [options.ignore] - glob pattern(s) to exclude * @param {Callback} clbk - callback to invoke upon completion +* @throws {TypeError} options argument must be an object * @throws {TypeError} must provide valid options * @throws {TypeError} callback argument must be a function *