Skip to content

feat(eslint): enable unicorn/no-new-array#113204

Merged
JoshuaKGoldberg merged 1 commit intomasterfrom
unicorn-no-new-array
Apr 17, 2026
Merged

feat(eslint): enable unicorn/no-new-array#113204
JoshuaKGoldberg merged 1 commit intomasterfrom
unicorn-no-new-array

Conversation

@JoshuaKGoldberg
Copy link
Copy Markdown
Member

Following #112674 (comment): this lint rule would have caught a bug in my tests that AI flagged.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 16, 2026
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review April 16, 2026 18:36
@JoshuaKGoldberg JoshuaKGoldberg requested review from a team as code owners April 16, 2026 18:36
@JoshuaKGoldberg JoshuaKGoldberg removed request for a team April 16, 2026 18:36
@JoshuaKGoldberg JoshuaKGoldberg removed the request for review from a team April 16, 2026 18:36
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit be9d107. Configure here.

trigger: 'axis' as const,
},
xAxes: Array.from(new Array(series.length)).map((_i, index) => ({
xAxes: Array.from(Array.from({length: series.length})).map((_i, index) => ({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant double Array.from wrapping in five locations

Low Severity

The mechanical replacement of new Array(n) with Array.from({length: n}) inside an existing Array.from(...) wrapper created a redundant Array.from(Array.from({length: n})) pattern in five locations. The original Array.from(new Array(n)) was needed to convert a sparse array to a dense one, but Array.from({length: n}) already produces a dense array, making the outer Array.from unnecessary. The same pattern also appears in projectChart.tsx line 153 and flamegraphKeyboardNavigation.spec.ts line 36.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit be9d107. Configure here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that'd be a separate lint rule. IMO it'd be better to not change unrelated behaviors in this PR.

@JoshuaKGoldberg JoshuaKGoldberg merged commit a770938 into master Apr 17, 2026
63 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the unicorn-no-new-array branch April 17, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants