From 533a6c0ce426ffded4d790ed42fad02d5a82cb8a Mon Sep 17 00:00:00 2001 From: Xiangzhe Date: Sat, 22 Aug 2026 15:33:17 -0300 Subject: [PATCH] fix(lint): type dynamic core imports in capture-critical-db-state test (#9985) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0ff0490ada (#10906) rewrote this suite keeping four module-level holders typed as any for the dynamically imported src/lib/db/core.ts exports — 4 new unsuppressed @typescript-eslint/no-explicit-any errors that failed the 'No new ESLint warnings' fast gate (npm run lint:json -- --max-warnings 0, exit 1 on the pure tip; CI run 32403951361). Replaces the any holders with a type-only CoreModule reference (typeof import(...)), so the runtime dynamic-import timing that motivates the pattern (DATA_DIR must be set before core.ts loads) stays untouched. Purely typal: file lints clean and its 7 assertions still pass. --- tests/unit/capture-critical-db-state.test.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/unit/capture-critical-db-state.test.ts b/tests/unit/capture-critical-db-state.test.ts index 0194b5c92f..fcf2a017b7 100644 --- a/tests/unit/capture-critical-db-state.test.ts +++ b/tests/unit/capture-critical-db-state.test.ts @@ -6,12 +6,13 @@ import path from "node:path"; // Shared across all tests — the module caches DATA_DIR / SQLITE_FILE at load time, // so we must create the temp dir and import exactly once. +type CoreModule = typeof import("../../src/lib/db/core.ts"); let tempDir: string; let originalDataDir: string | undefined; -let getDbInstance: any; -let resetDbInstance: any; -let ensureDbInitialized: any; -let closeDbInstance: any; +let getDbInstance: CoreModule["getDbInstance"]; +let resetDbInstance: CoreModule["resetDbInstance"]; +let ensureDbInitialized: CoreModule["ensureDbInitialized"]; +let closeDbInstance: CoreModule["closeDbInstance"]; before(async () => { tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "omniroute-db-test-"));