From 730aac8da23bcf2a7a2c93e33d96a8d2f81e5fd8 Mon Sep 17 00:00:00 2001 From: Simon Chan <1330321+yume-chan@users.noreply.github.com> Date: Tue, 15 Mar 2022 16:10:18 +0800 Subject: [PATCH] chore: disable importsNotUsedAsValues --- libraries/adb-backend-webusb/src/backend.ts | 2 +- libraries/adb-backend-ws/src/index.ts | 2 +- libraries/adb/src/adb.ts | 8 ++++---- libraries/adb/src/auth.ts | 2 +- libraries/adb/src/commands/subprocess/protocol.ts | 4 ++-- libraries/adb/src/commands/sync/response.ts | 2 +- libraries/adb/src/socket/dispatcher.ts | 4 ++-- libraries/adb/src/socket/socket.ts | 2 +- libraries/adb/src/stream/transform.ts | 2 +- libraries/scrcpy/src/client.ts | 2 +- libraries/scrcpy/src/options/1_16/index.ts | 2 +- libraries/scrcpy/src/options/1_22.ts | 2 +- libraries/struct/src/struct.ts | 2 +- libraries/struct/src/types/bigint.ts | 2 +- libraries/struct/src/types/buffer/base.ts | 4 ++-- libraries/struct/src/types/number.ts | 2 +- toolchain/ts-package-builder/tsconfig.base.json | 1 - 17 files changed, 22 insertions(+), 23 deletions(-) diff --git a/libraries/adb-backend-webusb/src/backend.ts b/libraries/adb-backend-webusb/src/backend.ts index c007d065..a5f158fa 100644 --- a/libraries/adb-backend-webusb/src/backend.ts +++ b/libraries/adb-backend-webusb/src/backend.ts @@ -1,4 +1,4 @@ -import { AdbBackend, DuplexStreamFactory, ReadableStream, ReadableWritablePair } from '@yume-chan/adb'; +import { DuplexStreamFactory, type AdbBackend, type ReadableStream, type ReadableWritablePair } from '@yume-chan/adb'; export const WebUsbDeviceFilter: USBDeviceFilter = { classCode: 0xFF, diff --git a/libraries/adb-backend-ws/src/index.ts b/libraries/adb-backend-ws/src/index.ts index bdd71a1d..27b7c045 100644 --- a/libraries/adb-backend-ws/src/index.ts +++ b/libraries/adb-backend-ws/src/index.ts @@ -1,4 +1,4 @@ -import { AdbBackend, DuplexStreamFactory } from '@yume-chan/adb'; +import { DuplexStreamFactory, type AdbBackend } from '@yume-chan/adb'; export default class AdbWsBackend implements AdbBackend { public readonly serial: string; diff --git a/libraries/adb/src/adb.ts b/libraries/adb/src/adb.ts index 894f12b6..13ede430 100644 --- a/libraries/adb/src/adb.ts +++ b/libraries/adb/src/adb.ts @@ -1,10 +1,10 @@ import { PromiseResolver } from '@yume-chan/async'; -import { AdbAuthenticationHandler, AdbCredentialStore, AdbDefaultAuthenticators } from './auth'; -import { AdbFrameBuffer, AdbPower, AdbReverseCommand, AdbSubprocess, AdbSync, AdbTcpIpCommand, escapeArg, framebuffer, install } from './commands'; +import { AdbAuthenticationHandler, AdbDefaultAuthenticators, type AdbCredentialStore } from './auth'; +import { AdbPower, AdbReverseCommand, AdbSubprocess, AdbSync, AdbTcpIpCommand, escapeArg, framebuffer, install, type AdbFrameBuffer } from './commands'; import { AdbFeatures } from './features'; -import { AdbCommand, AdbPacket, AdbPacketCore, AdbPacketInit, AdbPacketSerializeStream, calculateChecksum } from './packet'; +import { AdbCommand, AdbPacket, AdbPacketSerializeStream, calculateChecksum, type AdbPacketCore, type AdbPacketInit } from './packet'; import { AdbPacketDispatcher, AdbSocket } from './socket'; -import { AbortController, DecodeUtf8Stream, GatherStringStream, pipeFrom, ReadableWritablePair, StructDeserializeStream, WritableStream } from "./stream"; +import { AbortController, DecodeUtf8Stream, GatherStringStream, pipeFrom, StructDeserializeStream, WritableStream, type ReadableWritablePair } from "./stream"; import { decodeUtf8, encodeUtf8 } from "./utils"; export enum AdbPropKey { diff --git a/libraries/adb/src/auth.ts b/libraries/adb/src/auth.ts index 9450e52b..7c301623 100644 --- a/libraries/adb/src/auth.ts +++ b/libraries/adb/src/auth.ts @@ -2,7 +2,7 @@ import { PromiseResolver } from '@yume-chan/async'; import type { Disposable } from '@yume-chan/event'; import type { ValueOrPromise } from '@yume-chan/struct'; import { calculatePublicKey, calculatePublicKeyLength, sign } from './crypto'; -import { AdbCommand, AdbPacket, AdbPacketCore } from './packet'; +import { AdbCommand, AdbPacket, type AdbPacketCore } from './packet'; import { calculateBase64EncodedLength, encodeBase64 } from './utils'; export type AdbKeyIterable = Iterable | AsyncIterable; diff --git a/libraries/adb/src/commands/subprocess/protocol.ts b/libraries/adb/src/commands/subprocess/protocol.ts index bbb8dd16..53064d00 100644 --- a/libraries/adb/src/commands/subprocess/protocol.ts +++ b/libraries/adb/src/commands/subprocess/protocol.ts @@ -1,9 +1,9 @@ import { PromiseResolver } from "@yume-chan/async"; -import Struct, { placeholder, StructValueType } from "@yume-chan/struct"; +import Struct, { placeholder, type StructValueType } from "@yume-chan/struct"; import type { Adb } from "../../adb"; import { AdbFeatures } from "../../features"; import type { AdbSocket } from "../../socket"; -import { PushReadableStream, PushReadableStreamController, ReadableStream, StructDeserializeStream, StructSerializeStream, TransformStream, WritableStream, WritableStreamDefaultWriter } from "../../stream"; +import { PushReadableStream, ReadableStream, StructDeserializeStream, StructSerializeStream, TransformStream, WritableStream, WritableStreamDefaultWriter, type PushReadableStreamController } from "../../stream"; import { encodeUtf8 } from "../../utils"; import type { AdbSubprocessProtocol } from "./types"; diff --git a/libraries/adb/src/commands/sync/response.ts b/libraries/adb/src/commands/sync/response.ts index c36d1a1c..7e698a68 100644 --- a/libraries/adb/src/commands/sync/response.ts +++ b/libraries/adb/src/commands/sync/response.ts @@ -1,4 +1,4 @@ -import Struct, { StructAsyncDeserializeStream, StructLike, StructValueType } from '@yume-chan/struct'; +import Struct, { type StructAsyncDeserializeStream, type StructLike, type StructValueType } from '@yume-chan/struct'; import type { AdbBufferedStream } from '../../stream'; import { decodeUtf8 } from "../../utils"; diff --git a/libraries/adb/src/socket/dispatcher.ts b/libraries/adb/src/socket/dispatcher.ts index cd60dfc4..0bc95314 100644 --- a/libraries/adb/src/socket/dispatcher.ts +++ b/libraries/adb/src/socket/dispatcher.ts @@ -1,7 +1,7 @@ import { AsyncOperationManager } from '@yume-chan/async'; import { AutoDisposable, EventEmitter } from '@yume-chan/event'; -import { AdbCommand, AdbPacket, AdbPacketCore, AdbPacketInit, calculateChecksum } from '../packet'; -import { AbortController, ReadableWritablePair, WritableStream, WritableStreamDefaultWriter } from '../stream'; +import { AdbCommand, AdbPacket, calculateChecksum, type AdbPacketCore, type AdbPacketInit } from '../packet'; +import { AbortController, WritableStream, WritableStreamDefaultWriter, type ReadableWritablePair } from '../stream'; import { decodeUtf8, encodeUtf8 } from '../utils'; import { AdbSocket } from './socket'; diff --git a/libraries/adb/src/socket/socket.ts b/libraries/adb/src/socket/socket.ts index c84af0d7..c45e7d3b 100644 --- a/libraries/adb/src/socket/socket.ts +++ b/libraries/adb/src/socket/socket.ts @@ -1,6 +1,6 @@ import { PromiseResolver } from "@yume-chan/async"; import { AdbCommand } from '../packet'; -import { ChunkStream, DuplexStreamFactory, pipeFrom, PushReadableStreamController, ReadableStream, WritableStream } from '../stream'; +import { ChunkStream, DuplexStreamFactory, pipeFrom, ReadableStream, WritableStream, type PushReadableStreamController } from '../stream'; import type { AdbPacketDispatcher } from './dispatcher'; export interface AdbSocketInfo { diff --git a/libraries/adb/src/stream/transform.ts b/libraries/adb/src/stream/transform.ts index c3ffd02e..3a7d1c71 100644 --- a/libraries/adb/src/stream/transform.ts +++ b/libraries/adb/src/stream/transform.ts @@ -3,7 +3,7 @@ import type Struct from "@yume-chan/struct"; import type { StructValueType } from "@yume-chan/struct"; import { decodeUtf8 } from "../utils"; import { BufferedStream, BufferedStreamEndedError } from "./buffered"; -import { AbortController, AbortSignal, QueuingStrategy, ReadableStream, ReadableStreamController, ReadableStreamDefaultReader, ReadableWritablePair, TransformStream, UnderlyingSink, UnderlyingSource, WritableStream, WritableStreamDefaultWriter } from "./detect"; +import { AbortController, AbortSignal, ReadableStream, ReadableStreamDefaultReader, TransformStream, WritableStream, WritableStreamDefaultWriter, type QueuingStrategy, type ReadableStreamController, type ReadableWritablePair, type UnderlyingSink, type UnderlyingSource } from "./detect"; export interface DuplexStreamFactoryOptions { preventCloseReadableStreams?: boolean | undefined; diff --git a/libraries/scrcpy/src/client.ts b/libraries/scrcpy/src/client.ts index bc3b0fbe..23eb8b88 100644 --- a/libraries/scrcpy/src/client.ts +++ b/libraries/scrcpy/src/client.ts @@ -1,4 +1,4 @@ -import { Adb, AdbBufferedStream, AdbNoneSubprocessProtocol, AdbSocket, AdbSubprocessProtocol, DecodeUtf8Stream, InspectStream, ReadableStream, TransformStream, WritableStreamDefaultWriter } from '@yume-chan/adb'; +import { Adb, AdbBufferedStream, AdbNoneSubprocessProtocol, AdbSocket, DecodeUtf8Stream, InspectStream, ReadableStream, TransformStream, WritableStreamDefaultWriter, type AdbSubprocessProtocol } from '@yume-chan/adb'; import { EventEmitter } from '@yume-chan/event'; import Struct from '@yume-chan/struct'; import { AndroidMotionEventAction, ScrcpyControlMessageType, ScrcpyInjectKeyCodeControlMessage, ScrcpyInjectTextControlMessage, ScrcpyInjectTouchControlMessage, type AndroidKeyEventAction } from './message'; diff --git a/libraries/scrcpy/src/options/1_16/index.ts b/libraries/scrcpy/src/options/1_16/index.ts index ea12e495..dcc477a5 100644 --- a/libraries/scrcpy/src/options/1_16/index.ts +++ b/libraries/scrcpy/src/options/1_16/index.ts @@ -1,7 +1,7 @@ import { BufferedStreamEndedError, ReadableStream, TransformStream, type Adb, type AdbBufferedStream } from "@yume-chan/adb"; import Struct, { placeholder } from "@yume-chan/struct"; import type { AndroidCodecLevel, AndroidCodecProfile } from "../../codec"; -import { ScrcpyClientConnection, ScrcpyClientConnectionOptions, ScrcpyClientForwardConnection, ScrcpyClientReverseConnection } from "../../connection"; +import { ScrcpyClientConnection, ScrcpyClientForwardConnection, ScrcpyClientReverseConnection, type ScrcpyClientConnectionOptions } from "../../connection"; import { AndroidKeyEventAction, ScrcpyControlMessageType } from "../../message"; import type { ScrcpyBackOrScreenOnEvent1_18 } from "../1_18"; import type { ScrcpyInjectScrollControlMessage1_22 } from "../1_22"; diff --git a/libraries/scrcpy/src/options/1_22.ts b/libraries/scrcpy/src/options/1_22.ts index b4eed1b9..b30790e1 100644 --- a/libraries/scrcpy/src/options/1_22.ts +++ b/libraries/scrcpy/src/options/1_22.ts @@ -1,6 +1,6 @@ import type { Adb } from "@yume-chan/adb"; import Struct from "@yume-chan/struct"; -import { ScrcpyClientConnectionOptions, ScrcpyClientForwardConnection, ScrcpyClientReverseConnection, type ScrcpyClientConnection } from "../connection"; +import { ScrcpyClientForwardConnection, ScrcpyClientReverseConnection, type ScrcpyClientConnection, type ScrcpyClientConnectionOptions } from "../connection"; import { ScrcpyInjectScrollControlMessage1_16 } from "./1_16"; import { ScrcpyOptions1_21, type ScrcpyOptionsInit1_21 } from "./1_21"; diff --git a/libraries/struct/src/struct.ts b/libraries/struct/src/struct.ts index 0df55d72..2f20b6bc 100644 --- a/libraries/struct/src/struct.ts +++ b/libraries/struct/src/struct.ts @@ -3,7 +3,7 @@ import type { StructAsyncDeserializeStream, StructDeserializeStream, StructFieldDefinition, StructFieldValue, StructOptions } from './basic'; import { StructDefaultOptions, StructValue } from './basic'; import { Syncbird } from "./syncbird"; -import { BigIntFieldDefinition, BigIntFieldType, BufferFieldSubType, FixedLengthBufferLikeFieldDefinition, FixedLengthBufferLikeFieldOptions, LengthField, NumberFieldDefinition, NumberFieldType, StringBufferFieldSubType, Uint8ArrayBufferFieldSubType, VariableLengthBufferLikeFieldDefinition, VariableLengthBufferLikeFieldOptions } from './types'; +import { BigIntFieldDefinition, BigIntFieldType, BufferFieldSubType, FixedLengthBufferLikeFieldDefinition, NumberFieldDefinition, NumberFieldType, StringBufferFieldSubType, Uint8ArrayBufferFieldSubType, VariableLengthBufferLikeFieldDefinition, type FixedLengthBufferLikeFieldOptions, type LengthField, type VariableLengthBufferLikeFieldOptions } from './types'; import type { Evaluate, Identity, Overwrite, ValueOrPromise } from "./utils"; export interface StructLike { diff --git a/libraries/struct/src/types/bigint.ts b/libraries/struct/src/types/bigint.ts index c9379021..bdb01295 100644 --- a/libraries/struct/src/types/bigint.ts +++ b/libraries/struct/src/types/bigint.ts @@ -1,7 +1,7 @@ // cspell: ignore syncbird import { getBigInt64, getBigUint64, setBigInt64, setBigUint64 } from '@yume-chan/dataview-bigint-polyfill/esm/fallback'; -import { StructAsyncDeserializeStream, StructDeserializeStream, StructFieldDefinition, StructFieldValue, StructOptions, StructValue } from "../basic"; +import { StructFieldDefinition, StructFieldValue, StructValue, type StructAsyncDeserializeStream, type StructDeserializeStream, type StructOptions } from "../basic"; import { Syncbird } from "../syncbird"; import type { ValueOrPromise } from "../utils"; diff --git a/libraries/struct/src/types/buffer/base.ts b/libraries/struct/src/types/buffer/base.ts index d98ec004..9d88eb3e 100644 --- a/libraries/struct/src/types/buffer/base.ts +++ b/libraries/struct/src/types/buffer/base.ts @@ -1,8 +1,8 @@ // cspell: ignore syncbird -import { StructAsyncDeserializeStream, StructDeserializeStream, StructFieldDefinition, StructFieldValue, StructOptions, StructValue } from '../../basic'; +import { StructFieldDefinition, StructFieldValue, StructValue, type StructAsyncDeserializeStream, type StructDeserializeStream, type StructOptions } from '../../basic'; import { Syncbird } from "../../syncbird"; -import { decodeUtf8, encodeUtf8, ValueOrPromise } from "../../utils"; +import { decodeUtf8, encodeUtf8, type ValueOrPromise } from "../../utils"; /** * Base class for all types that diff --git a/libraries/struct/src/types/number.ts b/libraries/struct/src/types/number.ts index c7471de5..1d64f8c8 100644 --- a/libraries/struct/src/types/number.ts +++ b/libraries/struct/src/types/number.ts @@ -1,6 +1,6 @@ // cspell: ignore syncbird -import { StructAsyncDeserializeStream, StructDeserializeStream, StructFieldDefinition, StructFieldValue, StructOptions, StructValue } from '../basic'; +import { StructFieldDefinition, StructFieldValue, StructValue, type StructAsyncDeserializeStream, type StructDeserializeStream, type StructOptions } from '../basic'; import { Syncbird } from "../syncbird"; import type { ValueOrPromise } from "../utils"; diff --git a/toolchain/ts-package-builder/tsconfig.base.json b/toolchain/ts-package-builder/tsconfig.base.json index 36f757c5..26eea596 100644 --- a/toolchain/ts-package-builder/tsconfig.base.json +++ b/toolchain/ts-package-builder/tsconfig.base.json @@ -34,7 +34,6 @@ "noImplicitThis": true, "noUncheckedIndexedAccess": true, "resolveJsonModule": true, - "importsNotUsedAsValues": "error", /* Module Resolution Options */ "moduleResolution": "Node", // /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */