Fix build errors (mainly eslint)

This commit is contained in:
2025-09-15 17:53:35 +03:00
parent 5771581013
commit 68eb865eff
3 changed files with 5 additions and 6 deletions

View File

@@ -15,7 +15,7 @@ export async function loadRules(
locale: Locale,
): Promise<string> {
// Try to load the file for the current locale first
let filePath = path.join(
const filePath = path.join(
process.cwd(),
"src",
"data",
@@ -28,7 +28,7 @@ export async function loadRules(
// Check if file exists for current locale
if (fs.existsSync(filePath)) {
const file = await import("fs").then(() =>
fs.readFileSync(filePath, "utf8")
fs.readFileSync(filePath, "utf8"),
);
return file;
}
@@ -60,7 +60,7 @@ export async function loadRules(
error,
);
throw new Error(
`Failed to load rules for ${ruleType}: ${error instanceof Error ? error.message : 'Unknown error'}`,
`Failed to load rules for ${ruleType}: ${error instanceof Error ? error.message : "Unknown error"}`,
);
}
}
@@ -97,7 +97,7 @@ export async function loadRulesBun(
error,
);
throw new Error(
`Failed to load rules for ${ruleType}: ${error instanceof Error ? error.message : 'Unknown error'}`,
`Failed to load rules for ${ruleType}: ${error instanceof Error ? error.message : "Unknown error"}`,
);
}
}

View File

@@ -45,7 +45,7 @@ export async function getRules(
return fallbackContent;
} catch (fallbackError) {
throw new Error(
`Rules file not found for ${ruleType} in either ${locale} or et locale`,
`Rules file not found for ${ruleType} in either ${locale} or et locale: ${fallbackError}`,
);
}
}