fix: resolve all biome warnings and formatting issues

- Remove unnecessary non-null assertions where values are guaranteed
- Replace array index access with .at() for safer element retrieval
- Use local variables to avoid repeated process.env lookups
- Replace any types with unknown in functional utilities
- Use nullish coalescing for TOTP hash byte access
- Auto-format security patches to match biome config
This commit is contained in:
ezl-keygraph
2026-03-15 00:54:40 +05:30
parent 181f24cfcc
commit 53b4c6b83f
9 changed files with 36 additions and 33 deletions
+2 -2
View File
@@ -219,9 +219,9 @@ async function setupRouter(): Promise<ShannonConfig> {
const router: ShannonConfig['router'] = { default: defaultModel };
if (routerProvider === 'openai') {
router!.openai_key = apiKey;
router.openai_key = apiKey;
} else {
router!.openrouter_key = apiKey;
router.openrouter_key = apiKey;
}
return { router };
+3 -6
View File
@@ -65,11 +65,8 @@ export function start(args: StartArgs): void {
const containerName = `shannon-worker-${suffix}`;
// 8. Generate workspace name if not provided
let workspace = args.workspace;
if (!workspace) {
const hostname = new URL(args.url).hostname.replace(/[^a-zA-Z0-9-]/g, '-');
workspace = `${hostname}_shannon-${Date.now()}`;
}
const workspace =
args.workspace ?? `${new URL(args.url).hostname.replace(/[^a-zA-Z0-9-]/g, '-')}_shannon-${Date.now()}`;
// 9. Resolve credentials
const credentialsDir = getCredentialsDir();
@@ -142,7 +139,7 @@ export function start(args: StartArgs): void {
// Clear waiting line and show info
process.stdout.write('\r\x1b[K');
printInfo(args, useRouter, workspace!, workflowId, repo.hostPath, workspacesDir);
printInfo(args, useRouter, workspace, workflowId, repo.hostPath, workspacesDir);
return;
}
} catch {