Skip to content

chore: fix JavaScript lint errors (issue #11685)#11692

Merged
kgryte merged 2 commits intostdlib-js:developfrom
mvanhorn:fix-lint-11685
Apr 21, 2026
Merged

chore: fix JavaScript lint errors (issue #11685)#11692
kgryte merged 2 commits intostdlib-js:developfrom
mvanhorn:fix-lint-11685

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

Summary

Resolves #11685.

The stdlib/no-new-array rule flagged two occurrences of new Array( 5 ) in lib/node_modules/@stdlib/math/strided/special/sin-by/test/test.ndarray.js (lines 76 and 84). Both were constructing a 5-element sparse array to drive the accessor's v === void 0 guard.

I replaced each with a 5-element array literal of void 0 values:

x = [ void 0, void 0, void 0, void 0, void 0 ];

The accessor short-circuits on v === void 0, so whether a slot is absent (sparse) or explicitly undefined (dense) is indistinguishable to sinBy. The test's expected outputs remain identical and the assertions still pass.

Changes

  • lib/node_modules/@stdlib/math/strided/special/sin-by/test/test.ndarray.js: swap two new Array( 5 ) calls for array literals.

Related Issues

Checklist

  • Read, understood, and followed the contributing guidelines.
  • Fix is scoped to the two lines flagged by the lint workflow.

Replace 'new Array( 5 )' with array literals of 5 'void 0' values in the
'math/strided/special/sin-by' ndarray test. The accessor short-circuits
on 'v === void 0', so empty slots and explicit undefined slots produce
identical sinBy output -- the test semantics are preserved while
satisfying the 'stdlib/no-new-array' rule.

PR-URL: https://github.com/stdlib-js/stdlib/pull/
Resolves: stdlib-js#11685
@mvanhorn mvanhorn requested a review from a team April 21, 2026 09:47
@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review. Good First PR A pull request resolving a Good First Issue. labels Apr 21, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented Apr 21, 2026

Coverage Report

Package Statements Branches Functions Lines
math/strided/special/sin-by $\color{green}197/197$
$\color{green}+0.00%$
$\color{green}5/5$
$\color{green}+0.00%$
$\color{green}2/2$
$\color{green}+0.00%$
$\color{green}197/197$
$\color{green}+0.00%$

The above coverage report was generated for the changes in this PR.

Comment thread lib/node_modules/@stdlib/math/strided/special/sin-by/test/test.ndarray.js Outdated
Comment thread lib/node_modules/@stdlib/math/strided/special/sin-by/test/test.ndarray.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
@kgryte kgryte added difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. review: 3 and removed Needs Review A pull request which needs code review. labels Apr 21, 2026
@kgryte kgryte merged commit 1089250 into stdlib-js:develop Apr 21, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. Good First PR A pull request resolving a Good First Issue. Math Issue or pull request specific to math functionality. review: 3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

3 participants