style(web): apply bun fmt formatting

This commit is contained in:
Loki 2026-10-24 17:04:46 +02:00
parent d3a6dd316b
commit 769e25a705
Signed by: boba
GPG key ID: 253067914055423B
3 changed files with 77 additions and 41 deletions

View file

@ -42,7 +42,8 @@ test("every translation key used in code exists and every key is used", async ()
used.add(`faq${part}`);
used.add(`faq${part}Answer`);
}
for (const m of code.matchAll(/\b(?:tr|t)\(\s*"([A-Za-z]+)"/g)) used.add(m[1]!);
for (const m of code.matchAll(/\b(?:tr|t)\(\s*"([A-Za-z]+)"/g))
used.add(m[1]!);
for (const m of code.matchAll(/\(\[((?:"[a-z]+",?\s*)+)\] as const\)/g))
for (const k of m[1]!.matchAll(/"([a-z]+)"/g)) used.add(k[1]!);
for (const key of Object.keys(en)) {
@ -64,9 +65,7 @@ test("every translation key used in code exists and every key is used", async ()
test("static HTML fallback text matches the Russian dictionary", async () => {
const html = await text("public/index.html");
const flat = (value: string) => value.replace(/\s+/g, " ").trim();
for (const m of html.matchAll(
/data-i18n="([A-Za-z]+)"[^>]*>([^<]*)</g,
)) {
for (const m of html.matchAll(/data-i18n="([A-Za-z]+)"[^>]*>([^<]*)</g)) {
const key = m[1] as keyof typeof ru;
assert.ok(key in ru, key);
assert.equal(flat(m[2]!), flat(ru[key]), `fallback for ${key}`);