Skip to content

Commit

Permalink
chore: disable new lint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
yume-chan committed Sep 21, 2023
1 parent aca7df4 commit 9c2a069
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
5 changes: 2 additions & 3 deletions libraries/adb-scrcpy/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,8 @@ export class AdbScrcpyClient {
async #createAudioStream(
initialStream: ReadableStream<Uint8Array>,
): Promise<AdbScrcpyAudioStreamMetadata> {
const metadata = await this.#options.parseAudioStreamMetadata(
initialStream,
);
const metadata =
await this.#options.parseAudioStreamMetadata(initialStream);

switch (metadata.type) {
case "disabled":
Expand Down
8 changes: 6 additions & 2 deletions libraries/adb/src/commands/sync/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { AdbSyncRequestId, adbSyncWriteRequest } from "./request.js";
import { AdbSyncResponseId, adbSyncReadResponses } from "./response.js";
import type { AdbSyncSocket } from "./socket.js";
import type { AdbSyncStat } from "./stat.js";
import { AdbSyncLstatResponse, AdbSyncStatResponse } from "./stat.js";
import {
AdbSyncLstatResponse,
AdbSyncStatErrorCode,
AdbSyncStatResponse,
} from "./stat.js";

export interface AdbSyncEntry extends AdbSyncStat {
name: string;
Expand Down Expand Up @@ -43,7 +47,7 @@ export async function* adbSyncOpenDirV2(
// `LST2` can return error codes for failed `lstat` calls.
// `LIST` just ignores them.
// But they only contain `name` so still pretty useless.
if (item.error !== 0) {
if (item.error !== AdbSyncStatErrorCode.SUCCESS) {
continue;
}
yield item;
Expand Down
4 changes: 2 additions & 2 deletions libraries/adb/src/commands/sync/response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export async function adbSyncReadResponse<T>(
}

export async function* adbSyncReadResponses<
T extends Struct<object, PropertyKey, object, any>,
T extends Struct<object, PropertyKey, object, unknown>,
>(
stream: AsyncExactReadable,
id: AdbSyncResponseId,
Expand All @@ -66,7 +66,7 @@ export async function* adbSyncReadResponses<
await stream.readExactly(type.size);
return;
case id:
yield await type.deserialize(stream);
yield (await type.deserialize(stream)) as StructValueType<T>;
break;
default:
throw new Error(
Expand Down
12 changes: 6 additions & 6 deletions libraries/adb/src/daemon/socket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class AdbDaemonSocketController
await this.#dispatcher.sendPacket(
AdbCommand.Close,
this.localId,
this.remoteId
this.remoteId,
);

// Don't `dispose` here, we need to wait for `CLSE` response packet.
Expand All @@ -118,8 +118,8 @@ export class AdbDaemonSocketController
size(chunk) {
return chunk.byteLength;
},
}
)
},
),
);

this.writable = pipeFrom(
Expand All @@ -132,13 +132,13 @@ export class AdbDaemonSocketController
AdbCommand.Write,
this.localId,
this.remoteId,
chunk
chunk,
);
await this.#writePromise.promise;
},
})
}),
),
new DistributionStream(this.#dispatcher.options.maxPayloadSize)
new DistributionStream(this.#dispatcher.options.maxPayloadSize),
);

this.#socket = new AdbDaemonSocket(this);
Expand Down
1 change: 1 addition & 0 deletions toolchain/eslint-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module.exports = {
],

"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unsafe-enum-comparison": "off",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/no-this-alias": "error",
Expand Down

0 comments on commit 9c2a069

Please sign in to comment.