From 09e72586408127f50bc2f4bb5b48b28c911b7374 Mon Sep 17 00:00:00 2001 From: nnyouung Date: Sun, 18 Jan 2026 11:10:42 +0900 Subject: [PATCH 1/4] chore: fix JavaScript lint errors Resolve ESLint rule violations in example and test files. Fixes: #9812 --- 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: 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 --- --- .../math/strided/special/besselj1-by/test/test.main.js | 6 ++++-- .../common/examples/addon-napi-polymorphic/index.js | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/math/strided/special/besselj1-by/test/test.main.js b/lib/node_modules/@stdlib/math/strided/special/besselj1-by/test/test.main.js index 8607bbb9c32f..33fc3f324a41 100644 --- a/lib/node_modules/@stdlib/math/strided/special/besselj1-by/test/test.main.js +++ b/lib/node_modules/@stdlib/math/strided/special/besselj1-by/test/test.main.js @@ -74,7 +74,8 @@ tape( 'the function computes the Bessel function of the first kind of order one besselj1By( 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 Bessel function of the first kind of order one besselj1By( 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 ]; diff --git a/lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic/index.js b/lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic/index.js index ff6a86a85ddb..ab25eebc9955 100644 --- a/lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic/index.js +++ b/lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic/index.js @@ -18,13 +18,17 @@ 'use strict'; -var join = require( 'path' ).join; -var tryRequire = require( '@stdlib/utils/try-require' ); var Float64Array = require( '@stdlib/array/float64' ); var Float32Array = require( '@stdlib/array/float32' ); +var add; + // Try loading the add-on: -var add = tryRequire( join( __dirname, 'addon.node' ) ); +try { + add = require( './addon.node' ); +} catch ( err ) { + add = err; +} /** * Main execution sequence. From 4db9a2bd577805816f6e788b0e73a571e29da727 Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 25 Jan 2026 18:03:12 -0800 Subject: [PATCH 2/4] Apply suggestions from code review Signed-off-by: Athan --- .../math/strided/special/besselj1-by/test/test.main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/math/strided/special/besselj1-by/test/test.main.js b/lib/node_modules/@stdlib/math/strided/special/besselj1-by/test/test.main.js index 33fc3f324a41..d4c1eacafaf4 100644 --- a/lib/node_modules/@stdlib/math/strided/special/besselj1-by/test/test.main.js +++ b/lib/node_modules/@stdlib/math/strided/special/besselj1-by/test/test.main.js @@ -74,8 +74,8 @@ tape( 'the function computes the Bessel function of the first kind of order one besselj1By( 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 Bessel function of the first kind of order one besselj1By( 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 ]; From c16bda90768eb04c742bca455a45eaa7eae925c3 Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 25 Jan 2026 18:04:12 -0800 Subject: [PATCH 3/4] chore: disable lint rule Signed-off-by: Athan --- .../strided/common/examples/addon-napi-polymorphic/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic/index.js b/lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic/index.js index ab25eebc9955..2616b185e343 100644 --- a/lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic/index.js +++ b/lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic/index.js @@ -19,7 +19,7 @@ 'use strict'; var Float64Array = require( '@stdlib/array/float64' ); -var Float32Array = require( '@stdlib/array/float32' ); +var Float32Array = require( '@stdlib/array/float32' ); // eslint-disable-line stdlib/require-last-path-relative var add; From c35391f09d03bdca4333876c7b760c48021bbb6e Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 25 Jan 2026 18:05:28 -0800 Subject: [PATCH 4/4] docs: fix example Signed-off-by: Athan --- .../common/examples/addon-napi-polymorphic/index.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic/index.js b/lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic/index.js index 2616b185e343..d6d5cd72dae6 100644 --- a/lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic/index.js +++ b/lib/node_modules/@stdlib/strided/common/examples/addon-napi-polymorphic/index.js @@ -18,17 +18,13 @@ 'use strict'; +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); var Float64Array = require( '@stdlib/array/float64' ); var Float32Array = require( '@stdlib/array/float32' ); // eslint-disable-line stdlib/require-last-path-relative -var add; - // Try loading the add-on: -try { - add = require( './addon.node' ); -} catch ( err ) { - add = err; -} +var add = tryRequire( join( __dirname, 'addon.node' ) ); /** * Main execution sequence.