Skip to content

chore: fix JavaScript lint errors (issue #12222)#12226

Open
algojogacor wants to merge 1 commit into
stdlib-js:developfrom
algojogacor:fix/lint-errors-gasum
Open

chore: fix JavaScript lint errors (issue #12222)#12226
algojogacor wants to merge 1 commit into
stdlib-js:developfrom
algojogacor:fix/lint-errors-gasum

Conversation

@algojogacor
Copy link
Copy Markdown

This is an independent contribution. I am not affiliated with the hackathon or any competition.

Summary

Replaces new Array() constructor calls with array literals and .push() in the @stdlib/blas/base/gasum test file to comply with the stdlib/no-new-array ESLint rule.

Root Cause

The automated JavaScript linting workflow detected 4 instances where new Array( 100 ) and new Array( 240 ) were used instead of array literals with .push().

Fix

  • Replaced x = new Array( 100 ) with x = [] and index-based assignment x[ i ] = ... with x.push( ... ).
  • Replaced x = new Array( 240 ) with x = [] and index-based assignment x[ i ] = ... with x.push( ... ).
  • Updated loop bounds from x.length to the explicit array size to maintain correctness after switching from pre-allocated arrays.

The same pattern was fixed in both test blocks (standard and accessor variants), resolving all 4 lint violations.

Testing

  • Changes are limited to test file test/test.ndarray.js.
  • Test logic is semantically identical — the same values are produced in the same order.
  • Verified via manual inspection of the generated array contents.

Resolves #12222

@algojogacor algojogacor requested a review from a team May 21, 2026 04:16
@stdlib-bot
Copy link
Copy Markdown
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot stdlib-bot added Good First PR A pull request resolving a Good First Issue. BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Needs Review A pull request which needs code review. labels May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Good First PR A pull request resolving a Good First Issue. Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

2 participants