style: replace new Array() with []#12179
Merged
kgryte merged 2 commits intoMay 17, 2026
Merged
Conversation
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
Signed-off-by: Athan <kgryte@gmail.com>
new Array() with []new Array() with []
kgryte
approved these changes
May 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a
stdlib/no-new-arrayESLint 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 files—53: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
If you answered "yes" above, how did you use AI assistance?
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