Enable Biome rules 3

This commit is contained in:
Kalle
2026-09-06 14:24:21 +03:00
parent 17a1e27048
commit e5196ca4d5
47 changed files with 218 additions and 120 deletions

View File

@@ -22,8 +22,10 @@ invariant(
async function loadTournament() {
try {
return await tournamentFromDB(tournamentId);
} catch {
throw new Error(`Tournament with id ${tournamentId} not found`);
} catch (error) {
throw new Error(`Tournament with id ${tournamentId} not found`, {
cause: error,
});
}
}

View File

@@ -67,8 +67,8 @@ for (const file of fileNames) {
let otherLanguageContent: Record<string, string>;
try {
otherLanguageContent = JSON.parse(otherRawContent);
} catch {
throw new Error(`failed to parse ${lang}/${file}`);
} catch (error) {
throw new Error(`failed to parse ${lang}/${file}`, { cause: error });
}
const otherLanguageContentKeys = getKeysWithoutSuffix(
@@ -276,7 +276,7 @@ function MDOverviewTable({
(name) => name !== "weapons.json" && name !== "gear.json",
);
const rows = [];
const rows: string[] = [];
rows.push(
`| Language | Total | ${relevantFiles.map(MD.inlineCode).join(" | ")} |`,
@@ -285,7 +285,7 @@ function MDOverviewTable({
rows.push(`| :-- | :-: | ${relevantFiles.map(() => ":-:").join(" | ")} |`);
for (const [lang, missingKeysObj] of Object.entries(missingTranslations)) {
const cells = [];
const cells: string[] = [];
cells.push(MD.strong(lang));

View File

@@ -123,6 +123,7 @@ async function main() {
fs.rmSync(stagedPath, { force: true });
throw new Error(
`Snapshot failed verification, no checkout was touched. The archive is kept at ${archivePath}\n${(error as Error).message}`,
{ cause: error },
);
}

View File

@@ -134,6 +134,7 @@ function parseArgs(argv: string[]): {
let duration: number | undefined;
let outPath: string | undefined;
let collectTelemetry = false;
// biome-ignore lint/style/useForOf: the index advances inside the loop to consume flag values
for (let i = 0; i < argv.length; i++) {
const arg = argv[i]!;
if (arg === "--fps") fps = Number(argv[++i]);