From 2f3cbe3c9702dd06e6b490dbf1c4a60b1fa5d32b Mon Sep 17 00:00:00 2001 From: William Chong Date: Wed, 28 Feb 2024 17:10:38 +0400 Subject: [PATCH] Remove unused imports --- src/__test__/connection/reconnect/all-nodes-down.test.ts | 4 ++-- src/__test__/extra/typedEvents-more.test.ts | 1 - src/__test__/extra/write-after-end.test.ts | 1 - .../streams/appendToStream-batch-append-flood.test.ts | 1 - src/__test__/streams/readStream.test.ts | 5 ++--- src/__test__/streams/subscribeToAll.test.ts | 2 +- src/__test__/tsconfig.json | 2 +- src/__test__/utils/Cluster.ts | 1 - src/__test__/utils/matchServerVersion.ts | 7 ------- 9 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/__test__/connection/reconnect/all-nodes-down.test.ts b/src/__test__/connection/reconnect/all-nodes-down.test.ts index 699f4f8b..68c0de50 100644 --- a/src/__test__/connection/reconnect/all-nodes-down.test.ts +++ b/src/__test__/connection/reconnect/all-nodes-down.test.ts @@ -89,7 +89,7 @@ describe("reconnect", () => { // read the stream await expect(async () => { let count = 0; - for await (const e of client.readStream(STREAM_NAME, { maxCount: 10 })) { + for await (const _ of client.readStream(STREAM_NAME, { maxCount: 10 })) { count++; } }).rejects.toThrowErrorMatchingInlineSnapshot( @@ -127,7 +127,7 @@ describe("reconnect", () => { // read the stream await expect(async () => { let count = 0; - for await (const e of client.readStream(STREAM_NAME, { maxCount: 10 })) { + for await (const _ of client.readStream(STREAM_NAME, { maxCount: 10 })) { count++; } }).rejects.toThrowErrorMatchingInlineSnapshot( diff --git a/src/__test__/extra/typedEvents-more.test.ts b/src/__test__/extra/typedEvents-more.test.ts index d8435f79..b1b67bdd 100644 --- a/src/__test__/extra/typedEvents-more.test.ts +++ b/src/__test__/extra/typedEvents-more.test.ts @@ -220,7 +220,6 @@ describe("typed events should compile", () => { confirmedAt: new Date(event.data.confirmedAt), }; default: { - const _: never = event; throw ShoppingCartErrors.UNKNOWN_EVENT_TYPE; } } diff --git a/src/__test__/extra/write-after-end.test.ts b/src/__test__/extra/write-after-end.test.ts index f363a0b3..f60bdad6 100644 --- a/src/__test__/extra/write-after-end.test.ts +++ b/src/__test__/extra/write-after-end.test.ts @@ -12,7 +12,6 @@ import { EventData, EventStoreDBClient, jsonEvent, - JSONEventType, UnavailableError, } from "@eventstore/db-client"; diff --git a/src/__test__/streams/appendToStream-batch-append-flood.test.ts b/src/__test__/streams/appendToStream-batch-append-flood.test.ts index 06c9767c..c99013f8 100644 --- a/src/__test__/streams/appendToStream-batch-append-flood.test.ts +++ b/src/__test__/streams/appendToStream-batch-append-flood.test.ts @@ -1,5 +1,4 @@ /** @jest-environment ./src/__test__/utils/enableVersionCheck.ts */ -import type { Duplex } from "stream"; import { createTestNode, diff --git a/src/__test__/streams/readStream.test.ts b/src/__test__/streams/readStream.test.ts index 54b70e76..8abdbb57 100644 --- a/src/__test__/streams/readStream.test.ts +++ b/src/__test__/streams/readStream.test.ts @@ -18,7 +18,6 @@ import { StreamNotFoundError, ResolvedEvent, LinkEvent, - Position, AppendResult, InvalidArgumentError, } from "@eventstore/db-client"; @@ -230,7 +229,7 @@ describe("readStream", () => { test("stream revision invalid argument lower bound", async () => { let count = 0; try { - for await (const e of client.readStream(STREAM_NAME, { + for await (const _ of client.readStream(STREAM_NAME, { direction: BACKWARDS, fromRevision: BigInt(-1), })) { @@ -244,7 +243,7 @@ describe("readStream", () => { test("stream revision invalid argument upper bound", async () => { let count = 0; try { - for await (const e of client.readStream(STREAM_NAME, { + for await (const _ of client.readStream(STREAM_NAME, { direction: BACKWARDS, fromRevision: BigInt("18446744073709551616"), })) { diff --git a/src/__test__/streams/subscribeToAll.test.ts b/src/__test__/streams/subscribeToAll.test.ts index ac64895c..816ee6ae 100644 --- a/src/__test__/streams/subscribeToAll.test.ts +++ b/src/__test__/streams/subscribeToAll.test.ts @@ -1,6 +1,6 @@ /** @jest-environment ./src/__test__/utils/enableVersionCheck.ts */ -import { pipeline, Writable, Readable, finished } from "stream"; +import { pipeline, Writable, Readable } from "stream"; import { promisify } from "util"; import { diff --git a/src/__test__/tsconfig.json b/src/__test__/tsconfig.json index dc035cc9..5f7bd510 100644 --- a/src/__test__/tsconfig.json +++ b/src/__test__/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "noUnusedLocals": false, + "noUnusedLocals": true, "paths": { "@eventstore/db-client": ["../"], "@test-utils": ["./utils"] diff --git a/src/__test__/utils/Cluster.ts b/src/__test__/utils/Cluster.ts index 8ac766cb..afe91687 100644 --- a/src/__test__/utils/Cluster.ts +++ b/src/__test__/utils/Cluster.ts @@ -11,7 +11,6 @@ import type { EndPoint } from "../../types"; import { testDebug } from "./debug"; import { dockerImages } from "./dockerImages"; -import { delay } from "./delay"; const rmdir = promisify(fs.rmdir); const mkdir = promisify(fs.mkdir); diff --git a/src/__test__/utils/matchServerVersion.ts b/src/__test__/utils/matchServerVersion.ts index 83290444..d0f06e85 100644 --- a/src/__test__/utils/matchServerVersion.ts +++ b/src/__test__/utils/matchServerVersion.ts @@ -49,13 +49,6 @@ const parseMatchVersion = (matchString: string): MatchVersion => { if (!match) throw `Malformed version match string ${matchString}`; - const groups = match.groups as { - operator?: string; - year: string; - month?: string; - patch?: string; - }; - if (!match || !match.groups) { throw `Malformed version match string ${matchString}`; }