Skip to content

style: replace new Array() with []#12179

Merged
kgryte merged 2 commits into
developfrom
philipp/ci-fix-lint-namespace-aliases-no-new-array-2026-05-17
May 17, 2026
Merged

style: replace new Array() with []#12179
kgryte merged 2 commits into
developfrom
philipp/ci-fix-lint-namespace-aliases-no-new-array-2026-05-17

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

This PR fixes a stdlib/no-new-array ESLint violation in
@stdlib/_tools/lint/namespace-aliases/lib/resolve.js.

Failing run: https://github.com/stdlib-js/stdlib/actions/runs/25976689223
Symptom: lint_random_files / Lint JavaScript files53:8 error Using the \new Array()` constructor is not allowed**Root cause:**out = new Array( len )at line 53 pre-dates thestdlib/no-new-arrayrule. The synchronous for-loop fills every index0..len-1before any asyncresolvecallback fires, soout = []is functionally equivalent. **Fix:** Replacenew Array( len )with[]at line 53 ofresolve.js`.

Related Issues

None.

Questions

No.

Other

No.

Checklist

AI Assistance

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

This PR was authored by Claude Code as part of an automated CI failure investigation routine. Three independent AI reviewer agents (correctness, regression scope, style) validated the fix before submission.


Generated by Claude Code

The `lint_random_files` scheduled job (`Lint JavaScript files`) failed
at 2026-05-17 00:32 UTC when `resolve.js` was selected for linting.
Root cause: `out = new Array( len )` at line 53 violates the
`stdlib/no-new-array` ESLint rule. All indices 0..len-1 are set
explicitly in the synchronous for-loop before any async callback runs,
so replacing the constructor call with an empty array literal `[]` is
functionally equivalent. This commit makes that substitution.

Ref: https://github.com/stdlib-js/stdlib/actions/runs/25976689223
@stdlib-bot stdlib-bot added the Tools Issue or pull request related to project tooling. label May 17, 2026
Signed-off-by: Athan <kgryte@gmail.com>
@kgryte kgryte changed the title fix(_tools/lint/namespace-aliases): replace new Array() with [] style: replace new Array() with [] May 17, 2026
@kgryte kgryte marked this pull request as ready for review May 17, 2026 21:19
@kgryte kgryte requested a review from a team May 17, 2026 21:19
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label May 17, 2026
@kgryte kgryte removed the Needs Review A pull request which needs code review. label May 17, 2026
@kgryte kgryte merged commit f684155 into develop May 17, 2026
33 checks passed
@kgryte kgryte deleted the philipp/ci-fix-lint-namespace-aliases-no-new-array-2026-05-17 branch May 17, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tools Issue or pull request related to project tooling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants