diff --git a/lib/bluetooth.ts b/lib/bluetooth.ts index 4cb64ac..8d9d57d 100644 --- a/lib/bluetooth.ts +++ b/lib/bluetooth.ts @@ -160,7 +160,7 @@ export class MicrobitWebBluetoothConnection this.connection = await createBluetoothDeviceWrapper( device, this.logging, - (type, event) => this.dispatchTypedEvent(type, event) + (type, event) => this.dispatchTypedEvent(type, event), ); } // TODO: timeout unification? @@ -170,7 +170,7 @@ export class MicrobitWebBluetoothConnection } private async chooseDevice( - options: ConnectOptions + options: ConnectOptions, ): Promise { if (this.device) { return this.device; @@ -202,7 +202,7 @@ export class MicrobitWebBluetoothConnection ], }), new Promise<"timeout">((resolve) => - setTimeout(() => resolve("timeout"), requestDeviceTimeoutDuration) + setTimeout(() => resolve("timeout"), requestDeviceTimeoutDuration), ), ]); if (result === "timeout") { diff --git a/lib/device.ts b/lib/device.ts index c34972d..bcb1414 100644 --- a/lib/device.ts +++ b/lib/device.ts @@ -216,7 +216,7 @@ export interface DeviceConnection * The partial parameter reports the flash type currently in progress. */ progress: (percentage: number | undefined, partial: boolean) => void; - } + }, ): Promise; /** diff --git a/lib/usb.ts b/lib/usb.ts index 2cd1f49..c1ba146 100644 --- a/lib/usb.ts +++ b/lib/usb.ts @@ -124,14 +124,14 @@ export class MicrobitWebUSBConnection } }, assumePageIsStayingOpenDelay); }, - { once: true } + { once: true }, ); }; private logging: Logging; constructor( - options: MicrobitWebUSBConnectionOptions = { logging: new NullLogging() } + options: MicrobitWebUSBConnectionOptions = { logging: new NullLogging() }, ) { super(); this.logging = options.logging; @@ -150,7 +150,7 @@ export class MicrobitWebUSBConnection if (window.document) { window.document.addEventListener( "visibilitychange", - this.visibilityChangeListener + this.visibilityChangeListener, ); } } @@ -165,7 +165,7 @@ export class MicrobitWebUSBConnection if (window.document) { window.document.removeEventListener( "visibilitychange", - this.visibilityChangeListener + this.visibilityChangeListener, ); } } @@ -187,13 +187,13 @@ export class MicrobitWebUSBConnection options: { partial: boolean; progress: (percentage: number | undefined) => void; - } + }, ): Promise { this.flashing = true; try { const startTime = new Date().getTime(); await this.withEnrichedErrors(() => - this.flashInternal(dataSource, options) + this.flashInternal(dataSource, options), ); this.dispatchTypedEvent("flash", new FlashEvent()); @@ -215,7 +215,7 @@ export class MicrobitWebUSBConnection options: { partial: boolean; progress: (percentage: number | undefined, partial: boolean) => void; - } + }, ): Promise { this.log("Stopping serial before flash"); await this.stopSerialInternal(); @@ -327,7 +327,7 @@ export class MicrobitWebUSBConnection // Log error to console for feedback this.log("An error occurred whilst attempting to use WebUSB."); this.log( - "Details of the error can be found below, and may be useful when trying to replicate and debug the error." + "Details of the error can be found below, and may be useful when trying to replicate and debug the error.", ); this.log(e);