Skip to content

feat: expand array elements in prefer-spread-syntax#93

Merged
43081j merged 1 commit intomainfrom
smarter-array-trickery
Mar 23, 2026
Merged

feat: expand array elements in prefer-spread-syntax#93
43081j merged 1 commit intomainfrom
smarter-array-trickery

Conversation

@43081j
Copy link
Copy Markdown
Contributor

@43081j 43081j commented Mar 23, 2026

In cases where we concat an array expression, this now expands the
elements instead of spreading it.

For example:

[1, 2].concat([3, 4], 5);
// becomes
[1, 2, 3, 4, 5];

[].concat([3, 4], arr);
// becomes
[3, 4, ...arr];

Fixes #92

In cases where we concat an array expression, this now expands the
elements instead of spreading it.

For example:

```ts
[1, 2].concat([3, 4], 5);
// becomes
[1, 2, 3, 4, 5];

[].concat([3, 4], arr);
// becomes
[3, 4, ...arr];
```

Fixes #92
@43081j 43081j merged commit 6f01ae2 into main Mar 23, 2026
3 checks passed
@43081j 43081j deleted the smarter-array-trickery branch March 23, 2026 21:22
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.

polish(prefer-spread-syntax): Handling of source element concat() could be better

2 participants