chore: Enable more lint rules, disable some that trigger a lot. Will clean up later.

This commit is contained in:
cpojer
2026-01-31 16:03:28 +09:00
parent 481f696a87
commit 15792b153f
292 changed files with 643 additions and 699 deletions

View File

@@ -12,7 +12,7 @@ export function readLoggingConfig(): LoggingConfig | undefined {
try {
if (!fs.existsSync(configPath)) return undefined;
const raw = fs.readFileSync(configPath, "utf-8");
const parsed = json5.parse(raw) as Record<string, unknown>;
const parsed = json5.parse(raw);
const logging = parsed?.logging;
if (!logging || typeof logging !== "object" || Array.isArray(logging)) return undefined;
return logging as LoggingConfig;

View File

@@ -187,8 +187,8 @@ function logToFile(
meta?: Record<string, unknown>,
) {
if (level === "silent") return;
const safeLevel = level as Exclude<LogLevel, "silent">;
const method = (fileLogger as unknown as Record<string, unknown>)[safeLevel] as unknown as
const safeLevel = level;
const method = (fileLogger as unknown as Record<string, unknown>)[safeLevel] as
| ((...args: unknown[]) => void)
| undefined;
if (typeof method !== "function") return;