From cb2700eaae49a82d052079a27994d0db04b01dde Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Wed, 28 Apr 2021 21:29:51 -0700 Subject: [PATCH] fastboot: Fix unused argument warnings These arguments are supposed to be present in order to conform to the types, so prefix them with _ to suppress the warnings. --- src/factory.ts | 2 +- src/fastboot.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/factory.ts b/src/factory.ts index 5248e4c..700a923 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -155,7 +155,7 @@ export async function flashZip( blob: Blob, wipe: boolean, onReconnect: ReconnectCallback, - onProgress: FactoryProgressCallback = (action: string, item: string, progress: number) => {} + onProgress: FactoryProgressCallback = (_action: string, _item: string, _progress: number) => {} ) { onProgress("load", "package", 0.0); let reader = new ZipReader(new BlobReader(blob)); diff --git a/src/fastboot.ts b/src/fastboot.ts index 2b56699..b94835c 100644 --- a/src/fastboot.ts +++ b/src/fastboot.ts @@ -431,7 +431,7 @@ export class FastbootDevice { * @param {FlashProgressCallback} onProgress - Callback for upload progress updates. * @throws {FastbootError} */ - async upload(partition: string, buffer: ArrayBuffer, onProgress: FlashProgressCallback = (progress) => {}) { + async upload(partition: string, buffer: ArrayBuffer, onProgress: FlashProgressCallback = (_progress) => {}) { common.logDebug( `Uploading single sparse to ${partition}: ${buffer.byteLength} bytes` ); @@ -500,7 +500,7 @@ export class FastbootDevice { * @param {FlashProgressCallback} onProgress - Callback for flashing progress updates. * @throws {FastbootError} */ - async flashBlob(partition: string, blob: Blob, onProgress: FlashProgressCallback = (progress) => {}) { + async flashBlob(partition: string, blob: Blob, onProgress: FlashProgressCallback = (_progress) => {}) { // Use current slot if partition is A/B if ((await this.getVariable(`has-slot:${partition}`)) === "yes") { partition += "_" + (await this.getVariable("current-slot")); @@ -577,7 +577,7 @@ export class FastbootDevice { * @param {ReconnectCallback} onReconnect - Callback to request device reconnection. * @param {FactoryProgressCallback} onProgress - Progress callback for image flashing. */ - async flashFactoryZip(blob: Blob, wipe: boolean, onReconnect: ReconnectCallback, onProgress: FactoryProgressCallback = (progress) => {}) { + async flashFactoryZip(blob: Blob, wipe: boolean, onReconnect: ReconnectCallback, onProgress: FactoryProgressCallback = (_progress) => {}) { return await flashFactoryZip(this, blob, wipe, onReconnect, onProgress); } } -- GitLab