fix(lint): resolve no-unused-vars errors flagged by CI

- bounded-retry.ts:103 — drop unused generic parameter <T> from
  BoundedRetryOptions interface (and its single use at line 220).
  The generic served no purpose: the caller's return type is inferred
  from the operation function, not from the options.
- retry-utils.test.ts:5 — remove `beforeEach` from imports. It was
  only used by the RetryManager describe block, removed in commit
  0f2402da58.

Build clean, 58 tests pass (12 bounded-retry + 46 retry-utils).
This commit is contained in:
Renato Alcara
2026-04-26 23:53:55 -03:00
parent 0f2402da58
commit d0bbf85e6a
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -100,7 +100,7 @@ export const DEFAULT_TTL_MS = 10 * 60 * 1000
*/ */
export const DEFAULT_PER_ATTEMPT_TIMEOUT_MS = 30000 export const DEFAULT_PER_ATTEMPT_TIMEOUT_MS = 30000
export interface BoundedRetryOptions<T> { export interface BoundedRetryOptions {
/** Operation name for logging/metrics */ /** Operation name for logging/metrics */
name?: string name?: string
/** Sequence of delays (ms). Last value is used as cap. */ /** Sequence of delays (ms). Last value is used as cap. */
@@ -217,7 +217,7 @@ function sleep(ms: number, signal?: AbortSignal): Promise<void> {
*/ */
export async function withBoundedRetry<T>( export async function withBoundedRetry<T>(
operation: () => Promise<T>, operation: () => Promise<T>,
options: BoundedRetryOptions<T> = {} options: BoundedRetryOptions = {}
): Promise<T> { ): Promise<T> {
const name = options.name ?? 'bounded-retry' const name = options.name ?? 'bounded-retry'
const delays = options.delays ?? WHATSAPP_BACKOFF_DELAYS const delays = options.delays ?? WHATSAPP_BACKOFF_DELAYS
+1 -1
View File
@@ -2,7 +2,7 @@
* Testes unitários para retry-utils.ts * Testes unitários para retry-utils.ts
*/ */
import { beforeEach, describe, expect, it, jest } from '@jest/globals' import { describe, expect, it, jest } from '@jest/globals'
import { import {
calculateDelay, calculateDelay,
createRetrier, createRetrier,