fixed more lint issues
This commit is contained in:
parent
48503ce8d1
commit
cc014de397
11 changed files with 42 additions and 11 deletions
|
|
@ -53,6 +53,8 @@ export function AddSourceDialog({
|
|||
setCode('');
|
||||
setAliases('');
|
||||
} catch (_error) {
|
||||
// TODO: Implement proper error handling/toast notification
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Error adding source:', _error);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,12 @@ import ReactDOM from 'react-dom/client';
|
|||
import { App } from './app';
|
||||
import './index.css';
|
||||
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||
const rootElement = document.getElementById('root');
|
||||
if (!rootElement) {
|
||||
throw new Error('Root element not found');
|
||||
}
|
||||
|
||||
ReactDOM.createRoot(rootElement).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
|
|
|
|||
8
libs/cache/src/connection-manager.ts
vendored
8
libs/cache/src/connection-manager.ts
vendored
|
|
@ -42,7 +42,11 @@ export class RedisConnectionManager {
|
|||
RedisConnectionManager.sharedConnections.set(name, connection);
|
||||
this.logger.info(`Created shared Redis connection: ${name}`);
|
||||
}
|
||||
return RedisConnectionManager.sharedConnections.get(name)!;
|
||||
const connection = RedisConnectionManager.sharedConnections.get(name);
|
||||
if (!connection) {
|
||||
throw new Error(`Expected connection ${name} to exist in shared connections`);
|
||||
}
|
||||
return connection;
|
||||
} else {
|
||||
// Create unique connection per instance
|
||||
const uniqueName = `${name}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
||||
|
|
@ -113,7 +117,7 @@ export class RedisConnectionManager {
|
|||
try {
|
||||
await connection.quit();
|
||||
} catch (error) {
|
||||
this.logger.warn('Error closing Redis connection:', error);
|
||||
this.logger.warn('Error closing Redis connection:', error as Error);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
6
libs/cache/src/index.ts
vendored
6
libs/cache/src/index.ts
vendored
|
|
@ -21,7 +21,11 @@ export function createCache(options: CacheOptions): CacheProvider {
|
|||
const cacheKey = `${defaultOptions.keyPrefix}-${defaultOptions.ttl}`;
|
||||
|
||||
if (cacheInstances.has(cacheKey)) {
|
||||
return cacheInstances.get(cacheKey)!;
|
||||
const cachedInstance = cacheInstances.get(cacheKey);
|
||||
if (!cachedInstance) {
|
||||
throw new Error(`Expected cache instance ${cacheKey} to exist`);
|
||||
}
|
||||
return cachedInstance;
|
||||
}
|
||||
|
||||
const cache = new RedisCache(defaultOptions);
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export interface EventBusMessage<T = any> {
|
|||
source: string;
|
||||
timestamp: number;
|
||||
data: T;
|
||||
metadata?: Record<string, any>;
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface EventHandler<T = any> {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ export interface RequestConfig {
|
|||
method?: HttpMethod;
|
||||
url: string;
|
||||
headers?: Record<string, string>;
|
||||
data?: any; // Changed from 'body' to 'data' for consistency
|
||||
data?: unknown; // Changed from 'body' to 'data' for consistency
|
||||
timeout?: number;
|
||||
proxy?: ProxyInfo | string; // Proxy can be a ProxyInfo object or a URL string
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ export function setLoggerConfig(config: LoggerConfig): void {
|
|||
globalConfig = { ...globalConfig, ...config };
|
||||
// Clear cache to force recreation with new config
|
||||
loggerCache.clear();
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Logger config updated:', globalConfig.logLevel);
|
||||
}
|
||||
/**
|
||||
|
|
@ -118,7 +119,11 @@ function getPinoLogger(serviceName: string, config: LoggerConfig = globalConfig)
|
|||
loggerCache.set(cacheKey, pino(loggerOptions));
|
||||
}
|
||||
|
||||
return loggerCache.get(cacheKey)!;
|
||||
const logger = loggerCache.get(cacheKey);
|
||||
if (!logger) {
|
||||
throw new Error(`Expected logger ${cacheKey} to exist in cache`);
|
||||
}
|
||||
return logger;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -303,6 +308,7 @@ export async function shutdownLoggers(): Promise<void> {
|
|||
if (typeof logger.flush === 'function') {
|
||||
logger.flush(err => {
|
||||
if (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Logger flush error:', err);
|
||||
}
|
||||
resolve();
|
||||
|
|
@ -315,8 +321,10 @@ export async function shutdownLoggers(): Promise<void> {
|
|||
|
||||
try {
|
||||
await Promise.allSettled(flushPromises);
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('All loggers flushed successfully');
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error('Logger flush failed:', error);
|
||||
} finally {
|
||||
loggerCache.clear();
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ export interface DocumentBase {
|
|||
created_at: Date;
|
||||
updated_at: Date;
|
||||
source: string;
|
||||
metadata?: Record<string, any>;
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -150,7 +150,7 @@ export interface SecFiling extends DocumentBase {
|
|||
period_end_date: Date;
|
||||
url: string;
|
||||
content: string;
|
||||
extracted_data?: Record<string, any>;
|
||||
extracted_data?: Record<string, unknown>;
|
||||
financial_statements?: Array<{
|
||||
statement_type: string;
|
||||
data: Record<string, number>;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ export class QuestDBClient {
|
|||
return;
|
||||
} catch (error) {
|
||||
lastError = error as Error;
|
||||
this.logger.warn(`QuestDB connection attempt ${attempt} failed:`, error);
|
||||
this.logger.warn(`QuestDB connection attempt ${attempt} failed:`, error as Error);
|
||||
|
||||
if (this.pgPool) {
|
||||
await this.pgPool.end();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue