Enable unicorn/prefer-array-from-map rule (#19376)

This commit is contained in:
fisker Cheung authored and GitHub committed 2026-06-16 04:40:39 +08:00
1 parent 623e101fd3
commit e9aa8e53c4
2 files changed
+4 -3

No files matched your search

@@ -1,9 +1,11 @@
const snippets = [
{
name: "Should ignore single trailing space after han before New Line before han",
code: Array.from({ length: 6 })
code: Array.from(
{ length: 6 },
// less "文" <= [..., "文...文 ", "文...文", ...] => more "文"
.map((_, i) => ["文".repeat(39 + (i >> 1)), i & 1 ? "" : " "])
(_, i) => ["文".repeat(39 + (i >> 1)), i & 1 ? "" : " "],
)
// ["<Line #1>", "<L2>", ...]
.reduce(
(previousInputLines, [base, space]) => [