diff --git a/apps/data-service/package.json b/apps/data-service/package.json index 36a70c7..22f0f8d 100644 --- a/apps/data-service/package.json +++ b/apps/data-service/package.json @@ -6,7 +6,7 @@ "type": "module", "scripts": { "dev": "bun --watch src/index.ts", - "build": "bun build src/index.ts --outdir dist --target node", + "build": "bun build src/index.ts --outdir dist --target node --external chromium-bidi --external electron --external playwright --external playwright-core", "start": "bun dist/index.js", "test": "bun test", "clean": "rm -rf dist" diff --git a/apps/data-service/src/index.ts b/apps/data-service/src/index.ts index 917db16..f069b05 100644 --- a/apps/data-service/src/index.ts +++ b/apps/data-service/src/index.ts @@ -10,7 +10,7 @@ import { initializeServiceConfig } from '@stock-bot/config'; import { getLogger, setLoggerConfig, shutdownLoggers } from '@stock-bot/logger'; import { connectMongoDB } from '@stock-bot/mongodb-client'; import { connectPostgreSQL } from '@stock-bot/postgres-client'; -import { QueueManager, handlerRegistry, type QueueManagerConfig } from '@stock-bot/queue'; +import { QueueManager, type QueueManagerConfig } from '@stock-bot/queue'; import { Shutdown } from '@stock-bot/shutdown'; // Local imports import { exchangeRoutes, healthRoutes, queueRoutes } from './routes'; diff --git a/apps/data-service/src/providers/ib.tasks.ts b/apps/data-service/src/providers/ib.tasks.ts index 740e531..3e78cbe 100644 --- a/apps/data-service/src/providers/ib.tasks.ts +++ b/apps/data-service/src/providers/ib.tasks.ts @@ -54,7 +54,7 @@ export async function fetchSession(): Promise | undefined resolve(event.headers); } catch (e) { resolve(undefined); - console.log('📊 Raw Summary Response:', (e as Error).message); + logger.debug('Raw Summary Response error', { error: (e as Error).message }); } } } diff --git a/apps/data-sync-service/package.json b/apps/data-sync-service/package.json index 8e0bebf..b9506cd 100644 --- a/apps/data-sync-service/package.json +++ b/apps/data-sync-service/package.json @@ -6,7 +6,7 @@ "type": "module", "scripts": { "dev": "bun --watch src/index.ts", - "build": "bun build src/index.ts --outdir dist --target node", + "build": "bun build src/index.ts --outdir dist --target node --external chromium-bidi --external electron --external playwright --external playwright-core", "start": "bun dist/index.js", "test": "bun test", "clean": "rm -rf dist" diff --git a/apps/web-api/package.json b/apps/web-api/package.json index 9fa41b1..ad90669 100644 --- a/apps/web-api/package.json +++ b/apps/web-api/package.json @@ -6,7 +6,7 @@ "type": "module", "scripts": { "dev": "bun --watch src/index.ts", - "build": "bun build src/index.ts --outdir dist --target node", + "build": "bun build src/index.ts --outdir dist --target node --external chromium-bidi --external electron --external playwright --external playwright-core", "start": "bun dist/index.js", "test": "bun test", "clean": "rm -rf dist" diff --git a/apps/web-app/src/features/dashboard/components/PortfolioTable.tsx b/apps/web-app/src/features/dashboard/components/PortfolioTable.tsx index ccf7853..0132578 100644 --- a/apps/web-app/src/features/dashboard/components/PortfolioTable.tsx +++ b/apps/web-app/src/features/dashboard/components/PortfolioTable.tsx @@ -635,7 +635,7 @@ export function PortfolioTable() { console.log('Clicked:', row.symbol)} + onRowClick={_row => {/* Handle row click */}} className="border border-border rounded-lg" /> ); diff --git a/apps/web-app/src/features/exchanges/components/AddProviderMappingDialog.tsx b/apps/web-app/src/features/exchanges/components/AddProviderMappingDialog.tsx index 85720fe..f571c15 100644 --- a/apps/web-app/src/features/exchanges/components/AddProviderMappingDialog.tsx +++ b/apps/web-app/src/features/exchanges/components/AddProviderMappingDialog.tsx @@ -49,7 +49,7 @@ export function AddProviderMappingDialog({ try { const providersData = await fetchProviders(); setProviders(providersData); - } catch (error) { + } catch { // Error loading providers - could add toast notification here } finally { setProvidersLoading(false); @@ -62,7 +62,7 @@ export function AddProviderMappingDialog({ try { const exchangesData = await fetchUnmappedProviderExchanges(provider); setUnmappedExchanges(exchangesData); - } catch (error) { + } catch { // Error loading unmapped exchanges - could add toast notification here } finally { setExchangesLoading(false); @@ -102,7 +102,7 @@ export function AddProviderMappingDialog({ }; await onCreateMapping(request); - } catch (error) { + } catch { // Error creating provider mapping - could add toast notification here } finally { setLoading(false); diff --git a/libs/questdb-client/test/integration.test.ts b/libs/questdb-client/test/integration.test.ts index 3984946..3b5a211 100644 --- a/libs/questdb-client/test/integration.test.ts +++ b/libs/questdb-client/test/integration.test.ts @@ -5,7 +5,7 @@ * without requiring an actual QuestDB instance. */ -import { afterEach, beforeEach, describe, expect, it, mock, spyOn } from 'bun:test'; +import { afterEach, beforeEach, describe, expect, it, mock } from 'bun:test'; import { createQuestDBClient, QuestDBClient, @@ -33,7 +33,7 @@ describe('QuestDB Client Integration', () => { if (client && client.connected) { try { await client.disconnect(); - } catch (error) { + } catch { // Ignore cleanup errors in tests } } diff --git a/libs/questdb-client/test/setup.ts b/libs/questdb-client/test/setup.ts index bfa0285..811e971 100644 --- a/libs/questdb-client/test/setup.ts +++ b/libs/questdb-client/test/setup.ts @@ -5,7 +5,7 @@ * Provides utilities and mocks for testing database operations. */ -import { beforeAll, beforeEach, mock, spyOn } from 'bun:test'; +import { beforeAll, beforeEach, mock } from 'bun:test'; import { newDb } from 'pg-mem'; // Mock PostgreSQL database for unit tests @@ -124,7 +124,7 @@ beforeEach(() => { pgMem.public.none('DROP TABLE IF EXISTS indicators CASCADE'); pgMem.public.none('DROP TABLE IF EXISTS performance CASCADE'); pgMem.public.none('DROP TABLE IF EXISTS risk_metrics CASCADE'); - } catch (error) { + } catch { // Tables might not exist, ignore errors } } // Reset fetch mock @@ -248,7 +248,7 @@ export const questdbTestHelpers = { */ validateQuestDBQuery: (query: string): boolean => { // Basic validation for QuestDB-specific syntax - const questdbKeywords = ['SAMPLE BY', 'LATEST BY', 'ASOF JOIN', 'SPLICE JOIN', 'LT JOIN']; + const _questdbKeywords = ['SAMPLE BY', 'LATEST BY', 'ASOF JOIN', 'SPLICE JOIN', 'LT JOIN']; // Check for valid SQL structure const hasSelect = /SELECT\s+/i.test(query); diff --git a/libs/queue/test/batch-processor.test.ts b/libs/queue/test/batch-processor.test.ts index 35b041e..4c1f548 100644 --- a/libs/queue/test/batch-processor.test.ts +++ b/libs/queue/test/batch-processor.test.ts @@ -38,7 +38,7 @@ describe('Batch Processor', () => { 'generic': async (payload) => { return { processed: true, data: payload }; }, - 'process-batch-items': async (batchData) => { + 'process-batch-items': async (_batchData) => { // This is called by the batch processor internally return { batchProcessed: true }; }, @@ -87,7 +87,7 @@ describe('Batch Processor', () => { await queue.getBullQueue().clean(0, 1000, 'active'); await queue.getBullQueue().clean(0, 1000, 'waiting'); await queue.getBullQueue().clean(0, 1000, 'delayed'); - } catch (error) { + } catch { // Ignore cleanup errors } await queue.close(); diff --git a/libs/queue/test/dlq-handler.test.ts b/libs/queue/test/dlq-handler.test.ts index dc69dbc..7b7a335 100644 --- a/libs/queue/test/dlq-handler.test.ts +++ b/libs/queue/test/dlq-handler.test.ts @@ -1,5 +1,5 @@ import { describe, test, expect, beforeEach, afterEach } from 'bun:test'; -import { Queue, Worker, Job } from 'bullmq'; +import { Queue, Worker } from 'bullmq'; import { DeadLetterQueueHandler } from '../src/dlq-handler'; import { getRedisConnection } from '../src/utils'; @@ -50,7 +50,7 @@ describe('DeadLetterQueueHandler', () => { } await dlqHandler.shutdown(); await mainQueue.close(); - } catch (error) { + } catch { // Ignore cleanup errors } await new Promise(resolve => setTimeout(resolve, 50)); @@ -70,7 +70,7 @@ describe('DeadLetterQueueHandler', () => { }); // Add job with limited attempts - const job = await mainQueue.add('failing-job', { test: true }, { + const _job = await mainQueue.add('failing-job', { test: true }, { attempts: 3, backoff: { type: 'fixed', delay: 50 }, }); diff --git a/libs/queue/test/queue-manager.test.ts b/libs/queue/test/queue-manager.test.ts index 40211a1..becfb00 100644 --- a/libs/queue/test/queue-manager.test.ts +++ b/libs/queue/test/queue-manager.test.ts @@ -121,7 +121,7 @@ describe('QueueManager', () => { let processedCount = 0; handlerRegistry.register('bulk-handler', { - process: async payload => { + process: async _payload => { processedCount++; return { processed: true }; }, @@ -237,7 +237,7 @@ describe('QueueManager', () => { handlerRegistry.registerWithSchedule({ name: 'scheduled-handler', operations: { - 'scheduled-task': async payload => { + 'scheduled-task': async _payload => { executionCount++; return { executed: true, timestamp: Date.now() }; }, diff --git a/libs/queue/test/queue-metrics.test.ts b/libs/queue/test/queue-metrics.test.ts index 614ca5e..4c8acb5 100644 --- a/libs/queue/test/queue-metrics.test.ts +++ b/libs/queue/test/queue-metrics.test.ts @@ -51,7 +51,7 @@ describe('QueueMetricsCollector', () => { } await queueEvents.close(); await queue.close(); - } catch (error) { + } catch { // Ignore cleanup errors } await new Promise(resolve => setTimeout(resolve, 50)); diff --git a/libs/queue/test/queue-simple.test.ts b/libs/queue/test/queue-simple.test.ts index 78839d9..2820c21 100644 --- a/libs/queue/test/queue-simple.test.ts +++ b/libs/queue/test/queue-simple.test.ts @@ -18,7 +18,7 @@ describe('QueueManager Simple Tests', () => { if (queueManager) { try { await queueManager.shutdown(); - } catch (error) { + } catch { // Ignore errors during cleanup } } diff --git a/libs/queue/test/rate-limiter.test.ts b/libs/queue/test/rate-limiter.test.ts index 4906705..0007abb 100644 --- a/libs/queue/test/rate-limiter.test.ts +++ b/libs/queue/test/rate-limiter.test.ts @@ -36,7 +36,7 @@ describe('QueueRateLimiter', () => { if (keys.length > 0) { await redisClient.del(...keys); } - } catch (error) { + } catch { // Ignore cleanup errors } rateLimiter = new QueueRateLimiter(redisClient); @@ -46,7 +46,7 @@ describe('QueueRateLimiter', () => { if (redisClient) { try { await redisClient.quit(); - } catch (error) { + } catch { // Ignore cleanup errors } } diff --git a/libs/utils/src/calculations/performance-metrics.ts b/libs/utils/src/calculations/performance-metrics.ts index 8a2aa28..140a043 100644 --- a/libs/utils/src/calculations/performance-metrics.ts +++ b/libs/utils/src/calculations/performance-metrics.ts @@ -337,10 +337,11 @@ export function calculateRollingMetrics( case 'volatility': rollingMetrics.push(calculateVolatility(window)); break; - case 'return': + case 'return': { const avgReturn = window.reduce((sum, ret) => sum + ret, 0) / window.length; rollingMetrics.push(avgReturn); break; + } } } diff --git a/libs/utils/src/common.ts b/libs/utils/src/common.ts index afb531d..48d7601 100644 --- a/libs/utils/src/common.ts +++ b/libs/utils/src/common.ts @@ -1,4 +1,10 @@ -export function createProxyUrl(proxy: any): string { +export function createProxyUrl(proxy: { + protocol: string; + host: string; + port: number; + username?: string; + password?: string; +}): string { const { protocol, host, port, username, password } = proxy; if (username && password) { return `${protocol}://${encodeURIComponent(username)}:${encodeURIComponent(password)}@${host}:${port}`;