]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
refactor: remove unnecessary type assertions across monorepo
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 11 May 2026 18:43:22 +0000 (20:43 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 11 May 2026 18:43:22 +0000 (20:43 +0200)
commitf2fe22cada0c10ff63eb5d0ee6ca8f79a74de430
tree59a6708497fab936b056a7320d262bac43ff85f1
parentc73f6612bc904ee49ddb910a4e8e3a18ae5c7b8a
refactor: remove unnecessary type assertions across monorepo

- Remove all @typescript-eslint/no-unnecessary-type-assertion violations
- Add assertIsJsonObject/isJsonObject utilities for runtime-safe narrowing
- Restructure OCPP16RequestService.buildRequestPayload with proper
  runtime validation (assertIsJsonObject + OCPPError) replacing unsafe cast
- Use _syncResult assignment pattern in OCPPResponseService for
  no-floating-promises compliance while preserving isAsyncFunction pattern
- Refine AsyncLock.runExclusive fn parameter as union of function types
  for proper isAsyncFunction type guard narrowing
- Configure varsIgnorePattern: '^_' for @typescript-eslint/no-unused-vars
- Remove unused type imports in test files
65 files changed:
eslint.config.js
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts
src/charging-station/ocpp/1.6/OCPP16RequestService.ts
src/charging-station/ocpp/1.6/OCPP16ResponseService.ts
src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts
src/charging-station/ocpp/2.0/OCPP20CertificateManager.ts
src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.ts
src/charging-station/ocpp/2.0/OCPP20RequestService.ts
src/charging-station/ocpp/2.0/OCPP20ResponseService.ts
src/charging-station/ocpp/2.0/OCPP20VariableRegistry.ts
src/charging-station/ocpp/2.0/__testable__/OCPP20RequestServiceTestable.ts
src/charging-station/ocpp/OCPPResponseService.ts
src/charging-station/ocpp/OCPPServiceUtils.ts
src/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.ts
src/performance/storage/MongoDBStorage.ts
src/utils/AsyncLock.ts
src/utils/ChargingStationConfigurationUtils.ts
src/utils/Utils.ts
src/utils/index.ts
tests/charging-station/ChargingStation-Resilience.test.ts
tests/charging-station/ConfigurationKeyUtils.test.ts
tests/charging-station/Helpers.test.ts
tests/charging-station/SharedLRUCache.test.ts
tests/charging-station/helpers/StationHelpers.ts
tests/charging-station/ocpp/1.6/OCPP16RequestService-CallChain.test.ts
tests/charging-station/ocpp/1.6/OCPP16ResponseService-SimpleHandlers.test.ts
tests/charging-station/ocpp/1.6/OCPP16ServiceUtils-MeterValues.test.ts
tests/charging-station/ocpp/1.6/OCPP16ServiceUtils.test.ts
tests/charging-station/ocpp/1.6/OCPP16TestUtils.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-CertificateSigned.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GetTransactionStatus.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-RemoteStartAuth.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-UnlockConnector.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-UpdateFirmware.test.ts
tests/charging-station/ocpp/2.0/OCPP20RequestService-CallChain.test.ts
tests/charging-station/ocpp/2.0/OCPP20RequestService-NotifyReport.test.ts
tests/charging-station/ocpp/2.0/OCPP20ResponseService-BootNotification.test.ts
tests/charging-station/ocpp/2.0/OCPP20ResponseService-SimpleHandlers.test.ts
tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-PostTransactionDelay.test.ts
tests/charging-station/ocpp/2.0/OCPP20VariableManager.test.ts
tests/charging-station/ocpp/OCPPServiceOperations.test.ts
tests/charging-station/ocpp/OCPPServiceUtils-pure.test.ts
tests/charging-station/ui-server/UIHttpServer.test.ts
tests/charging-station/ui-server/UIMCPServer.test.ts
tests/performance/storage/MikroOrmStorage.test.ts
tests/performance/storage/MongoDBStorage.test.ts
tests/performance/storage/StorageTestHelpers.ts
tests/utils/ChargingStationConfigurationUtils.test.ts
tests/utils/Configuration.test.ts
ui/cli/src/client/ws-adapter.ts
ui/cli/src/commands/atg.ts
ui/cli/src/commands/ocpp.ts
ui/cli/src/commands/station.ts
ui/cli/src/commands/supervision.ts
ui/cli/src/config/loader.ts
ui/cli/tests/format.test.ts
ui/cli/tests/helpers.ts
ui/cli/tests/ws-adapter.test.ts
ui/common/src/client/WebSocketClient.ts
ui/common/src/client/adapter.ts
ui/common/tests/adapter.test.ts
ui/common/tests/browser-adapter.test.ts
ui/web/tests/unit/shared/composables/useTheme.test.ts
ui/web/tests/unit/skins/modern/ConnectorRow.test.ts
ui/web/tests/unit/skins/modern/Dialogs.test.ts