Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: lint warning fix for any to unknown #1374 #1397

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ export class QuorumTestLedger implements ITestLedger {
}

public async getFileContents(filePath: string): Promise<string> {
const response: any = await this.getContainer().getArchive({
const response = await this.getContainer().getArchive({
path: filePath,
});
const extract: tar.Extract = tar.extract({ autoDestroy: true });

return new Promise((resolve, reject) => {
let fileContents = "";
extract.on("entry", async (header: any, stream, next) => {
extract.on("entry", async (header: unknown, stream, next) => {
stream.on("error", (err: Error) => {
reject(err);
});
Expand Down Expand Up @@ -227,7 +227,7 @@ export class QuorumTestLedger implements ITestLedger {
PublishAllPorts: true,
},
{},
(err: any) => {
(err: unknown) => {
if (err) {
reject(err);
}
Expand Down Expand Up @@ -279,10 +279,10 @@ export class QuorumTestLedger implements ITestLedger {
} while (!reachable);
}

public stop(): Promise<any> {
public stop(): Promise<unknown> {
return new Promise((resolve, reject) => {
if (this.container) {
this.container.stop({}, (err: any, result: any) => {
this.container.stop({}, (err: unknown, result: unknown) => {
if (err) {
reject(err);
} else {
Expand All @@ -299,7 +299,7 @@ export class QuorumTestLedger implements ITestLedger {
});
}

public destroy(): Promise<any> {
public destroy(): Promise<unknown> {
if (this.container) {
return this.container.remove();
} else {
Expand Down Expand Up @@ -372,25 +372,28 @@ export class QuorumTestLedger implements ITestLedger {
}
}

private pullContainerImage(containerNameAndTag: string): Promise<any[]> {
private pullContainerImage(containerNameAndTag: string): Promise<unknown[]> {
return new Promise((resolve, reject) => {
const docker = new Docker();
docker.pull(containerNameAndTag, (pullError: any, stream: any) => {
if (pullError) {
reject(pullError);
} else {
docker.modem.followProgress(
stream,
(progressError: any, output: any[]) => {
if (progressError) {
reject(progressError);
} else {
resolve(output);
}
},
);
}
});
docker.pull(
containerNameAndTag,
(pullError: unknown, stream: unknown) => {
if (pullError) {
reject(pullError);
} else {
docker.modem.followProgress(
stream,
(progressError: unknown, output: unknown[]) => {
if (progressError) {
reject(progressError);
} else {
resolve(output);
}
},
);
}
},
);
Comment on lines +375 to +396
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yayoiukai2021 I'd fix the compiler error like this:

Suggested change
private pullContainerImage(containerNameAndTag: string): Promise<unknown[]> {
return new Promise((resolve, reject) => {
const docker = new Docker();
docker.pull(containerNameAndTag, (pullError: any, stream: any) => {
if (pullError) {
reject(pullError);
} else {
docker.modem.followProgress(
stream,
(progressError: any, output: any[]) => {
if (progressError) {
reject(progressError);
} else {
resolve(output);
}
},
);
}
});
docker.pull(
containerNameAndTag,
(pullError: unknown, stream: unknown) => {
if (pullError) {
reject(pullError);
} else {
docker.modem.followProgress(
stream,
(progressError: unknown, output: unknown[]) => {
if (progressError) {
reject(progressError);
} else {
resolve(output);
}
},
);
}
},
);
private pullContainerImage(containerNameAndTag: string): Promise<unknown[]> {
return new Promise((resolve, reject) => {
const docker = new Docker();
docker.pull(containerNameAndTag, (pullError: unknown, stream: Stream) => {
if (pullError) {
reject(pullError);
} else {
docker.modem.followProgress(
stream,
(progressError: unknown, output: unknown[]) => {
if (progressError) {
reject(progressError);
} else {
resolve(output);
}
},
);
}
});
});
}

});
}

Expand Down