Skip to content

fix: replace new Array() with Array.from() pattern#503

Merged
gka merged 2 commits into
mainfrom
fix/no-new-array
Mar 2, 2026
Merged

fix: replace new Array() with Array.from() pattern#503
gka merged 2 commits into
mainfrom
fix/no-new-array

Conversation

@ljodea

@ljodea ljodea commented Feb 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replaces all new Array(n) usages with Array.from({ length: n }) or Array.from({ length: n }, () => value) for .fill() cases
  • Fixes all 10 no-new-array oxlint warnings across 7 files

Files changed

  • src/lib/helpers/noise.ts — perlin noise array init
  • src/lib/helpers/roundedRect.ts — border radius array
  • src/lib/marks/helpers/trail.ts — resampled defined array
  • src/lib/regression/polynomial.ts — coefficient arrays (2 occurrences)
  • src/lib/transforms/density.ts — CDF arrays (2 occurrences)
  • src/lib/transforms/map.ts — mapped values array
  • src/tests/barX.test.svelte.ts — test assertions (2 occurrences)

Test plan

  • pnpm exec oxlint --type-aware — 0 no-new-array warnings
  • pnpm test — all tests pass
  • pnpm check — 0 svelte-check errors

🤖 Generated with Claude Code

Replace all `new Array(n)` usages with `Array.from({ length: n })` to
satisfy the no-new-array oxlint rule. Fixes all 10 warnings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify

netlify Bot commented Feb 27, 2026

Copy link
Copy Markdown

Deploy Preview for svelteplot ready!

Name Link
🔨 Latest commit b74ca4a
🔍 Latest deploy log https://app.netlify.com/projects/svelteplot/deploys/69a1f68f1d34630008d91534
😎 Deploy Preview https://deploy-preview-503--svelteplot.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@gka gka left a comment

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.

makes sense

@gka gka merged commit 963b94a into main Mar 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants