Skip to content

Commit 240ecd9

Browse files
committed
refactor: avoid using any type by importing correct type for fetch
1 parent f818f96 commit 240ecd9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/release.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Octokit } from '@octokit/rest'
22
import { writeFile } from 'fs/promises'
33
import { getProxyForUrl } from 'proxy-from-env'
44
import { fetch, ProxyAgent } from 'undici'
5+
import type { RequestInit } from 'undici'
56
import os from 'os'
67
import { extract } from 'tar'
78
import tmp from 'tmp-promise'
@@ -29,8 +30,7 @@ export async function downloadBinary(url: string) {
2930
await tmpfile.cleanup()
3031
}
3132

32-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
33-
export async function proxiedFetch(url: string, opts: any = {}) {
33+
export async function proxiedFetch(url: string, opts: RequestInit = {}) {
3434
const proxy = getProxyForUrl(url)
3535
if (!proxy) {
3636
return fetch(url, { ...opts })
@@ -40,10 +40,10 @@ export async function proxiedFetch(url: string, opts: any = {}) {
4040
uri: getProxyForUrl(url),
4141
keepAliveTimeout: 10,
4242
keepAliveMaxTimeout: 10,
43-
});
43+
})
4444

4545
return fetch(url, { ...opts, dispatcher: proxyAgent })
46-
};
46+
}
4747

4848
function getRelease(version: string) {
4949
const { getLatestRelease, getReleaseByTag } = octokit.rest.repos

0 commit comments

Comments
 (0)