From 52f298cfa6812195ad89d58d15e3e469be52db57 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 21 Jun 2024 12:42:47 +0200 Subject: [PATCH] refactor: silence linter MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../broadcast-channel/UIServiceWorkerBroadcastChannel.ts | 9 ++++++--- .../ui-server/ui-services/AbstractUIService.ts | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/charging-station/broadcast-channel/UIServiceWorkerBroadcastChannel.ts b/src/charging-station/broadcast-channel/UIServiceWorkerBroadcastChannel.ts index ef07b5da..1157c71e 100644 --- a/src/charging-station/broadcast-channel/UIServiceWorkerBroadcastChannel.ts +++ b/src/charging-station/broadcast-channel/UIServiceWorkerBroadcastChannel.ts @@ -70,6 +70,7 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel { : ResponseStatus.FAILURE return { status: responsesStatus, + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain hashIdsSucceeded: this.responses .get(uuid) ?.responses.map(({ status, hashId }) => { @@ -78,8 +79,9 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel { } return undefined }) - .filter(hashId => hashId != null) as string[], + .filter(hashId => hashId != null)!, ...(responsesStatus === ResponseStatus.FAILURE && { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain hashIdsFailed: this.responses .get(uuid) ?.responses.map(({ status, hashId }) => { @@ -88,9 +90,10 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel { } return undefined }) - .filter(hashId => hashId != null) as string[] + .filter(hashId => hashId != null)! }), ...(responsesStatus === ResponseStatus.FAILURE && { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain responsesFailed: this.responses .get(uuid) ?.responses.map(response => { @@ -99,7 +102,7 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel { } return undefined }) - .filter(response => response != null) as BroadcastChannelResponsePayload[] + .filter(response => response != null)! }) } } diff --git a/src/charging-station/ui-server/ui-services/AbstractUIService.ts b/src/charging-station/ui-server/ui-services/AbstractUIService.ts index ffdc2565..e37c632b 100644 --- a/src/charging-station/ui-server/ui-services/AbstractUIService.ts +++ b/src/charging-station/ui-server/ui-services/AbstractUIService.ts @@ -223,7 +223,7 @@ export abstract class AbstractUIService { ) return undefined }) - .filter(hashId => hashId != null) as string[] + .filter(hashId => hashId != null) } else { delete payload.hashIds } -- 2.34.1