fix: remove unused imports and fix logger test isolation

- Remove unused imports (run, trackDuration, PerformanceTracker,
  ConfigManager, disconnectDb) flagged by ESLint
- Remove unused isSlow variable in performance-monitor catch block
- Add eslint-disable for require() in Playwright JS script
- Fix logger-performance test flakiness by using vi.resetModules()
  with dynamic imports to prevent cached logger references across
  test files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-04-05 12:15:18 +08:00
parent e54d94fce2
commit e2669af870
14 changed files with 157 additions and 66 deletions

View File

@@ -20,7 +20,7 @@ import { dirname } from 'path'
import { app } from 'electron'
import yaml from 'js-yaml'
import { z } from 'zod'
import { createLogger, applyLoggingConfig, trackDuration } from '../logger'
import { createLogger, applyLoggingConfig } from '../logger'
import { applyAuditConfig } from '../logger/audit-logger'
import {
fullConfigSchema,
@@ -315,9 +315,12 @@ export class ConfigManager {
const { activeType, mysql, sqlserver, postgresql } = this.config.database
switch (activeType) {
case 'postgresql': return postgresql
case 'sqlserver': return sqlserver
default: return mysql
case 'postgresql':
return postgresql
case 'sqlserver':
return sqlserver
default:
return mysql
}
}