refactor(lint): enable map spread rule

This commit is contained in:
Peter Steinberger
2026-04-18 19:53:02 +01:00
parent 0c245c35c5
commit 4fa961d4f1
73 changed files with 352 additions and 344 deletions

View File

@@ -215,10 +215,11 @@ export async function main() {
}
const rows = Object.values(totalsByJob)
.map((r) => ({
...r,
models: Object.values(r.models).toSorted((a, b) => b.total_tokens - a.total_tokens),
}))
.map((r) =>
Object.assign({}, r, {
models: Object.values(r.models).toSorted((a, b) => b.total_tokens - a.total_tokens),
}),
)
.toSorted((a, b) => b.total_tokens - a.total_tokens);
if (asJson) {

View File

@@ -197,11 +197,12 @@ function mergeTestPlans(plans) {
}
const planGroups = [...groupsByConfig.values()]
.map((group) => ({
...group,
extensionIds: group.extensionIds.toSorted((left, right) => left.localeCompare(right)),
roots: [...new Set(group.roots)],
}))
.map((group) =>
Object.assign({}, group, {
extensionIds: group.extensionIds.toSorted((left, right) => left.localeCompare(right)),
roots: [...new Set(group.roots)],
}),
)
.toSorted((left, right) => left.config.localeCompare(right.config));
return {
@@ -279,6 +280,7 @@ export function createExtensionTestShards(params = {}) {
return shards
.map((shard, index) =>
Object.assign(
{},
{ index, checkName: `checks-node-extensions-shard-${index + 1}` },
mergeTestPlans(shard.plans),
),

View File

@@ -352,17 +352,15 @@ export async function collectPluginClawHubReleasePlan(params?: {
});
const all = await Promise.all(
selectedPublishable.map(async (plugin) => ({
...plugin,
alreadyPublished: await isPluginVersionPublishedOnClawHub(
plugin.packageName,
plugin.version,
{
registryBaseUrl: params?.registryBaseUrl,
fetchImpl: params?.fetchImpl,
},
),
})),
selectedPublishable.map(async (plugin) =>
Object.assign({}, plugin, {
alreadyPublished: await isPluginVersionPublishedOnClawHub(
plugin.packageName,
plugin.version,
{ registryBaseUrl: params?.registryBaseUrl, fetchImpl: params?.fetchImpl },
),
}),
),
);
return {

View File

@@ -462,10 +462,11 @@ export function collectPluginReleasePlan(params?: {
})
: allPublishable;
const all = selectedPublishable.map((plugin) => ({
...plugin,
alreadyPublished: isPluginVersionPublished(plugin.packageName, plugin.version),
}));
const all = selectedPublishable.map((plugin) =>
Object.assign({}, plugin, {
alreadyPublished: isPluginVersionPublished(plugin.packageName, plugin.version),
}),
);
return {
all,

View File

@@ -167,12 +167,13 @@ export function resolveRunnerMatrix(params) {
];
return {
include: runners.flatMap((runner) =>
suites.map((suite) => ({
...runner,
suite,
suite_label: formatSuiteLabel(suite),
lane: suite.includes("upgrade") || suite === "dev-update" ? "upgrade" : "fresh",
})),
suites.map((suite) =>
Object.assign({}, runner, {
suite,
suite_label: formatSuiteLabel(suite),
lane: suite.includes(`upgrade`) || suite === `dev-update` ? `upgrade` : `fresh`,
}),
),
),
};
}

View File

@@ -449,10 +449,11 @@ export function discoverBundledPluginRuntimeDeps(params = {}) {
}
return [...deps.values()]
.map((dep) => ({
...dep,
pluginIds: [...dep.pluginIds].toSorted((a, b) => a.localeCompare(b)),
}))
.map((dep) =>
Object.assign({}, dep, {
pluginIds: [...dep.pluginIds].toSorted((a, b) => a.localeCompare(b)),
}),
)
.toSorted((a, b) => a.name.localeCompare(b.name));
}