From c89490c0838355da06a197102b0abd82cd9248a4 Mon Sep 17 00:00:00 2001 From: Divit Jain Date: Wed, 24 Dec 2025 10:20:54 +0530 Subject: [PATCH 1/4] chore: fix JavaScript lint errors (issue #9334) --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../@stdlib/_tools/lint/header-filenames/lib/index.js | 2 +- .../assert/tools/array-like-function/examples/index.js | 6 ++++-- .../@stdlib/constants/float32/ninf/examples/index.js | 2 +- .../@stdlib/math/strided/special/atan-by/test/test.main.js | 6 ++++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/_tools/lint/header-filenames/lib/index.js b/lib/node_modules/@stdlib/_tools/lint/header-filenames/lib/index.js index b46219ed849e..a4ec78523b34 100644 --- a/lib/node_modules/@stdlib/_tools/lint/header-filenames/lib/index.js +++ b/lib/node_modules/@stdlib/_tools/lint/header-filenames/lib/index.js @@ -39,7 +39,7 @@ * var lint = require( '@stdlib/_tools/lint/header-filenames' ); * * var errs = lint.sync(); -* // returns [...] +* // returns [] */ // MODULES // diff --git a/lib/node_modules/@stdlib/assert/tools/array-like-function/examples/index.js b/lib/node_modules/@stdlib/assert/tools/array-like-function/examples/index.js index b3bc2d89f8d7..1d32abb5dd23 100644 --- a/lib/node_modules/@stdlib/assert/tools/array-like-function/examples/index.js +++ b/lib/node_modules/@stdlib/assert/tools/array-like-function/examples/index.js @@ -27,12 +27,14 @@ var bool; var f; var i; -arr1 = new Array( 25 ); +arr1 = []; +arr1.length = 25; for ( i = 0; i < arr1.length; i++ ) { arr1[ i ] = i; } -arr2 = new Array( 25 ); +arr2 = []; +arr2.length = 25; for ( i = 0; i < arr2.length; i++ ) { arr2[ i ] = 2 * i; } diff --git a/lib/node_modules/@stdlib/constants/float32/ninf/examples/index.js b/lib/node_modules/@stdlib/constants/float32/ninf/examples/index.js index 3c99460eeb50..083bfcb48d94 100644 --- a/lib/node_modules/@stdlib/constants/float32/ninf/examples/index.js +++ b/lib/node_modules/@stdlib/constants/float32/ninf/examples/index.js @@ -21,4 +21,4 @@ var FLOAT32_NINF = require( './../lib' ); console.log( FLOAT32_NINF ); -// => -infinity +// => -Infinity diff --git a/lib/node_modules/@stdlib/math/strided/special/atan-by/test/test.main.js b/lib/node_modules/@stdlib/math/strided/special/atan-by/test/test.main.js index 7907d9455995..a6ad69151c2e 100644 --- a/lib/node_modules/@stdlib/math/strided/special/atan-by/test/test.main.js +++ b/lib/node_modules/@stdlib/math/strided/special/atan-by/test/test.main.js @@ -74,7 +74,8 @@ tape( 'the function computes the arctangent via a callback function', function t atanBy( x.length, x, 1, y, 1, accessor ); t.deepEqual( y, expected, 'deep equal' ); - x = new Array( 5 ); // sparse array + x = []; + x.length = 5; // sparse array y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; expected = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; @@ -82,7 +83,8 @@ tape( 'the function computes the arctangent via a callback function', function t atanBy( x.length, x, 1, y, 1, accessor ); t.deepEqual( y, expected, 'deep equal' ); - x = new Array( 5 ); // sparse array + x = []; + x.length = 5; // sparse array x[ 2 ] = rand(); y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; From f082a46293cba57f8d9b797929c5e50304907e31 Mon Sep 17 00:00:00 2001 From: Divit Jain Date: Wed, 24 Dec 2025 14:31:42 +0530 Subject: [PATCH 2/4] refactor: use array literal with push instead of pre-sized array --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../assert/tools/array-like-function/examples/index.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/assert/tools/array-like-function/examples/index.js b/lib/node_modules/@stdlib/assert/tools/array-like-function/examples/index.js index 1d32abb5dd23..6c30eb0607d5 100644 --- a/lib/node_modules/@stdlib/assert/tools/array-like-function/examples/index.js +++ b/lib/node_modules/@stdlib/assert/tools/array-like-function/examples/index.js @@ -28,15 +28,13 @@ var f; var i; arr1 = []; -arr1.length = 25; -for ( i = 0; i < arr1.length; i++ ) { - arr1[ i ] = i; +for ( i = 0; i < 25; i++ ) { + arr1.push( i ); } arr2 = []; -arr2.length = 25; -for ( i = 0; i < arr2.length; i++ ) { - arr2[ i ] = 2 * i; +for ( i = 0; i < 25; i++ ) { + arr2.push( 2 * i ); } f = arraylikefcn( isEven ); From 80a6ee80488a307aea9f9e249f83b20d0d8840b5 Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 24 Dec 2025 17:34:44 -0800 Subject: [PATCH 3/4] docs: update return annotation Signed-off-by: Athan --- .../@stdlib/_tools/lint/header-filenames/lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/_tools/lint/header-filenames/lib/index.js b/lib/node_modules/@stdlib/_tools/lint/header-filenames/lib/index.js index a4ec78523b34..8fd6bbb7d749 100644 --- a/lib/node_modules/@stdlib/_tools/lint/header-filenames/lib/index.js +++ b/lib/node_modules/@stdlib/_tools/lint/header-filenames/lib/index.js @@ -39,7 +39,7 @@ * var lint = require( '@stdlib/_tools/lint/header-filenames' ); * * var errs = lint.sync(); -* // returns [] +* // e.g., returns [...] */ // MODULES // From c8248d5ecc1f5578ae9a2a550b891a4ee134aa77 Mon Sep 17 00:00:00 2001 From: Athan Date: Wed, 24 Dec 2025 17:37:15 -0800 Subject: [PATCH 4/4] style: disable lint rule Signed-off-by: Athan --- .../math/strided/special/atan-by/test/test.main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/math/strided/special/atan-by/test/test.main.js b/lib/node_modules/@stdlib/math/strided/special/atan-by/test/test.main.js index a6ad69151c2e..34bb2b06d560 100644 --- a/lib/node_modules/@stdlib/math/strided/special/atan-by/test/test.main.js +++ b/lib/node_modules/@stdlib/math/strided/special/atan-by/test/test.main.js @@ -74,8 +74,8 @@ tape( 'the function computes the arctangent via a callback function', function t atanBy( x.length, x, 1, y, 1, accessor ); t.deepEqual( y, expected, 'deep equal' ); - x = []; - x.length = 5; // sparse array + // eslint-disable-next-line stdlib/no-new-array + x = new Array( 5 ); // sparse array y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; expected = [ 0.0, 0.0, 0.0, 0.0, 0.0 ]; @@ -83,8 +83,8 @@ tape( 'the function computes the arctangent via a callback function', function t atanBy( x.length, x, 1, y, 1, accessor ); t.deepEqual( y, expected, 'deep equal' ); - x = []; - x.length = 5; // sparse array + // eslint-disable-next-line stdlib/no-new-array + x = new Array( 5 ); // sparse array x[ 2 ] = rand(); y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];