Skip to content

chore: fix JavaScript lint errors (issue #11732)#11793

Closed
vedparkasharya wants to merge 2 commits intostdlib-js:developfrom
vedparkasharya:fix-lint-entries-js-11732
Closed

chore: fix JavaScript lint errors (issue #11732)#11793
vedparkasharya wants to merge 2 commits intostdlib-js:developfrom
vedparkasharya:fix-lint-entries-js-11732

Conversation

@vedparkasharya
Copy link
Copy Markdown
Contributor

Description

This PR fixes a JavaScript linting error reported in #11732.

Problem

The entries.js file in @stdlib/_tools/pkgs/entry-points/lib/ was using the new Array() constructor, which violates the stdlib/no-new-array ESLint rule.

Error:

lib/node_modules/@stdlib/_tools/pkgs/entry-points/lib/entries.js
  64:8  error  Using the `new Array()` constructor is not allowed; use an array literal with push instead  stdlib/no-new-array

Solution

Replaced new Array( total ) with an empty array literal [].

Before:

out = new Array( total );

After:

out = [];

Why this is correct

  • The array is populated later via indexed assignment (out[i] = {...}), so JavaScript will automatically grow the array as needed.
  • Using an array literal [] is the idiomatic JavaScript approach and satisfies the stdlib/no-new-array lint rule.
  • No behavioral changes: the array still functions exactly the same way since subsequent code assigns elements by index.

Related Issues

resolves #11732

Checklist

Replace `new Array(total)` with `[]` to comply with the stdlib/no-new-array ESLint rule.
@vedparkasharya vedparkasharya requested a review from a team April 26, 2026 11:50
@stdlib-bot stdlib-bot added Tools Issue or pull request related to project tooling. Needs Review A pull request which needs code review. 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. and removed Needs Review A pull request which needs code review. labels Apr 26, 2026
@github-actions github-actions Bot mentioned this pull request Apr 26, 2026
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: 2 and removed Needs Review A pull request which needs code review. labels Apr 26, 2026
@kgryte
Copy link
Copy Markdown
Member

kgryte commented Apr 27, 2026

Ref: #11736

@kgryte kgryte added the autoclose: Already Resolved Pull request which should be auto-closed due proposed changes duplicating already included changes. label Apr 27, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Thank you for working on this pull request. However, we cannot accept your contribution as the issue this pull request seeks to resolve has already been addressed in a different pull request or commit.

Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions.

@stdlib-bot stdlib-bot closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autoclose: Already Resolved Pull request which should be auto-closed due proposed changes duplicating already included changes. difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. 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. review: 2 Tools Issue or pull request related to project tooling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

3 participants