fixed more lint issues

This commit is contained in:
Boki 2025-06-20 08:42:58 -04:00
parent 48503ce8d1
commit cc014de397
11 changed files with 42 additions and 11 deletions

View file

@ -1,4 +1,5 @@
#!/usr/bin/env bun
/* eslint-disable no-console */
import { parseArgs } from 'util';
import { join } from 'path';
import { ConfigManager } from './config-manager';

View file

@ -84,7 +84,13 @@ export class EnvLoader implements ConfigLoader {
}
private setNestedValue(obj: Record<string, any>, path: string[], value: unknown): boolean {
const lastKey = path.pop()!;
if (path.length === 0) {
return false; // Cannot set value on empty path
}
const lastKey = path.pop();
if (!lastKey) {
return false; // This should never happen due to length check above
}
try {
const target = path.reduce((acc, key) => {
@ -175,6 +181,7 @@ export class EnvLoader implements ConfigLoader {
} catch (error: any) {
// File not found is not an error (env files are optional)
if (error.code !== 'ENOENT') {
// eslint-disable-next-line no-console
console.warn(`Warning: Could not load env file ${filePath}:`, error.message);
}
}