Skip to content

Commit f962ec9

Browse files
author
QA Autopilot
committed
improve: replace any types and @ts-ignore in SDK client (qa-proposal)
Category: type-safety Severity: high Repo: altimate-code
1 parent 5d0ada3 commit f962ec9

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/sdk/js/src/client.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ export { type Config as OpencodeClientConfig, OpencodeClient }
77

88
export function createOpencodeClient(config?: Config & { directory?: string }) {
99
if (!config?.fetch) {
10-
const customFetch: any = (req: any) => {
11-
// @ts-ignore
12-
req.timeout = false
10+
const customFetch = (req: Request) => {
11+
;(req as Request & { timeout: boolean }).timeout = false
1312
return fetch(req)
1413
}
1514
config = {

packages/sdk/js/src/v2/client.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ export { type Config as OpencodeClientConfig, OpencodeClient }
77

88
export function createOpencodeClient(config?: Config & { directory?: string; experimental_workspaceID?: string }) {
99
if (!config?.fetch) {
10-
const customFetch: any = (req: any) => {
11-
// @ts-ignore
12-
req.timeout = false
10+
const customFetch = (req: Request) => {
11+
;(req as Request & { timeout: boolean }).timeout = false
1312
return fetch(req)
1413
}
1514
config = {

0 commit comments

Comments
 (0)