Skip to content

Commit

Permalink
more cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Jan 27, 2025
1 parent 82cac95 commit 8790957
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/cloudflare/internal/pipeline-transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion src/node/diagnostics_channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/node/internal/crypto.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/node/internal/internal_querystring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/node/internal/internal_url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ export function urlToHttpOptions(url: URL): Record<string, unknown> {
const { hostname, pathname, port, username, password, search } = url;
const options: Record<string, unknown> = {
__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:
Expand Down
2 changes: 1 addition & 1 deletion src/node/internal/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/node/net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8790957

Please sign in to comment.