mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:10:43 +00:00
refactor(lint): enable map spread rule
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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`,
|
||||
}),
|
||||
),
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user