diff --git a/eslint.config.js b/eslint.config.js index 59bc4bf..7e2525d 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -19,7 +19,7 @@ export default tseslint.config( }, rules: { "@typescript-eslint/no-explicit-any": "warn", - "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }], + "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }], "no-console": ["warn", { allow: ["warn", "error", "info"] }], }, }, diff --git a/src/cli/swagger-generator.ts b/src/cli/swagger-generator.ts index dd516c5..5ad787c 100644 --- a/src/cli/swagger-generator.ts +++ b/src/cli/swagger-generator.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import fs from "node:fs/promises"; import path from "node:path"; diff --git a/src/utils/async/debounce.ts b/src/utils/async/debounce.ts index 0802bd3..5d40bc3 100644 --- a/src/utils/async/debounce.ts +++ b/src/utils/async/debounce.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import type { AsyncFunction, DebounceOptions, diff --git a/src/utils/async/sequential.ts b/src/utils/async/sequential.ts index 1c76afb..c75da24 100644 --- a/src/utils/async/sequential.ts +++ b/src/utils/async/sequential.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import type { SequentialTask, SequentialOptions } from "./types.js"; /** diff --git a/src/utils/async/throttle.ts b/src/utils/async/throttle.ts index 246bff4..da1fb2e 100644 --- a/src/utils/async/throttle.ts +++ b/src/utils/async/throttle.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import type { AsyncFunction, ThrottleOptions, diff --git a/src/utils/async/timeout.ts b/src/utils/async/timeout.ts index 0c00ab1..d7de513 100644 --- a/src/utils/async/timeout.ts +++ b/src/utils/async/timeout.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { TimeoutError } from "./errors.js"; import { sleep } from "./sleep.js"; diff --git a/src/utils/async/types.ts b/src/utils/async/types.ts index f4a08d6..1ea9a91 100644 --- a/src/utils/async/types.ts +++ b/src/utils/async/types.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ /** * Type definitions for AsyncUtils module */ diff --git a/src/utils/core/ApiClient.ts b/src/utils/core/ApiClient.ts index d84cc83..0273b22 100644 --- a/src/utils/core/ApiClient.ts +++ b/src/utils/core/ApiClient.ts @@ -1,3 +1,4 @@ + import { Logger } from "#core/Logger.js"; import { UrlHelper } from "#helpers/UrlHelper.js"; import { retry as retryFn } from "../async/retry.js"; @@ -45,6 +46,14 @@ export interface ApiClientConfig { circuitBreaker?: CircuitBreakerConfig; } +export type RequestBody = + | Record + | unknown[] + | string + | FormData + | Blob + | BufferSource; + export interface RequestOptions extends Omit< RequestInit, "body" @@ -638,7 +647,7 @@ export class ApiClient { * 2. RequestOptions: post("/path", { body: {...}, headers: {...} }) */ private normalizeBodyOrOptions( - bodyOrOptions?: RequestOptions | unknown + bodyOrOptions?: RequestOptions | RequestBody ): RequestOptions { if (!bodyOrOptions) { return {}; diff --git a/src/utils/core/SchemaAdapter.ts b/src/utils/core/SchemaAdapter.ts index 9b7e8c8..a5e67f3 100644 --- a/src/utils/core/SchemaAdapter.ts +++ b/src/utils/core/SchemaAdapter.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ /** * Generic interface for schema validation adapters (e.g., Zod, Valibot, ArkType) */ diff --git a/src/utils/helpers/CryptoUtils.ts b/src/utils/helpers/CryptoUtils.ts index 665a20c..246b5ce 100644 --- a/src/utils/helpers/CryptoUtils.ts +++ b/src/utils/helpers/CryptoUtils.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ /** * Cryptographic utilities for hashing, encoding, and token generation * Isomorphic crypto operations for Node.js and browsers diff --git a/src/utils/helpers/PollingHelper.ts b/src/utils/helpers/PollingHelper.ts index 67c8525..283436d 100644 --- a/src/utils/helpers/PollingHelper.ts +++ b/src/utils/helpers/PollingHelper.ts @@ -187,7 +187,7 @@ export class PollingHelper { const { result, error, - responseTime: _responseTime, + responseTime: _, } = await this.executeAttempt(attempt, responseTimes); if (result !== undefined) { diff --git a/tests/async/debounce.test.ts b/tests/async/debounce.test.ts index f3709ab..3ca2ffb 100644 --- a/tests/async/debounce.test.ts +++ b/tests/async/debounce.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { describe, it, expect, beforeEach, vi } from "vitest"; import { debounceAsync } from "../../src/utils/async/debounce"; diff --git a/tests/async/sequential.test.ts b/tests/async/sequential.test.ts index 02d91da..6a17133 100644 --- a/tests/async/sequential.test.ts +++ b/tests/async/sequential.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { describe, it, expect } from "vitest"; import { sequential } from "../../src/utils/async/sequential"; import { sleep } from "../../src/utils/async/sleep"; diff --git a/tests/async/throttle.test.ts b/tests/async/throttle.test.ts index f77e903..50229e7 100644 --- a/tests/async/throttle.test.ts +++ b/tests/async/throttle.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { describe, it, expect, beforeEach, vi } from "vitest"; import { throttleAsync } from "../../src/utils/async/throttle"; diff --git a/tests/async/validation.test.ts b/tests/async/validation.test.ts index 999a82e..a2a7106 100644 --- a/tests/async/validation.test.ts +++ b/tests/async/validation.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { describe, it, expect } from "vitest"; import { timeout, withTimeout } from "../../src/utils/async/timeout"; import { allSettled } from "../../src/utils/async/allSettled"; diff --git a/tests/cli-main.test.ts b/tests/cli-main.test.ts index 0a82f9f..25e6d0a 100644 --- a/tests/cli-main.test.ts +++ b/tests/cli-main.test.ts @@ -17,7 +17,7 @@ describe("CLI main entry", () => { try { await runCli(["--invalid"]); - } catch (e) { + } catch { // ignore exit error } diff --git a/tests/logger.test.ts b/tests/logger.test.ts index 12b49fe..11087e6 100644 --- a/tests/logger.test.ts +++ b/tests/logger.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { Logger, createLogger, @@ -55,7 +56,7 @@ test("Logger.child creates nested namespaces", () => { test("consoleTransportNode formats correctly", () => { const originalLog = console.log; let output = ""; - // eslint-disable-next-line no-console + console.log = (msg) => { output = msg; }; @@ -71,7 +72,6 @@ test("consoleTransportNode formats correctly", () => { assert.match(output, /INFO.*\[test\].*hello/); - // eslint-disable-next-line no-console console.log = originalLog; }); @@ -82,7 +82,7 @@ test("consoleTransportBrowser formats correctly (mocked environment)", () => { const originalLog = console.log; let output = ""; - // eslint-disable-next-line no-console + console.log = (msg) => { output = msg; }; @@ -97,7 +97,6 @@ test("consoleTransportBrowser formats correctly (mocked environment)", () => { assert.match(output, /%cINFO.*\[test\].*hello/); - // eslint-disable-next-line no-console console.log = originalLog; delete globalThis.window; delete globalThis.document; diff --git a/tests/new-utils.test.ts b/tests/new-utils.test.ts index 61ad34d..f9f8630 100644 --- a/tests/new-utils.test.ts +++ b/tests/new-utils.test.ts @@ -5,8 +5,6 @@ import { PollingHelper, createPoller, CryptoUtils, - PaginationHelper, - createPaginator, CacheManager, createCacheManager, CompressionUtils, diff --git a/tests/retry-policy.test.ts b/tests/retry-policy.test.ts index 32c7b24..0eac3d7 100644 --- a/tests/retry-policy.test.ts +++ b/tests/retry-policy.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { RetryPolicy, CircuitBreaker } from "../src/index"; test("RetryPolicy retries on failure and succeeds", async () => { diff --git a/tests/schema-adapters.test.ts b/tests/schema-adapters.test.ts index e3b926d..41e2655 100644 --- a/tests/schema-adapters.test.ts +++ b/tests/schema-adapters.test.ts @@ -11,7 +11,7 @@ describe("Schema Adapters for ApiClient", () => { // Mock fetch for tests globalThis.fetch = async ( input: RequestInfo | URL, - init?: RequestInit + _init?: RequestInit ) => { const url = input.toString(); diff --git a/tests/setup.ts b/tests/setup.ts index 1359723..3b68ce7 100644 --- a/tests/setup.ts +++ b/tests/setup.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ /** * Jest setup file for wiki documentation system tests * Configures property-based testing with fast-check