Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

lint/arrays/prefer-array-spread

In the lint-strict preset. Unsafe fix: it can change behavior.

What it does

Detects calls to array_merge() and suggests using the array spread operator (...) in an array literal instead.

Configuration

[lint.rules]
"arrays/prefer-array-spread" = "error"

To skip it in some files or lines, add an override or an ignore comment.

Replaces

More lint/arrays rules · Edit this page

Last updated on

Was this page helpful?