From 167c3677b18eafb5293540526e46ee97d9fc55e8 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Fri, 10 Jan 2025 09:56:27 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20fix=20linting=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There were some linting errors that were causing our tests to fail. --- fx/parallel.ts | 4 +++- fx/race.ts | 1 + fx/request.ts | 15 +++++++++------ fx/safe.ts | 1 + 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/fx/parallel.ts b/fx/parallel.ts index ca71b32..39755f6 100644 --- a/fx/parallel.ts +++ b/fx/parallel.ts @@ -61,7 +61,9 @@ export interface ParallelRet extends Computation[]> { * } * ``` */ -export function parallel(operations: Callable[]) { +export function parallel( + operations: Callable[], +): Operation> { const sequence = createChannel>(); const immediate = createChannel>(); const results: Result[] = []; diff --git a/fx/race.ts b/fx/race.ts index 9927ffc..4f89351 100644 --- a/fx/race.ts +++ b/fx/race.ts @@ -1,3 +1,4 @@ +// deno-lint-ignore-file no-explicit-any import type { Callable, Operation, Task } from "npm:effection@3.0.3"; import { action, call, resource, spawn } from "npm:effection@3.0.3"; diff --git a/fx/request.ts b/fx/request.ts index 85efff3..eef4e0b 100644 --- a/fx/request.ts +++ b/fx/request.ts @@ -1,12 +1,15 @@ -import { call, useAbortSignal } from "npm:effection@3.0.3"; +import { call, type Operation, useAbortSignal } from "npm:effection@3.0.3"; -export function* request(url: string | URL | Request, opts?: RequestInit) { +export function* request( + url: string | URL | Request, + opts?: RequestInit, +): Operation { const signal = yield* useAbortSignal(); - const response = yield* call(fetch(url, { signal, ...opts })); + const response = yield* call(() => fetch(url, { signal, ...opts })); return response; } -export function* json(response: Response) { - const result = yield* call(response.json()); - return result; +// deno-lint-ignore no-explicit-any +export function* json(response: Response): Operation { + return yield* call(() => response.json()); } diff --git a/fx/safe.ts b/fx/safe.ts index 7df8034..dd008ad 100644 --- a/fx/safe.ts +++ b/fx/safe.ts @@ -25,6 +25,7 @@ function isError(error: unknown): error is Error { export function* safe(operator: Callable): Operation> { try { + // deno-lint-ignore no-explicit-any const value = yield* call(operator as any); return Ok(value); } catch (error) {