diff --git a/src/commands/docs/index.test.ts b/src/commands/docs/index.test.ts index 6b7c99c..e2f3ba0 100644 --- a/src/commands/docs/index.test.ts +++ b/src/commands/docs/index.test.ts @@ -33,6 +33,7 @@ describe('docsCommand', () => { if (originalIsTTY !== undefined) { process.stdin.isTTY = originalIsTTY } else { + // eslint-disable-next-line @typescript-eslint/no-explicit-any delete (process.stdin as any).isTTY } }) diff --git a/src/commands/request/index.test.ts b/src/commands/request/index.test.ts index 3790cfd..f6f11e5 100644 --- a/src/commands/request/index.test.ts +++ b/src/commands/request/index.test.ts @@ -21,7 +21,9 @@ import { requestCommand } from './index.js' describe('requestCommand', () => { let program: Command let consoleLogSpy: ReturnType + // eslint-disable-next-line @typescript-eslint/no-explicit-any let mockModules: any + // eslint-disable-next-line @typescript-eslint/no-explicit-any let mockBuildAndImportApp: any const createBuildIterator = (app: Hono) => { diff --git a/src/commands/search/index.ts b/src/commands/search/index.ts index 9fb8e0c..703276c 100644 --- a/src/commands/search/index.ts +++ b/src/commands/search/index.ts @@ -149,6 +149,7 @@ export function searchCommand(program: Command) { }) } else { // Remove highlighted title from JSON output + // eslint-disable-next-line @typescript-eslint/no-unused-vars const jsonResults = results.map(({ highlightedTitle, ...result }) => result) console.log( JSON.stringify( diff --git a/src/commands/serve/index.test.ts b/src/commands/serve/index.test.ts index d1a21fa..ef9b688 100644 --- a/src/commands/serve/index.test.ts +++ b/src/commands/serve/index.test.ts @@ -29,10 +29,11 @@ import { serveCommand } from './index.js' describe('serveCommand', () => { let program: Command - let mockEsbuild: any + // eslint-disable-next-line @typescript-eslint/no-explicit-any let mockModules: any + // eslint-disable-next-line @typescript-eslint/no-explicit-any let mockServe: any - let mockShowRoutes: any + // eslint-disable-next-line @typescript-eslint/no-explicit-any let capturedFetchFunction: any beforeEach(async () => { @@ -40,7 +41,11 @@ describe('serveCommand', () => { serveCommand(program) mockServe = vi.mocked((await import('@hono/node-server')).serve) - mockShowRoutes = vi.mocked((await import('hono/dev')).showRoutes) + + mockModules = { + existsSync: vi.fn(), + resolve: vi.fn(), + } mockModules = { existsSync: vi.fn(), @@ -48,6 +53,7 @@ describe('serveCommand', () => { } // Capture the fetch function passed to serve + // eslint-disable-next-line @typescript-eslint/no-explicit-any mockServe.mockImplementation((options: any, callback?: any) => { capturedFetchFunction = options.fetch if (callback) { @@ -181,6 +187,7 @@ export default app it('should handle typical use case: basicAuth + proxy to ramen-api.dev', async () => { // Mock basicAuth middleware const mockBasicAuth = vi.fn().mockImplementation(() => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any return async (c: any, next: any) => { const auth = c.req.header('Authorization') if (!auth || auth !== 'Basic aG9ubzpob25v') { diff --git a/src/commands/serve/index.ts b/src/commands/serve/index.ts index 966ac04..a921326 100644 --- a/src/commands/serve/index.ts +++ b/src/commands/serve/index.ts @@ -62,6 +62,7 @@ export function serveCommand(program: Command) { } // Import all builtin functions from the builtin map + // eslint-disable-next-line @typescript-eslint/no-explicit-any const allFunctions: Record = {} const uniqueModules = [...new Set(Object.values(builtinMap))] @@ -74,7 +75,7 @@ export function serveCommand(program: Command) { allFunctions[funcName] = module[funcName] } } - } catch (error) { + } catch { // Skip modules that can't be imported (optional dependencies) } } diff --git a/src/utils/build.test.ts b/src/utils/build.test.ts index 904d323..d6e03c4 100644 --- a/src/utils/build.test.ts +++ b/src/utils/build.test.ts @@ -14,13 +14,17 @@ vi.mock('node:url', () => ({ import { buildAndImportApp } from './build.js' describe('buildAndImportApp', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any let mockEsbuildDispose: any + // eslint-disable-next-line @typescript-eslint/no-explicit-any let mockEsbuild: any const setupBundledCode = (code: string) => { mockEsbuild.mockImplementation((param: Parameters[0]) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any let onEnd: (result: any) => void param.plugins?.[0].setup({ + // eslint-disable-next-line @typescript-eslint/no-explicit-any onEnd: (cb: (result: any) => void) => { onEnd = cb },