style: satisfy cumulative biome checks

This commit is contained in:
Simo committed 2026-08-30 19:38:36 +02:00
1 parent cb77b2d3b9
commit b9c47aa89a
10 files changed
+34 -37

No files matched your search

+1 -1
View File
@@ -57,7 +57,7 @@ export async function updateAd(formData: FormData): Promise<void> {
id: Number(raw),
error: result.error.messageKey,
});
revalidatePath("/admin/ads/" + raw);
revalidatePath(`/admin/ads/${raw}`);
return;
}
redirect("/admin/ads");
+1 -1
View File
@@ -54,7 +54,7 @@ export async function updateArticle(formData: FormData): Promise<void> {
{ action: "update", id, ...articleInput(formData) },
);
if (!result.ok) redirect("/admin/articles?error=Update failed");
revalidatePath("/admin/articles/" + id);
revalidatePath(`/admin/articles/${id}`);
redirect("/admin/articles");
}
+1 -1
View File
@@ -60,7 +60,7 @@ export async function updateHelpQuestion(formData: FormData): Promise<void> {
{ action: "update", id, ...input },
);
if (!result.ok) {
revalidatePath("/admin/help-questions/" + id);
revalidatePath(`/admin/help-questions/${id}`);
return;
}
redirect("/admin/help-questions");
+2 -2
View File
@@ -49,7 +49,7 @@ export async function applyPreset(formData: FormData): Promise<void> {
if (result.ok) revalidatePath("/", "layout");
redirect(
result.ok
? "/admin/theme?preset=" + encodeURIComponent(name)
? `/admin/theme?preset=${encodeURIComponent(name)}`
: "/admin/theme",
);
}
@@ -80,7 +80,7 @@ export async function applyCustomTheme(formData: FormData): Promise<void> {
: "";
redirect(
result.ok
? "/admin/theme?theme=" + encodeURIComponent(name)
? `/admin/theme?theme=${encodeURIComponent(name)}`
: "/admin/theme",
);
}
@@ -62,7 +62,7 @@ export async function loadContentInboxItems(
items.push({
sourceId,
itemId: item.id,
deduplicationKey: sourceId + ":" + routeId + ":" + item.id,
deduplicationKey: `${sourceId}:${routeId}:${item.id}`,
domain: "content",
capability: anyCapability(permission),
severity:
@@ -283,7 +283,7 @@ async function mediaLibrary(
.map(({ name, metadata }) => ({
id: name,
title: name,
description: String(metadata.size) + " bytes",
description: `${String(metadata.size)} bytes`,
status: "stored",
updatedAt: metadata.mtime.toISOString(),
href: "/ase/content/media/library",
@@ -367,7 +367,7 @@ async function localizationFiles(
{
id: "cms",
title: "CMS translations",
status: String(locales.length) + " locales",
status: `${String(locales.length)} locales`,
href: "/ase/content/localization/cms",
},
{
@@ -41,7 +41,7 @@ export async function loadContentSearchCandidates(
for (const item of result.data.items) {
if (!item.href) continue;
candidates.push({
id: routeId + ":" + item.id,
id: `${routeId}:${item.id}`,
title: item.title,
description: item.description ?? item.status,
href: item.href,
File diff suppressed because it is too large. Load diff
@@ -239,15 +239,14 @@ async function mediaUpload(input: unknown): Promise<ContentMutationSnapshot> {
MEDIA_TYPES,
);
await mkdir(MEDIA_ROOT, { recursive: true });
const name =
Date.now() + "-" + Math.random().toString(36).slice(2, 8) + "." + extension;
const name = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}.${extension}`;
const filePath = resolveMediaPath(name);
if (!filePath.startsWith(MEDIA_ROOT + path.sep)) throw validation();
await writeFile(filePath, bytes);
return {
before: null,
after: { name, size: file.size, type },
output: { name, url: "/api/media/" + name },
output: { name, url: `/api/media/${name}` },
};
}
@@ -291,7 +290,7 @@ async function photoDelete(
await logStaffActivity({
staffId: context.capability.actor.id,
action: "photo_delete",
description: "Deleted camera photo #" + id,
description: `Deleted camera photo #${id}`,
targetType: "camera_web",
targetId: id,
});
@@ -459,7 +458,7 @@ async function themeApplyPreset(
await logStaffActivity({
staffId: context.capability.actor.id,
action: "theme_preset",
description: "Applied theme preset " + name,
description: `Applied theme preset ${name}`,
});
} catch {
throw new ContentCommittedExternalFailure(snapshot);
@@ -504,7 +503,7 @@ async function themeCustomChange(
await logStaffActivity({
staffId: context.capability.actor.id,
action: "theme_preset",
description: "Saved custom theme " + theme.name,
description: `Saved custom theme ${theme.name}`,
});
return {
before: id ? { id } : null,
@@ -547,7 +546,7 @@ async function themeApplyCustom(
await logStaffActivity({
staffId: context.capability.actor.id,
action: "theme_preset",
description: "Applied custom theme " + theme.name,
description: `Applied custom theme ${theme.name}`,
});
} catch {
throw new ContentCommittedExternalFailure(snapshot);
@@ -580,13 +579,13 @@ async function faviconSave(input: unknown): Promise<ContentMutationSnapshot> {
FAVICON_TYPES,
);
const directory = resolveMediaPath("favicon");
const filename = "favicon-" + Date.now() + "." + extension;
const filename = `favicon-${Date.now()}.${extension}`;
const filePath = path.resolve(directory, filename);
if (!filePath.startsWith(directory + path.sep)) throw validation();
const oldUrl = await siteSettings.get("cms_favicon");
await mkdir(directory, { recursive: true });
await writeFile(filePath, bytes);
const url = "/api/media/favicon/" + filename;
const url = `/api/media/favicon/${filename}`;
const snapshot: ContentMutationSnapshot = {
before: { value: oldUrl ?? null },
after: { value: url },
@@ -654,7 +653,7 @@ async function logoSave(input: unknown): Promise<ContentMutationSnapshot> {
const oldUrl = await siteSettings.get("cms_logo");
await mkdir(directory, { recursive: true });
await writeFile(filePath, bytes);
const url = "/api/media/logo/" + filename;
const url = `/api/media/logo/${filename}`;
const snapshot: ContentMutationSnapshot = {
before: { value: oldUrl ?? null },
after: { value: url },
@@ -694,7 +693,7 @@ async function cmsTranslationSave(
process.cwd(),
"src",
"messages",
locale + ".json",
`${locale}.json`,
);
await writeFile(filePath, JSON.stringify(translations, null, 2), "utf-8");
return {
@@ -75,7 +75,7 @@ function auditEntry(
): AuditEntry {
return {
userId: context.capability.actor.id,
action: "content." + operation,
action: `content.${operation}`,
target: "Content",
correlationId: context.correlationId,
domain: "content",