From f5dc12414a607a56d879bb8c8c1572295175ebbb Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 27 Jan 2025 16:19:33 -0500 Subject: [PATCH] more cleaning --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- src/cloudflare/internal/pipeline-transform.ts | 2 ++ src/node/diagnostics_channel.ts | 1 - src/node/internal/crypto.d.ts | 4 ++-- src/node/internal/internal_querystring.ts | 3 ++- src/node/internal/internal_url.ts | 1 + src/node/internal/validators.ts | 2 +- src/node/net.ts | 1 - 9 files changed, 14 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 6fdc3832f4e..c1b31569026 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "esbuild": "^0.24.2", "eslint": "^9.19.0", "eslint-plugin-import": "^2.31.0", - "expect-type": "^0.20.0", + "expect-type": "^1.1.0", "typescript-eslint": "^8.22.0" }, "pnpm": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 81af1258df0..a6f602a2afd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -46,8 +46,8 @@ importers: specifier: ^2.31.0 version: 2.31.0(@typescript-eslint/parser@8.22.0(eslint@9.19.0)(typescript@5.5.4))(eslint@9.19.0) expect-type: - specifier: ^0.20.0 - version: 0.20.0 + specifier: ^1.1.0 + version: 1.1.0 typescript-eslint: specifier: ^8.22.0 version: 8.22.0(eslint@9.19.0)(typescript@5.5.4) @@ -602,8 +602,8 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - expect-type@0.20.0: - resolution: {integrity: sha512-uHaC9LYNv6BcW+8SvXcwUUDCrrUxt3GSa61DFvTHj8JC+M0hekMFBwMlCarLQDk5bbpZ2vStpnQPIwRuV98YMw==} + expect-type@1.1.0: + resolution: {integrity: sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==} engines: {node: '>=12.0.0'} fast-deep-equal@3.1.3: @@ -1782,7 +1782,7 @@ snapshots: esutils@2.0.3: {} - expect-type@0.20.0: {} + expect-type@1.1.0: {} fast-deep-equal@3.1.3: {} diff --git a/src/cloudflare/internal/pipeline-transform.ts b/src/cloudflare/internal/pipeline-transform.ts index 47f04efe90f..19480039e8e 100644 --- a/src/cloudflare/internal/pipeline-transform.ts +++ b/src/cloudflare/internal/pipeline-transform.ts @@ -12,6 +12,7 @@ async function* readLines( let partial = ''; // @ts-expect-error must have a '[Symbol.asyncIterator]()' method + // eslint-disable-next-line @typescript-eslint/await-thenable for await (const chunk of stream) { const full = partial + (chunk as string); for (const char of full) { @@ -94,6 +95,7 @@ export class PipelineTransformImpl extends entrypoints.WorkerEntrypoint { this.#initalized = true; switch (this.#batch.format) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition case Format.JSON_STREAM: { const data = await this.#readJsonStream(); const transformed = await this.transformJson(data); diff --git a/src/node/diagnostics_channel.ts b/src/node/diagnostics_channel.ts index 236f482e256..616a38eb7d6 100644 --- a/src/node/diagnostics_channel.ts +++ b/src/node/diagnostics_channel.ts @@ -194,7 +194,6 @@ export class TracingChannel { if (!(promise instanceof Promise)) { promise = Promise.resolve(promise); } - // eslint-disable-next-line @typescript-eslint/use-unknown-in-catch-callback-variable return promise.then(resolve, reject); } catch (err) { context.error = err; diff --git a/src/node/internal/crypto.d.ts b/src/node/internal/crypto.d.ts index 6657c9339e3..b5f2bbe6c6a 100644 --- a/src/node/internal/crypto.d.ts +++ b/src/node/internal/crypto.d.ts @@ -12,8 +12,8 @@ export function checkPrimeSync( export function randomPrime( size: number, safe: boolean, - add?: ArrayBufferView | undefined, - rem?: ArrayBufferView | undefined + add?: ArrayBufferView, + rem?: ArrayBufferView ): ArrayBuffer; // X509Certificate diff --git a/src/node/internal/internal_querystring.ts b/src/node/internal/internal_querystring.ts index 21f8d39b94c..88fed12bfaa 100644 --- a/src/node/internal/internal_querystring.ts +++ b/src/node/internal/internal_querystring.ts @@ -209,8 +209,9 @@ const noEscape = new Int8Array([ export function escape(input: unknown): string { let str: string; if (typeof input !== 'string') { + // eslint-disable-next-line @typescript-eslint/no-base-to-string if (typeof input === 'object') str = String(input); - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + // eslint-disable-next-line @typescript-eslint/restrict-plus-operands,@typescript-eslint/no-base-to-string else str = input + ''; } else { str = input; diff --git a/src/node/internal/internal_url.ts b/src/node/internal/internal_url.ts index d07ce4199b4..f258e6dcd4e 100644 --- a/src/node/internal/internal_url.ts +++ b/src/node/internal/internal_url.ts @@ -269,6 +269,7 @@ export function urlToHttpOptions(url: URL): Record { const { hostname, pathname, port, username, password, search } = url; const options: Record = { __proto__: null, + // eslint-disable-next-line @typescript-eslint/no-misused-spread ...url, // In case the url object was extended by the user. protocol: url.protocol, hostname: diff --git a/src/node/internal/validators.ts b/src/node/internal/validators.ts index ae9cd5ed44a..6747edaae60 100644 --- a/src/node/internal/validators.ts +++ b/src/node/internal/validators.ts @@ -284,7 +284,7 @@ export function checkRangesOrGetDefault( name: string, lower: number, upper: number, - def?: number | undefined + def?: number ): number | undefined; export function checkRangesOrGetDefault( number: unknown, diff --git a/src/node/net.ts b/src/node/net.ts index cceaa065022..251196b5425 100644 --- a/src/node/net.ts +++ b/src/node/net.ts @@ -1028,7 +1028,6 @@ function initializeConnection( handle.closed.then( onConnectionClosed.bind(socket), - // eslint-disable-next-line @typescript-eslint/use-unknown-in-catch-callback-variable socket.destroy.bind(socket) ); } catch (err) {