From: Jérôme Benoit Date: Fri, 21 Jun 2024 10:42:47 +0000 (+0200) Subject: refactor: silence linter X-Git-Tag: v1.3.7~31 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=52f298cfa6812195ad89d58d15e3e469be52db57;p=e-mobility-charging-stations-simulator.git refactor: silence linter Signed-off-by: Jérôme Benoit --- 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 }