From 72b131d94e2c10fed58ed03b998162b9393e44af Mon Sep 17 00:00:00 2001 From: Siva-Shaw Date: Mon, 3 Nov 2025 21:59:43 +0530 Subject: [PATCH 1/4] fixingLintError --- .../@stdlib/_tools/bib/citation-reference/lib/sync.js | 2 +- .../eslint/rules/jsdoc-license-header-year/lib/main.js | 4 ++-- .../benchmark.fast_elements_array_length_heuristic.js | 9 ++++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/_tools/bib/citation-reference/lib/sync.js b/lib/node_modules/@stdlib/_tools/bib/citation-reference/lib/sync.js index 1a699af75341..d17d1eb29a19 100644 --- a/lib/node_modules/@stdlib/_tools/bib/citation-reference/lib/sync.js +++ b/lib/node_modules/@stdlib/_tools/bib/citation-reference/lib/sync.js @@ -60,7 +60,7 @@ var debug = logger( 'to-reference:sync' ); * * @example * var ref = toReference( '@press1992' ); -* // returns '...' +* // throws */ function toReference( id, options ) { var outFile; diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/lib/main.js index 428fa5746cd0..02386a537522 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/lib/main.js @@ -39,8 +39,8 @@ var rule; * @returns {Object} validators */ function main( context ) { - var source = context.getSourceCode(); var filename = context.getFilename(); + var source = context.getSourceCode(); return { 'Program': validate @@ -106,7 +106,7 @@ function main( context ) { if ( year !== expected ) { report( 'Expected year to be '+expected+' and not '+year, comment, expected ); } - } catch ( err ) { + } catch { // Do nothing if unable to determine the year the file was created (e.g., if the file is not tracked yet by `git`). } } diff --git a/lib/node_modules/@stdlib/array/generic/benchmark/benchmark.fast_elements_array_length_heuristic.js b/lib/node_modules/@stdlib/array/generic/benchmark/benchmark.fast_elements_array_length_heuristic.js index 92d3b1183a04..5482fdaf042a 100644 --- a/lib/node_modules/@stdlib/array/generic/benchmark/benchmark.fast_elements_array_length_heuristic.js +++ b/lib/node_modules/@stdlib/array/generic/benchmark/benchmark.fast_elements_array_length_heuristic.js @@ -60,7 +60,8 @@ function copy1( arr ) { len = arr.length; if ( len > MAX_FAST_ELEMENTS_HEURISTIC ) { - out = new Array( MAX_FAST_ELEMENTS_HEURISTIC ); + out = []; + out.length = MAX_FAST_ELEMENTS_HEURISTIC; for ( i = 0; i < MAX_FAST_ELEMENTS_HEURISTIC; i++ ) { out[ i ] = arr[ i ]; } @@ -68,7 +69,8 @@ function copy1( arr ) { out.push( arr[ i ] ); } } else { - out = new Array( len ); + out = []; + out.length = len; for ( i = 0; i < len; i++ ) { out[ i ] = arr[ i ]; } @@ -89,7 +91,8 @@ function copy2( arr ) { var i; len = arr.length; - out = new Array( len ); + out = []; + out.length = len; for ( i = 0; i < len; i++ ) { out[ i ] = arr[ i ]; } From 1bb8882a0c6c8206bae563c140695e25409a6873 Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 8 Nov 2025 17:24:47 -0800 Subject: [PATCH 2/4] docs: update returns annotation Signed-off-by: Athan --- .../@stdlib/_tools/bib/citation-reference/lib/sync.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/_tools/bib/citation-reference/lib/sync.js b/lib/node_modules/@stdlib/_tools/bib/citation-reference/lib/sync.js index d17d1eb29a19..a444f199e683 100644 --- a/lib/node_modules/@stdlib/_tools/bib/citation-reference/lib/sync.js +++ b/lib/node_modules/@stdlib/_tools/bib/citation-reference/lib/sync.js @@ -60,7 +60,7 @@ var debug = logger( 'to-reference:sync' ); * * @example * var ref = toReference( '@press1992' ); -* // throws +* // e.g., returns '...' */ function toReference( id, options ) { var outFile; From c28e6900d8cb4921785b10633db5eb710c6c7a4c Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 8 Nov 2025 17:25:41 -0800 Subject: [PATCH 3/4] style: disable lint rule Signed-off-by: Athan --- .../_tools/eslint/rules/jsdoc-license-header-year/lib/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/lib/main.js b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/lib/main.js index 02386a537522..751719e7f51e 100644 --- a/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/lib/main.js +++ b/lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-license-header-year/lib/main.js @@ -106,7 +106,7 @@ function main( context ) { if ( year !== expected ) { report( 'Expected year to be '+expected+' and not '+year, comment, expected ); } - } catch { + } catch ( err ) { // eslint-disable-line no-unused-vars // Do nothing if unable to determine the year the file was created (e.g., if the file is not tracked yet by `git`). } } From a21f0c6d9eaddcf319f00d84e92aea953c1fad0d Mon Sep 17 00:00:00 2001 From: Athan Date: Sat, 8 Nov 2025 17:28:46 -0800 Subject: [PATCH 4/4] bench: fix array allocation Signed-off-by: Athan --- .../benchmark.fast_elements_array_length_heuristic.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/array/generic/benchmark/benchmark.fast_elements_array_length_heuristic.js b/lib/node_modules/@stdlib/array/generic/benchmark/benchmark.fast_elements_array_length_heuristic.js index 5482fdaf042a..6fd98044bcd5 100644 --- a/lib/node_modules/@stdlib/array/generic/benchmark/benchmark.fast_elements_array_length_heuristic.js +++ b/lib/node_modules/@stdlib/array/generic/benchmark/benchmark.fast_elements_array_length_heuristic.js @@ -60,8 +60,7 @@ function copy1( arr ) { len = arr.length; if ( len > MAX_FAST_ELEMENTS_HEURISTIC ) { - out = []; - out.length = MAX_FAST_ELEMENTS_HEURISTIC; + out = new Array( MAX_FAST_ELEMENTS_HEURISTIC ); // eslint-disable-line stdlib/no-new-array for ( i = 0; i < MAX_FAST_ELEMENTS_HEURISTIC; i++ ) { out[ i ] = arr[ i ]; } @@ -69,8 +68,7 @@ function copy1( arr ) { out.push( arr[ i ] ); } } else { - out = []; - out.length = len; + out = new Array( len ); // eslint-disable-line stdlib/no-new-array for ( i = 0; i < len; i++ ) { out[ i ] = arr[ i ]; } @@ -91,8 +89,7 @@ function copy2( arr ) { var i; len = arr.length; - out = []; - out.length = len; + out = new Array( len ); // eslint-disable-line stdlib/no-new-array for ( i = 0; i < len; i++ ) { out[ i ] = arr[ i ]; }