Skip to content

Commit

Permalink
Lint cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JrMasterModelBuilder committed Oct 2, 2023
1 parent 85629c2 commit 1940c94
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 23 deletions.
8 changes: 2 additions & 6 deletions src/archive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any>) {
public async read(itter: (entry: EntryTest) => Promise<unknown>) {
await super.read(itter);
}

protected async _read(itter: (entry: EntryTest) => Promise<any>) {
protected async _read(itter: (entry: EntryTest) => Promise<unknown>) {
for (const info of testEntries) {
const entry = new this.Entry({archive: this, ...info});
// eslint-disable-next-line no-await-in-loop
Expand Down
4 changes: 2 additions & 2 deletions src/archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ export abstract class Archive {
*
* @param itter Async callback for each archive entry.
*/
public async read(itter: (entry: Entry) => Promise<any>) {
public async read(itter: (entry: Entry) => Promise<unknown>) {
if (this._reading) {
throw new Error('Archive already being read');
}
Expand Down Expand Up @@ -948,6 +948,6 @@ export abstract class Archive {
* @param itter Async callback for each archive entry.
*/
protected abstract _read(
itter: (entry: Entry) => Promise<any>
itter: (entry: Entry) => Promise<unknown>
): Promise<void>;
}
4 changes: 2 additions & 2 deletions src/archive/dir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class ArchiveDir extends Archive {
*
* @param itter Async callback for each archive entry.
*/
public async read(itter: (entry: EntryDir) => Promise<any>) {
public async read(itter: (entry: EntryDir) => Promise<unknown>) {
await super.read(itter);
}

Expand All @@ -209,7 +209,7 @@ export class ArchiveDir extends Archive {
*
* @param itter Async callback for each archive entry.
*/
protected async _read(itter: (entry: EntryDir) => Promise<any>) {
protected async _read(itter: (entry: EntryDir) => Promise<unknown>) {
/**
* Each itterator.
*
Expand Down
4 changes: 2 additions & 2 deletions src/archive/hdi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export class ArchiveHdi extends Archive {
*
* @param itter Async callback for each archive entry.
*/
public async read(itter: (entry: EntryHdi) => Promise<any>) {
public async read(itter: (entry: EntryHdi) => Promise<unknown>) {
await super.read(itter);
}

Expand All @@ -224,7 +224,7 @@ export class ArchiveHdi extends Archive {
*
* @param itter Async callback for each archive entry.
*/
protected async _read(itter: (entry: EntryHdi) => Promise<any>) {
protected async _read(itter: (entry: EntryHdi) => Promise<unknown>) {
/**
* Each itterator.
*
Expand Down
4 changes: 2 additions & 2 deletions src/archive/tar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export class ArchiveTar extends Archive {
*
* @param itter Async callback for each archive entry.
*/
public async read(itter: (entry: EntryTar) => Promise<any>) {
public async read(itter: (entry: EntryTar) => Promise<unknown>) {
await super.read(itter);
}

Expand All @@ -256,7 +256,7 @@ export class ArchiveTar extends Archive {
*
* @param itter Async callback for each archive entry.
*/
protected async _read(itter: (entry: EntryTar) => Promise<any>) {
protected async _read(itter: (entry: EntryTar) => Promise<unknown>) {
/**
* Each itterator.
*
Expand Down
4 changes: 2 additions & 2 deletions src/archive/tar/bz2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class ArchiveTarBz2 extends ArchiveTar {
*
* @param itter Async callback for each archive entry.
*/
public async read(itter: (entry: EntryTarBz2) => Promise<any>) {
public async read(itter: (entry: EntryTarBz2) => Promise<unknown>) {
await super.read(itter);
}

Expand All @@ -76,7 +76,7 @@ export class ArchiveTarBz2 extends ArchiveTar {
*
* @param itter Async callback for each archive entry.
*/
protected async _read(itter: (entry: EntryTarBz2) => Promise<any>) {
protected async _read(itter: (entry: EntryTarBz2) => Promise<unknown>) {
await super._read(itter);
}

Expand Down
4 changes: 2 additions & 2 deletions src/archive/tar/gz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class ArchiveTarGz extends ArchiveTar {
*
* @param itter Async callback for each archive entry.
*/
public async read(itter: (entry: EntryTarGz) => Promise<any>) {
public async read(itter: (entry: EntryTarGz) => Promise<unknown>) {
await super.read(itter);
}

Expand All @@ -76,7 +76,7 @@ export class ArchiveTarGz extends ArchiveTar {
*
* @param itter Async callback for each archive entry.
*/
protected async _read(itter: (entry: EntryTarGz) => Promise<any>) {
protected async _read(itter: (entry: EntryTarGz) => Promise<unknown>) {
await super._read(itter);
}

Expand Down
4 changes: 2 additions & 2 deletions src/archive/zip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ export class ArchiveZip extends Archive {
*
* @param itter Async callback for each archive entry.
*/
public async read(itter: (entry: EntryZip) => Promise<any>) {
public async read(itter: (entry: EntryZip) => Promise<unknown>) {
await super.read(itter);
}

Expand All @@ -377,7 +377,7 @@ export class ArchiveZip extends Archive {
*
* @param itter Async callback for each archive entry.
*/
protected async _read(itter: (entry: EntryZip) => Promise<any>) {
protected async _read(itter: (entry: EntryZip) => Promise<unknown>) {
const zipfile = await new Promise<yauzl.ZipFile>((resolve, reject) => {
yauzl.open(this.path, {lazyEntries: true}, (err, zipfile) => {
if (err) {
Expand Down
6 changes: 3 additions & 3 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function defaultValue<T, U>(
value: T,
defaultValue: U
): Exclude<T | U, undefined> {
// 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);
}

Expand Down Expand Up @@ -305,8 +305,8 @@ export function streamToReadable(stream: Readable) {
});

// Forward errors both ways.
const errorsA = new Set<any>();
const errorsB = new Set<any>();
const errorsA = new Set<Error>();
const errorsB = new Set<Error>();
stream.on('error', err => {
if (errorsA.has(err)) {
return;
Expand Down

0 comments on commit 1940c94

Please sign in to comment.