From 1940c94e2e76d41d1841fdf587c7f8a47d4c1387 Mon Sep 17 00:00:00 2001 From: JrMasterModelBuilder Date: Sun, 1 Oct 2023 23:17:58 -0400 Subject: [PATCH] Lint cleanup --- src/archive.spec.ts | 8 ++------ src/archive.ts | 4 ++-- src/archive/dir.ts | 4 ++-- src/archive/hdi.ts | 4 ++-- src/archive/tar.ts | 4 ++-- src/archive/tar/bz2.ts | 4 ++-- src/archive/tar/gz.ts | 4 ++-- src/archive/zip.ts | 4 ++-- src/util.ts | 6 +++--- 9 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/archive.spec.ts b/src/archive.spec.ts index 4779ef9..c7f4516 100644 --- a/src/archive.spec.ts +++ b/src/archive.spec.ts @@ -181,15 +181,11 @@ export class EntryTest extends Entry { export class ArchiveTest extends Archive { public readonly Entry = EntryTest; - constructor(path: string) { - super(path); - } - - public async read(itter: (entry: EntryTest) => Promise) { + public async read(itter: (entry: EntryTest) => Promise) { await super.read(itter); } - protected async _read(itter: (entry: EntryTest) => Promise) { + protected async _read(itter: (entry: EntryTest) => Promise) { for (const info of testEntries) { const entry = new this.Entry({archive: this, ...info}); // eslint-disable-next-line no-await-in-loop diff --git a/src/archive.ts b/src/archive.ts index c609ab8..3fb4dd4 100644 --- a/src/archive.ts +++ b/src/archive.ts @@ -894,7 +894,7 @@ export abstract class Archive { * * @param itter Async callback for each archive entry. */ - public async read(itter: (entry: Entry) => Promise) { + public async read(itter: (entry: Entry) => Promise) { if (this._reading) { throw new Error('Archive already being read'); } @@ -948,6 +948,6 @@ export abstract class Archive { * @param itter Async callback for each archive entry. */ protected abstract _read( - itter: (entry: Entry) => Promise + itter: (entry: Entry) => Promise ): Promise; } diff --git a/src/archive/dir.ts b/src/archive/dir.ts index 77a17c2..a73faf7 100644 --- a/src/archive/dir.ts +++ b/src/archive/dir.ts @@ -198,7 +198,7 @@ export class ArchiveDir extends Archive { * * @param itter Async callback for each archive entry. */ - public async read(itter: (entry: EntryDir) => Promise) { + public async read(itter: (entry: EntryDir) => Promise) { await super.read(itter); } @@ -209,7 +209,7 @@ export class ArchiveDir extends Archive { * * @param itter Async callback for each archive entry. */ - protected async _read(itter: (entry: EntryDir) => Promise) { + protected async _read(itter: (entry: EntryDir) => Promise) { /** * Each itterator. * diff --git a/src/archive/hdi.ts b/src/archive/hdi.ts index f804c9f..4a6dd23 100644 --- a/src/archive/hdi.ts +++ b/src/archive/hdi.ts @@ -213,7 +213,7 @@ export class ArchiveHdi extends Archive { * * @param itter Async callback for each archive entry. */ - public async read(itter: (entry: EntryHdi) => Promise) { + public async read(itter: (entry: EntryHdi) => Promise) { await super.read(itter); } @@ -224,7 +224,7 @@ export class ArchiveHdi extends Archive { * * @param itter Async callback for each archive entry. */ - protected async _read(itter: (entry: EntryHdi) => Promise) { + protected async _read(itter: (entry: EntryHdi) => Promise) { /** * Each itterator. * diff --git a/src/archive/tar.ts b/src/archive/tar.ts index d8cc939..b3367b8 100644 --- a/src/archive/tar.ts +++ b/src/archive/tar.ts @@ -246,7 +246,7 @@ export class ArchiveTar extends Archive { * * @param itter Async callback for each archive entry. */ - public async read(itter: (entry: EntryTar) => Promise) { + public async read(itter: (entry: EntryTar) => Promise) { await super.read(itter); } @@ -256,7 +256,7 @@ export class ArchiveTar extends Archive { * * @param itter Async callback for each archive entry. */ - protected async _read(itter: (entry: EntryTar) => Promise) { + protected async _read(itter: (entry: EntryTar) => Promise) { /** * Each itterator. * diff --git a/src/archive/tar/bz2.ts b/src/archive/tar/bz2.ts index 9386faa..192137b 100644 --- a/src/archive/tar/bz2.ts +++ b/src/archive/tar/bz2.ts @@ -66,7 +66,7 @@ export class ArchiveTarBz2 extends ArchiveTar { * * @param itter Async callback for each archive entry. */ - public async read(itter: (entry: EntryTarBz2) => Promise) { + public async read(itter: (entry: EntryTarBz2) => Promise) { await super.read(itter); } @@ -76,7 +76,7 @@ export class ArchiveTarBz2 extends ArchiveTar { * * @param itter Async callback for each archive entry. */ - protected async _read(itter: (entry: EntryTarBz2) => Promise) { + protected async _read(itter: (entry: EntryTarBz2) => Promise) { await super._read(itter); } diff --git a/src/archive/tar/gz.ts b/src/archive/tar/gz.ts index d28c3de..2f3a4e7 100644 --- a/src/archive/tar/gz.ts +++ b/src/archive/tar/gz.ts @@ -66,7 +66,7 @@ export class ArchiveTarGz extends ArchiveTar { * * @param itter Async callback for each archive entry. */ - public async read(itter: (entry: EntryTarGz) => Promise) { + public async read(itter: (entry: EntryTarGz) => Promise) { await super.read(itter); } @@ -76,7 +76,7 @@ export class ArchiveTarGz extends ArchiveTar { * * @param itter Async callback for each archive entry. */ - protected async _read(itter: (entry: EntryTarGz) => Promise) { + protected async _read(itter: (entry: EntryTarGz) => Promise) { await super._read(itter); } diff --git a/src/archive/zip.ts b/src/archive/zip.ts index 9346fdc..9040fc0 100644 --- a/src/archive/zip.ts +++ b/src/archive/zip.ts @@ -367,7 +367,7 @@ export class ArchiveZip extends Archive { * * @param itter Async callback for each archive entry. */ - public async read(itter: (entry: EntryZip) => Promise) { + public async read(itter: (entry: EntryZip) => Promise) { await super.read(itter); } @@ -377,7 +377,7 @@ export class ArchiveZip extends Archive { * * @param itter Async callback for each archive entry. */ - protected async _read(itter: (entry: EntryZip) => Promise) { + protected async _read(itter: (entry: EntryZip) => Promise) { const zipfile = await new Promise((resolve, reject) => { yauzl.open(this.path, {lazyEntries: true}, (err, zipfile) => { if (err) { diff --git a/src/util.ts b/src/util.ts index 0ac57e9..726daaa 100644 --- a/src/util.ts +++ b/src/util.ts @@ -38,7 +38,7 @@ export function defaultValue( value: T, defaultValue: U ): Exclude { - // eslint-disable-next-line no-undefined, @typescript-eslint/no-unsafe-return + // eslint-disable-next-line no-undefined, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any return value === undefined ? defaultValue : (value as any); } @@ -305,8 +305,8 @@ export function streamToReadable(stream: Readable) { }); // Forward errors both ways. - const errorsA = new Set(); - const errorsB = new Set(); + const errorsA = new Set(); + const errorsB = new Set(); stream.on('error', err => { if (errorsA.has(err)) { return;