refactor: revert overzealous enums ordering
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 23 Aug 2024 19:00:50 +0000 (21:00 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 23 Aug 2024 19:00:50 +0000 (21:00 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/charging-station/Bootstrap.ts
src/types/WebSocket.ts
src/types/ocpp/MessageType.ts

index 2603de82de31e29b749c72874821244fd3cc16f4..b7178ad4db1953110a08417cfec8ef04fa234317 100644 (file)
@@ -51,11 +51,14 @@ import { UIServerFactory } from './ui-server/UIServerFactory.js'
 const moduleName = 'Bootstrap'
 
 enum exitCodes {
-  duplicateChargingStationTemplateUrls = 2,
-  gracefulShutdownError = 4,
+  succeeded = 0,
+  // eslint-disable-next-line perfectionist/sort-enums
   missingChargingStationsConfiguration = 1,
+  // eslint-disable-next-line perfectionist/sort-enums
+  duplicateChargingStationTemplateUrls = 2,
   noChargingStationTemplates = 3,
-  succeeded = 0
+  // eslint-disable-next-line perfectionist/sort-enums
+  gracefulShutdownError = 4
 }
 
 export class Bootstrap extends EventEmitter {
index 753c2268d2b7f4227fe9a3d748b1d64b4f041dda..94b85c866d6669f877372d68b49cef9202bd2026 100644 (file)
@@ -1,3 +1,4 @@
+/* eslint-disable perfectionist/sort-enums */
 export const WebSocketCloseEventStatusString: Record<WebSocketCloseEventStatusCode, string> =
   Object.freeze({
     1000: 'Normal Closure',
@@ -19,22 +20,22 @@ export const WebSocketCloseEventStatusString: Record<WebSocketCloseEventStatusCo
   })
 
 export enum WebSocketCloseEventStatusCode {
-  CLOSE_ABNORMAL = 1006,
-  CLOSE_BAD_GATEWAY = 1014,
-  CLOSE_GOING_AWAY = 1001,
-  CLOSE_INVALID_PAYLOAD = 1007,
-  CLOSE_MISSING_EXTENSION = 1010,
-  CLOSE_NO_STATUS = 1005,
   CLOSE_NORMAL = 1000,
-  CLOSE_POLICY_VIOLATION = 1008,
+  CLOSE_GOING_AWAY = 1001,
   CLOSE_PROTOCOL_ERROR = 1002,
+  CLOSE_UNSUPPORTED = 1003,
   CLOSE_RESERVED = 1004,
+  CLOSE_NO_STATUS = 1005,
+  CLOSE_ABNORMAL = 1006,
+  CLOSE_INVALID_PAYLOAD = 1007,
+  CLOSE_POLICY_VIOLATION = 1008,
+  CLOSE_TOO_LARGE = 1009,
+  CLOSE_MISSING_EXTENSION = 1010,
   CLOSE_SERVER_INTERNAL_ERROR = 1011,
   CLOSE_SERVICE_RESTART = 1012,
-  CLOSE_TLS_HANDSHAKE = 1015,
-  CLOSE_TOO_LARGE = 1009,
   CLOSE_TRY_AGAIN_LATER = 1013,
-  CLOSE_UNSUPPORTED = 1003
+  CLOSE_BAD_GATEWAY = 1014,
+  CLOSE_TLS_HANDSHAKE = 1015
 }
 
 export interface WSError extends Error {
index 446f25c4533f028e8339440f61a1fb105ef1d4a1..8e82ff85905154ac1fe5fefb4fbe59e5914294ce 100644 (file)
@@ -1,5 +1,6 @@
 export enum MessageType {
-  CALL_ERROR_MESSAGE = 4, // Callee to Caller
   CALL_MESSAGE = 2, // Caller to Callee
-  CALL_RESULT_MESSAGE = 3 // Callee to Caller
+  CALL_RESULT_MESSAGE = 3, // Callee to Caller
+  // eslint-disable-next-line perfectionist/sort-enums
+  CALL_ERROR_MESSAGE = 4 // Callee to Caller
 }