From: Jérôme Benoit Date: Fri, 29 Dec 2023 17:58:18 +0000 (+0100) Subject: refactor: more coding style fixes X-Git-Tag: v1.2.31~20 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a807045be19c1ed4996a44d8c2c8774e926dc6dc;p=e-mobility-charging-stations-simulator.git refactor: more coding style fixes Signed-off-by: Jérôme Benoit --- diff --git a/.lintstagedrc.js b/.lintstagedrc.js index 0124480b..0eef8bcc 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -1,5 +1,5 @@ export default { '{src,tests}/**/*.{ts,tsx,cts,mts}': ['prettier --cache --write', 'eslint --cache --fix'], '**/*.{json,md,yml,yaml}': ['prettier --cache --write'], - '**/*.{js,jsx,cjs,mjs}': ['prettier --cache --write', 'eslint --cache --fix'] + '**/*.{js,jsx,cjs,mjs}': ['prettier --cache --write', 'eslint --cache --fix'], } diff --git a/.prettierrc.json b/.prettierrc.json index 6632aaeb..baeeb0d4 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -3,5 +3,5 @@ "printWidth": 100, "semi": false, "singleQuote": true, - "trailingComma": "none" + "trailingComma": "es5" } diff --git a/package.json b/package.json index 6d773d66..a31aa5ee 100644 --- a/package.json +++ b/package.json @@ -136,14 +136,13 @@ "esbuild-plugin-clean": "^1.0.1", "esbuild-plugin-copy": "^2.1.1", "eslint": "^8.56.0", - "eslint-config-prettier": "^9.1.0", "eslint-config-standard": "^17.1.0", "eslint-config-standard-with-typescript": "^43.0.0", "eslint-define-config": "^2.1.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", "eslint-plugin-jsdoc": "^46.9.1", - "eslint-plugin-n": "^16.5.0", + "eslint-plugin-n": "^16.6.0", "eslint-plugin-prettier": "^5.1.2", "eslint-plugin-tsdoc": "^0.2.17", "expect": "^29.7.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2bb140e3..5ebf99fa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -135,15 +135,12 @@ devDependencies: eslint: specifier: ^8.56.0 version: 8.56.0 - eslint-config-prettier: - specifier: ^9.1.0 - version: 9.1.0(eslint@8.56.0) eslint-config-standard: specifier: ^17.1.0 - version: 17.1.0(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.5.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0) + version: 17.1.0(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0) eslint-config-standard-with-typescript: specifier: ^43.0.0 - version: 43.0.0(@typescript-eslint/eslint-plugin@6.16.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.5.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) + version: 43.0.0(@typescript-eslint/eslint-plugin@6.16.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3) eslint-define-config: specifier: ^2.1.0 version: 2.1.0 @@ -157,11 +154,11 @@ devDependencies: specifier: ^46.9.1 version: 46.9.1(eslint@8.56.0) eslint-plugin-n: - specifier: ^16.5.0 - version: 16.5.0(eslint@8.56.0) + specifier: ^16.6.0 + version: 16.6.0(eslint@8.56.0) eslint-plugin-prettier: specifier: ^5.1.2 - version: 5.1.2(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.1.1) + version: 5.1.2(eslint@8.56.0)(prettier@3.1.1) eslint-plugin-tsdoc: specifier: ^0.2.17 version: 0.2.17 @@ -1901,19 +1898,19 @@ packages: event-target-shim: 5.0.1 dev: true - /acorn-jsx@5.3.2(acorn@8.11.2): + /acorn-jsx@5.3.2(acorn@8.11.3): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.11.2 + acorn: 8.11.3 dev: true /acorn-loose@8.3.0: resolution: {integrity: sha512-75lAs9H19ldmW+fAbyqHdjgdCrz0pWGXKmnqFoh8PyVd1L2RIb4RzYrSjmopeqv3E1G3/Pimu6GgLlrGbrkF7w==} engines: {node: '>=0.4.0'} dependencies: - acorn: 8.11.2 + acorn: 8.11.3 /acorn-node@1.8.2: resolution: {integrity: sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==} @@ -1932,14 +1929,19 @@ packages: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} + /acorn-walk@8.3.1: + resolution: {integrity: sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==} + engines: {node: '>=0.4.0'} + dev: true + /acorn@7.4.1: resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} engines: {node: '>=0.4.0'} hasBin: true dev: true - /acorn@8.11.2: - resolution: {integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==} + /acorn@8.11.3: + resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} engines: {node: '>=0.4.0'} hasBin: true @@ -4175,15 +4177,6 @@ packages: eslint: 8.56.0 dev: true - /eslint-config-prettier@9.1.0(eslint@8.56.0): - resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} - hasBin: true - peerDependencies: - eslint: '>=7.0.0' - dependencies: - eslint: 8.56.0 - dev: true - /eslint-config-standard-jsx@11.0.0(eslint-plugin-react@7.33.2)(eslint@8.56.0): resolution: {integrity: sha512-+1EV/R0JxEK1L0NGolAr8Iktm3Rgotx3BKwgaX+eAuSX8D952LULKtjgZD3F+e6SvibONnhLwoTi9DPxN5LvvQ==} peerDependencies: @@ -4216,7 +4209,7 @@ packages: - supports-color dev: true - /eslint-config-standard-with-typescript@43.0.0(@typescript-eslint/eslint-plugin@6.16.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.5.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3): + /eslint-config-standard-with-typescript@43.0.0(@typescript-eslint/eslint-plugin@6.16.0)(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0)(typescript@5.3.3): resolution: {integrity: sha512-AT0qK01M5bmsWiE3UZvaQO5da1y1n6uQckAKqGNe6zPW5IOzgMLXZxw77nnFm+C11nxAZXsCPrbsgJhSrGfX6Q==} peerDependencies: '@typescript-eslint/eslint-plugin': ^6.4.0 @@ -4229,9 +4222,9 @@ packages: '@typescript-eslint/eslint-plugin': 6.16.0(@typescript-eslint/parser@6.16.0)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': 6.16.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 - eslint-config-standard: 17.1.0(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.5.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0) + eslint-config-standard: 17.1.0(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) - eslint-plugin-n: 16.5.0(eslint@8.56.0) + eslint-plugin-n: 16.6.0(eslint@8.56.0) eslint-plugin-promise: 6.1.1(eslint@8.56.0) typescript: 5.3.3 transitivePeerDependencies: @@ -4252,7 +4245,7 @@ packages: eslint-plugin-promise: 6.1.1(eslint@8.56.0) dev: true - /eslint-config-standard@17.1.0(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.5.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0): + /eslint-config-standard@17.1.0(eslint-plugin-import@2.29.1)(eslint-plugin-n@16.6.0)(eslint-plugin-promise@6.1.1)(eslint@8.56.0): resolution: {integrity: sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==} engines: {node: '>=12.0.0'} peerDependencies: @@ -4263,7 +4256,7 @@ packages: dependencies: eslint: 8.56.0 eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) - eslint-plugin-n: 16.5.0(eslint@8.56.0) + eslint-plugin-n: 16.6.0(eslint@8.56.0) eslint-plugin-promise: 6.1.1(eslint@8.56.0) dev: true @@ -4495,8 +4488,8 @@ packages: semver: 7.5.4 dev: true - /eslint-plugin-n@16.5.0(eslint@8.56.0): - resolution: {integrity: sha512-Hw02Bj1QrZIlKyj471Tb1jSReTl4ghIMHGuBGiMVmw+s0jOPbI4CBuYpGbZr+tdQ+VAvSK6FDSta3J4ib/SKHQ==} + /eslint-plugin-n@16.6.0(eslint@8.56.0): + resolution: {integrity: sha512-Ag3tYFF90lYU8JdHEl9qSSpeLYbVnO+Oj7sgPUarWUacv1mPL3d5h5yG4Bv3tLe71hrcxmgTi7oByYwKXaVatw==} engines: {node: '>=16.0.0'} peerDependencies: eslint: '>=7.0.0' @@ -4506,6 +4499,7 @@ packages: eslint: 8.56.0 eslint-plugin-es-x: 7.5.0(eslint@8.56.0) get-tsconfig: 4.7.2 + globals: 13.24.0 ignore: 5.3.0 is-builtin-module: 3.2.1 is-core-module: 2.13.1 @@ -4514,7 +4508,7 @@ packages: semver: 7.5.4 dev: true - /eslint-plugin-prettier@5.1.2(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.1.1): + /eslint-plugin-prettier@5.1.2(eslint@8.56.0)(prettier@3.1.1): resolution: {integrity: sha512-dhlpWc9vOwohcWmClFcA+HjlvUpuyynYs0Rf+L/P6/0iQE6vlHW9l5bkfzN62/Stm9fbq8ku46qzde76T1xlSg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -4529,7 +4523,6 @@ packages: optional: true dependencies: eslint: 8.56.0 - eslint-config-prettier: 9.1.0(eslint@8.56.0) prettier: 3.1.1 prettier-linter-helpers: 1.0.0 synckit: 0.8.8 @@ -4679,8 +4672,8 @@ packages: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.11.2 - acorn-jsx: 5.3.2(acorn@8.11.2) + acorn: 8.11.3 + acorn-jsx: 5.3.2(acorn@8.11.3) eslint-visitor-keys: 3.4.3 dev: true @@ -6965,7 +6958,7 @@ packages: denque: 2.1.0 iconv-lite: 0.6.3 long: 5.2.3 - moment-timezone: 0.5.43 + moment-timezone: 0.5.44 please-upgrade-node: 3.2.0 /md5.js@1.3.5: @@ -7306,8 +7299,8 @@ packages: xtend: 4.0.2 dev: true - /moment-timezone@0.5.43: - resolution: {integrity: sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ==} + /moment-timezone@0.5.44: + resolution: {integrity: sha512-nv3YpzI/8lkQn0U6RkLd+f0W/zy/JnoR5/EyPz/dNkPTBjA2jNLCVxaiQ8QpeLymhSZvX0wCL5s27NQWdOPwAw==} dependencies: moment: 2.30.1 @@ -9630,7 +9623,7 @@ packages: engines: {node: '>=6.0.0'} hasBin: true dependencies: - acorn: 8.11.2 + acorn: 8.11.3 commander: 2.20.3 source-map: 0.6.1 source-map-support: 0.5.21 @@ -9798,8 +9791,8 @@ packages: '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 '@types/node': 20.10.5 - acorn: 8.11.2 - acorn-walk: 8.2.0 + acorn: 8.11.3 + acorn-walk: 8.3.1 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 diff --git a/prepare.js b/prepare.js index 256ce916..b31baa23 100644 --- a/prepare.js +++ b/prepare.js @@ -1,7 +1,7 @@ import { env } from 'node:process' -const isCIEnvironment = env.CI !== undefined -const isCFEnvironment = env.VCAP_APPLICATION !== undefined +const isCIEnvironment = env.CI != null +const isCFEnvironment = env.VCAP_APPLICATION != null if (isCFEnvironment === false && isCIEnvironment === false) { // eslint-disable-next-line n/no-unpublished-import import('husky').then(({ install }) => install()) diff --git a/skip-preinstall.js b/skip-preinstall.js index fde48de5..e181f0e0 100644 --- a/skip-preinstall.js +++ b/skip-preinstall.js @@ -1,6 +1,6 @@ import { env, exit } from 'node:process' -const skipPreinstall = env.SKIP_PREINSTALL || env.VCAP_APPLICATION !== undefined +const skipPreinstall = parseInt(env.SKIP_PREINSTALL) || env.VCAP_APPLICATION != null if (skipPreinstall) { // eslint-disable-next-line n/no-process-exit exit() diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index 9da371cd..329f7483 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -404,7 +404,7 @@ export class AutomaticTransactionGenerator { } private resetConnectorStatus (connectorStatus: Status | undefined): void { - if (connectorStatus === undefined) { + if (connectorStatus == null) { return } delete connectorStatus?.startDate diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 731cc477..6a8d79fa 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -48,7 +48,7 @@ enum exitCodes { succeeded = 0, missingChargingStationsConfiguration = 1, noChargingStationTemplates = 2, - gracefulShutdownError = 3 + gracefulShutdownError = 3, } export class Bootstrap extends EventEmitter { diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 6df137f8..df029c3a 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -38,6 +38,7 @@ import { getMaxNumberOfEvses, getNumberOfReservableConnectors, getPhaseRotationValue, + hasFeatureProfile, hasReservationExpired, initializeConnectorsMapStatus, propagateSerialNumber, @@ -461,7 +462,7 @@ export class ChargingStation extends EventEmitter { this, StandardParametersKey.AuthorizeRemoteTxRequests ) - return authorizeRemoteTxRequests !== undefined + return authorizeRemoteTxRequests != null ? convertToBoolean(authorizeRemoteTxRequests.value) : false } @@ -471,16 +472,16 @@ export class ChargingStation extends EventEmitter { this, StandardParametersKey.LocalAuthListEnabled ) - return localAuthListEnabled !== undefined ? convertToBoolean(localAuthListEnabled.value) : false + return localAuthListEnabled != null ? convertToBoolean(localAuthListEnabled.value) : false } public getHeartbeatInterval (): number { const HeartbeatInterval = getConfigurationKey(this, StandardParametersKey.HeartbeatInterval) - if (HeartbeatInterval !== undefined) { + if (HeartbeatInterval != null) { return secondsToMilliseconds(convertToInt(HeartbeatInterval.value)) } const HeartBeatInterval = getConfigurationKey(this, StandardParametersKey.HeartBeatInterval) - if (HeartBeatInterval !== undefined) { + if (HeartBeatInterval != null) { return secondsToMilliseconds(convertToInt(HeartBeatInterval.value)) } this.stationInfo?.autoRegister === false && @@ -507,7 +508,7 @@ export class ChargingStation extends EventEmitter { } public startHeartbeat (): void { - if (this.getHeartbeatInterval() > 0 && this.heartbeatSetInterval === undefined) { + if (this.getHeartbeatInterval() > 0 && this.heartbeatSetInterval == null) { this.heartbeatSetInterval = setInterval(() => { this.ocppRequestService .requestHandler(this, RequestCommand.HEARTBEAT) @@ -523,7 +524,7 @@ export class ChargingStation extends EventEmitter { this.getHeartbeatInterval() )}` ) - } else if (this.heartbeatSetInterval !== undefined) { + } else if (this.heartbeatSetInterval != null) { logger.info( `${this.logPrefix()} Heartbeat already started every ${formatDurationMilliSeconds( this.getHeartbeatInterval() @@ -613,7 +614,7 @@ export class ChargingStation extends EventEmitter { } public stopMeterValues (connectorId: number): void { - if (this.getConnectorStatus(connectorId)?.transactionSetInterval !== undefined) { + if (this.getConnectorStatus(connectorId)?.transactionSetInterval != null) { clearInterval(this.getConnectorStatus(connectorId)?.transactionSetInterval) } } @@ -897,7 +898,7 @@ export class ChargingStation extends EventEmitter { public async addReservation (reservation: Reservation): Promise { const reservationFound = this.getReservationBy('reservationId', reservation.reservationId) - if (reservationFound !== undefined) { + if (reservationFound != null) { await this.removeReservation(reservationFound, ReservationTerminationReason.REPLACE_EXISTING) } // eslint-disable-next-line @typescript-eslint/no-non-null-assertion @@ -990,7 +991,7 @@ export class ChargingStation extends EventEmitter { } private setIntervalFlushMessageBuffer (): void { - if (this.flushMessageBufferSetInterval === undefined) { + if (this.flushMessageBufferSetInterval == null) { this.flushMessageBufferSetInterval = setInterval(() => { if (this.isWebSocketConnectionOpened() && this.inAcceptedState()) { this.flushMessageBuffer() @@ -1003,7 +1004,7 @@ export class ChargingStation extends EventEmitter { } private clearIntervalFlushMessageBuffer (): void { - if (this.flushMessageBufferSetInterval !== undefined) { + if (this.flushMessageBufferSetInterval != null) { clearInterval(this.flushMessageBufferSetInterval) delete this.flushMessageBufferSetInterval } @@ -1401,9 +1402,7 @@ export class ChargingStation extends EventEmitter { } if ( isNullOrUndefined(getConfigurationKey(this, StandardParametersKey.LocalAuthListEnabled)) && - getConfigurationKey(this, StandardParametersKey.SupportedFeatureProfiles)?.value?.includes( - SupportedFeatureProfiles.LocalAuthListManagement - ) === true + hasFeatureProfile(this, SupportedFeatureProfiles.LocalAuthListManagement) === true ) { addConfigurationKey(this, StandardParametersKey.LocalAuthListEnabled, 'false') } @@ -2072,7 +2071,7 @@ export class ChargingStation extends EventEmitter { // 0 for disabling private getConnectionTimeout (): number { - if (getConfigurationKey(this, StandardParametersKey.ConnectionTimeOut) !== undefined) { + if (getConfigurationKey(this, StandardParametersKey.ConnectionTimeOut) != null) { return convertToInt( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion getConfigurationKey(this, StandardParametersKey.ConnectionTimeOut)!.value! ?? @@ -2120,7 +2119,7 @@ export class ChargingStation extends EventEmitter { if ( isNotEmptyString(this.stationInfo?.amperageLimitationOcppKey) && // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - getConfigurationKey(this, this.stationInfo.amperageLimitationOcppKey!) !== undefined + getConfigurationKey(this, this.stationInfo.amperageLimitationOcppKey!) != null ) { return ( convertToInt( @@ -2238,12 +2237,12 @@ export class ChargingStation extends EventEmitter { private startWebSocketPing (): void { const webSocketPingInterval: number = - getConfigurationKey(this, StandardParametersKey.WebSocketPingInterval) !== undefined + getConfigurationKey(this, StandardParametersKey.WebSocketPingInterval) != null ? convertToInt( getConfigurationKey(this, StandardParametersKey.WebSocketPingInterval)?.value ) : 0 - if (webSocketPingInterval > 0 && this.webSocketPingSetInterval === undefined) { + if (webSocketPingInterval > 0 && this.webSocketPingSetInterval == null) { this.webSocketPingSetInterval = setInterval(() => { if (this.isWebSocketConnectionOpened()) { this.wsConnection?.ping() @@ -2254,7 +2253,7 @@ export class ChargingStation extends EventEmitter { webSocketPingInterval )}` ) - } else if (this.webSocketPingSetInterval !== undefined) { + } else if (this.webSocketPingSetInterval != null) { logger.info( `${this.logPrefix()} WebSocket ping already started every ${formatDurationSeconds( webSocketPingInterval @@ -2268,7 +2267,7 @@ export class ChargingStation extends EventEmitter { } private stopWebSocketPing (): void { - if (this.webSocketPingSetInterval !== undefined) { + if (this.webSocketPingSetInterval != null) { clearInterval(this.webSocketPingSetInterval) delete this.webSocketPingSetInterval } @@ -2314,7 +2313,7 @@ export class ChargingStation extends EventEmitter { } private stopHeartbeat (): void { - if (this.heartbeatSetInterval !== undefined) { + if (this.heartbeatSetInterval != null) { clearInterval(this.heartbeatSetInterval) delete this.heartbeatSetInterval } diff --git a/src/charging-station/ConfigurationKeyUtils.ts b/src/charging-station/ConfigurationKeyUtils.ts index 044c0923..72fb88d7 100644 --- a/src/charging-station/ConfigurationKeyUtils.ts +++ b/src/charging-station/ConfigurationKeyUtils.ts @@ -46,13 +46,13 @@ export const addConfigurationKey = ( } params = { ...{ overwrite: false, save: false }, ...params } let keyFound = getConfigurationKey(chargingStation, key) - if (keyFound !== undefined && params?.overwrite === true) { + if (keyFound != null && params?.overwrite === true) { deleteConfigurationKey(chargingStation, keyFound.key, { save: false }) keyFound = undefined } - if (keyFound === undefined) { + if (keyFound == null) { chargingStation.ocppConfiguration?.configurationKey?.push({ key, // eslint-disable-next-line @typescript-eslint/no-non-null-assertion @@ -77,7 +77,7 @@ export const setConfigurationKeyValue = ( caseInsensitive = false ): void => { const keyFound = getConfigurationKey(chargingStation, key, caseInsensitive) - if (keyFound !== undefined) { + if (keyFound != null) { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion chargingStation.ocppConfiguration!.configurationKey![ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion @@ -99,7 +99,7 @@ export const deleteConfigurationKey = ( ): ConfigurationKey[] | undefined => { params = { ...{ save: true, caseInsensitive: false }, ...params } const keyFound = getConfigurationKey(chargingStation, key, params?.caseInsensitive) - if (keyFound !== undefined) { + if (keyFound != null) { const deletedConfigurationKey = chargingStation.ocppConfiguration?.configurationKey?.splice( chargingStation.ocppConfiguration.configurationKey.indexOf(keyFound), 1 diff --git a/src/charging-station/Helpers.ts b/src/charging-station/Helpers.ts index cc630d33..c3824849 100644 --- a/src/charging-station/Helpers.ts +++ b/src/charging-station/Helpers.ts @@ -78,14 +78,14 @@ export const getChargingStationId = ( index: number, stationTemplate: ChargingStationTemplate | undefined ): string => { - if (stationTemplate === undefined) { + if (stationTemplate == null) { return "Unknown 'chargingStationId'" } // In case of multiple instances: add instance index to charging station id const instanceIndex = env.CF_INSTANCE_INDEX ?? 0 const idSuffix = stationTemplate?.nameSuffix ?? '' const idStr = `000000000${index.toString()}` - return stationTemplate?.fixedName != null + return stationTemplate?.fixedName === true ? stationTemplate.baseName : `${stationTemplate.baseName}-${instanceIndex.toString()}${idStr.substring( idStr.length - 4 @@ -267,13 +267,12 @@ export const checkConfiguration = ( logPrefix: string, configurationFile: string ): void => { - if (isNullOrUndefined(stationConfiguration)) { + if (stationConfiguration == null) { const errorMsg = `Failed to read charging station configuration file ${configurationFile}` logger.error(`${logPrefix} ${errorMsg}`) throw new BaseError(errorMsg) } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - if (isEmptyObject(stationConfiguration!)) { + if (isEmptyObject(stationConfiguration)) { const errorMsg = `Empty charging station configuration from file ${configurationFile}` logger.error(`${logPrefix} ${errorMsg}`) throw new BaseError(errorMsg) @@ -314,7 +313,7 @@ export const checkStationInfoConnectorStatus = ( logPrefix: string, templateFile: string ): void => { - if (!isNullOrUndefined(connectorStatus?.status)) { + if (connectorStatus?.status != null) { logger.warn( `${logPrefix} Charging station information from template ${templateFile} with connector id ${connectorId} status configuration defined, undefine it` ) diff --git a/src/charging-station/SharedLRUCache.ts b/src/charging-station/SharedLRUCache.ts index 6985e707..97f417e7 100644 --- a/src/charging-station/SharedLRUCache.ts +++ b/src/charging-station/SharedLRUCache.ts @@ -11,7 +11,7 @@ import { enum CacheType { chargingStationTemplate = 'chargingStationTemplate', - chargingStationConfiguration = 'chargingStationConfiguration' + chargingStationConfiguration = 'chargingStationConfiguration', } type CacheValueType = ChargingStationTemplate | ChargingStationConfiguration diff --git a/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts b/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts index 87f693f8..d990c48e 100644 --- a/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts +++ b/src/charging-station/broadcast-channel/ChargingStationWorkerBroadcastChannel.ts @@ -180,7 +180,12 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne await this.chargingStation.ocppRequestService.requestHandler< StatusNotificationRequest, StatusNotificationResponse - >(this.chargingStation, RequestCommand.STATUS_NOTIFICATION, requestPayload, requestParams) + >( + this.chargingStation, + RequestCommand.STATUS_NOTIFICATION, + requestPayload, + requestParams + ) ], [ BroadcastChannelProcedureName.HEARTBEAT, @@ -212,7 +217,7 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne // eslint-disable-next-line @typescript-eslint/no-non-null-assertion this.chargingStation.getConnectorStatus(requestPayload!.connectorId!)! .transactionId!, - configuredMeterValueSampleInterval !== undefined + configuredMeterValueSampleInterval != null ? secondsToMilliseconds(convertToInt(configuredMeterValueSampleInterval.value)) : Constants.DEFAULT_METER_VALUES_INTERVAL ) @@ -285,10 +290,11 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne return } let responsePayload: BroadcastChannelResponsePayload | undefined - let commandResponse: CommandResponse | undefined + // eslint-disable-next-line @typescript-eslint/no-invalid-void-type + let commandResponse: CommandResponse | void | undefined try { commandResponse = await this.commandHandler(command, requestPayload) - if (isNullOrUndefined(commandResponse) || isEmptyObject(commandResponse)) { + if (isNullOrUndefined(commandResponse) || isEmptyObject(commandResponse as CommandResponse)) { responsePayload = { hashId: this.chargingStation.stationInfo.hashId, status: ResponseStatus.SUCCESS @@ -297,7 +303,7 @@ export class ChargingStationWorkerBroadcastChannel extends WorkerBroadcastChanne responsePayload = this.commandResponseToResponsePayload( command, requestPayload, - commandResponse + commandResponse as CommandResponse ) } } catch (error) { diff --git a/src/charging-station/broadcast-channel/UIServiceWorkerBroadcastChannel.ts b/src/charging-station/broadcast-channel/UIServiceWorkerBroadcastChannel.ts index 57b4bc78..93586cee 100644 --- a/src/charging-station/broadcast-channel/UIServiceWorkerBroadcastChannel.ts +++ b/src/charging-station/broadcast-channel/UIServiceWorkerBroadcastChannel.ts @@ -73,7 +73,7 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel { hashIdsSucceeded: this.responses .get(uuid) ?.responses.map(({ status, hashId }) => { - if (hashId !== undefined && status === ResponseStatus.SUCCESS) { + if (hashId != null && status === ResponseStatus.SUCCESS) { return hashId } return undefined @@ -83,7 +83,7 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel { hashIdsFailed: this.responses .get(uuid) ?.responses.map(({ status, hashId }) => { - if (hashId !== undefined && status === ResponseStatus.FAILURE) { + if (hashId != null && status === ResponseStatus.FAILURE) { return hashId } return undefined @@ -94,7 +94,7 @@ export class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChannel { responsesFailed: this.responses .get(uuid) ?.responses.map((response) => { - if (response !== undefined && response.status === ResponseStatus.FAILURE) { + if (response != null && response.status === ResponseStatus.FAILURE) { return response } return undefined diff --git a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts index 656d2cb3..94f03ef8 100644 --- a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts @@ -521,7 +521,7 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion for (const k of key!) { const keyFound = getConfigurationKey(chargingStation, k, true) - if (keyFound !== undefined) { + if (keyFound != null) { if (isUndefined(keyFound.visible)) { keyFound.visible = true } diff --git a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts index 37c05637..d7d9ce0a 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts @@ -658,7 +658,7 @@ export class OCPP16ResponseService extends OCPPResponseService { ) chargingStation.startMeterValues( connectorId, - configuredMeterValueSampleInterval !== undefined + configuredMeterValueSampleInterval != null ? secondsToMilliseconds(convertToInt(configuredMeterValueSampleInterval.value)) : Constants.DEFAULT_METER_VALUES_INTERVAL ) diff --git a/src/charging-station/ocpp/OCPPIncomingRequestService.ts b/src/charging-station/ocpp/OCPPIncomingRequestService.ts index ba224189..62e58661 100644 --- a/src/charging-station/ocpp/OCPPIncomingRequestService.ts +++ b/src/charging-station/ocpp/OCPPIncomingRequestService.ts @@ -38,7 +38,7 @@ export abstract class OCPPIncomingRequestService { this.incomingRequestHandler = this.incomingRequestHandler.bind(this) as < ReqType extends JsonType, // eslint-disable-next-line @typescript-eslint/no-unused-vars - ResType extends JsonType + ResType extends JsonType, >( chargingStation: ChargingStation, messageId: string, @@ -46,7 +46,7 @@ export abstract class OCPPIncomingRequestService { commandPayload: ReqType ) => Promise this.validateIncomingRequestPayload = this.validateIncomingRequestPayload.bind(this) as < - T extends JsonType + T extends JsonType, >( chargingStation: ChargingStation, commandName: IncomingRequestCommand, diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 67b93afe..e98ebdfa 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -63,7 +63,7 @@ export abstract class OCPPRequestService { this.requestHandler = this.requestHandler.bind(this) as < // eslint-disable-next-line @typescript-eslint/no-unused-vars ReqType extends JsonType, - ResType extends JsonType + ResType extends JsonType, >( chargingStation: ChargingStation, commandName: RequestCommand, diff --git a/src/charging-station/ocpp/OCPPResponseService.ts b/src/charging-station/ocpp/OCPPResponseService.ts index 738aa5ae..428c63c4 100644 --- a/src/charging-station/ocpp/OCPPResponseService.ts +++ b/src/charging-station/ocpp/OCPPResponseService.ts @@ -49,7 +49,7 @@ export abstract class OCPPResponseService { >() this.responseHandler = this.responseHandler.bind(this) as < ReqType extends JsonType, - ResType extends JsonType + ResType extends JsonType, >( chargingStation: ChargingStation, commandName: RequestCommand, diff --git a/src/charging-station/ocpp/OCPPServiceUtils.ts b/src/charging-station/ocpp/OCPPServiceUtils.ts index b0225063..6b055beb 100644 --- a/src/charging-station/ocpp/OCPPServiceUtils.ts +++ b/src/charging-station/ocpp/OCPPServiceUtils.ts @@ -1349,7 +1349,7 @@ export class OCPPServiceUtils { } public static startHeartbeatInterval (chargingStation: ChargingStation, interval: number): void { - if (chargingStation.heartbeatSetInterval === undefined) { + if (chargingStation.heartbeatSetInterval == null) { chargingStation.startHeartbeat() } else if (chargingStation.getHeartbeatInterval() !== interval) { chargingStation.restartHeartbeat() diff --git a/src/charging-station/ui-server/UIHttpServer.ts b/src/charging-station/ui-server/UIHttpServer.ts index ce1a6ed8..0b6eee9f 100644 --- a/src/charging-station/ui-server/UIHttpServer.ts +++ b/src/charging-station/ui-server/UIHttpServer.ts @@ -24,7 +24,7 @@ enum HttpMethods { GET = 'GET', PUT = 'PUT', POST = 'POST', - PATCH = 'PATCH' + PATCH = 'PATCH', } export class UIHttpServer extends AbstractUIServer { @@ -96,7 +96,7 @@ export class UIHttpServer extends AbstractUIServer { const [protocol, version, procedureName] = req.url?.split('/').slice(1) as [ Protocol, ProtocolVersion, - ProcedureName + ProcedureName, ] const uuid = generateUUID() this.responseHandlers.set(uuid, res) diff --git a/src/charging-station/ui-server/ui-services/AbstractUIService.ts b/src/charging-station/ui-server/ui-services/AbstractUIService.ts index 448734ba..499e9699 100644 --- a/src/charging-station/ui-server/ui-services/AbstractUIService.ts +++ b/src/charging-station/ui-server/ui-services/AbstractUIService.ts @@ -164,7 +164,7 @@ export abstract class AbstractUIService { if (isNotEmptyArray(payload.hashIds)) { payload.hashIds = payload.hashIds ?.map((hashId) => { - if (hashId !== undefined && this.uiServer.chargingStations.has(hashId)) { + if (hashId != null && this.uiServer.chargingStations.has(hashId)) { return hashId } logger.warn( diff --git a/src/types/AutomaticTransactionGenerator.ts b/src/types/AutomaticTransactionGenerator.ts index 9a29fb7b..68fd2fe3 100644 --- a/src/types/AutomaticTransactionGenerator.ts +++ b/src/types/AutomaticTransactionGenerator.ts @@ -1,7 +1,7 @@ export enum IdTagDistribution { RANDOM = 'random', ROUND_ROBIN = 'round-robin', - CONNECTOR_AFFINITY = 'connector-affinity' + CONNECTOR_AFFINITY = 'connector-affinity', } export interface AutomaticTransactionGeneratorConfiguration { diff --git a/src/types/ChargingStationEvents.ts b/src/types/ChargingStationEvents.ts index 5a0fc8fd..f7980b47 100644 --- a/src/types/ChargingStationEvents.ts +++ b/src/types/ChargingStationEvents.ts @@ -4,5 +4,5 @@ export enum ChargingStationEvents { registered = 'registered', accepted = 'accepted', updated = 'updated', - connectorStatusChanged = 'connectorStatusChanged' + connectorStatusChanged = 'connectorStatusChanged', } diff --git a/src/types/ChargingStationTemplate.ts b/src/types/ChargingStationTemplate.ts index cb358844..1b4299b3 100644 --- a/src/types/ChargingStationTemplate.ts +++ b/src/types/ChargingStationTemplate.ts @@ -17,26 +17,26 @@ import type { export enum CurrentType { AC = 'AC', - DC = 'DC' + DC = 'DC', } export enum PowerUnits { WATT = 'W', - KILO_WATT = 'kW' + KILO_WATT = 'kW', } export enum AmpereUnits { MILLI_AMPERE = 'mA', CENTI_AMPERE = 'cA', DECI_AMPERE = 'dA', - AMPERE = 'A' + AMPERE = 'A', } export enum Voltage { VOLTAGE_110 = 110, VOLTAGE_230 = 230, VOLTAGE_400 = 400, - VOLTAGE_800 = 800 + VOLTAGE_800 = 800, } export type WsOptions = ClientOptions & ClientRequestArgs @@ -61,7 +61,7 @@ enum x509CertificateType { CSMSRootCertificate = 'CSMSRootCertificate', ManufacturerRootCertificate = 'ManufacturerRootCertificate', ChargingStationCertificate = 'ChargingStationCertificate', - V2GCertificate = 'V2GCertificate' + V2GCertificate = 'V2GCertificate', } export interface ChargingStationTemplate { diff --git a/src/types/ChargingStationWorker.ts b/src/types/ChargingStationWorker.ts index 5b123079..740d6e50 100644 --- a/src/types/ChargingStationWorker.ts +++ b/src/types/ChargingStationWorker.ts @@ -41,7 +41,7 @@ export interface ChargingStationData extends WorkerData { } enum ChargingStationMessageEvents { - performanceStatistics = 'performanceStatistics' + performanceStatistics = 'performanceStatistics', } export const ChargingStationWorkerMessageEvents = { diff --git a/src/types/ConfigurationData.ts b/src/types/ConfigurationData.ts index fe8b8481..7f5353f4 100644 --- a/src/types/ConfigurationData.ts +++ b/src/types/ConfigurationData.ts @@ -13,13 +13,13 @@ export enum ConfigurationSection { log = 'log', performanceStorage = 'performanceStorage', worker = 'worker', - uiServer = 'uiServer' + uiServer = 'uiServer', } export enum SupervisionUrlDistribution { ROUND_ROBIN = 'round-robin', RANDOM = 'random', - CHARGING_STATION_AFFINITY = 'charging-station-affinity' + CHARGING_STATION_AFFINITY = 'charging-station-affinity', } export interface StationTemplateUrl { @@ -42,7 +42,7 @@ export interface LogConfiguration { export enum ApplicationProtocolVersion { VERSION_11 = 1.1, - VERSION_20 = 2.0 + VERSION_20 = 2.0, } export interface UIServerConfiguration { diff --git a/src/types/FileType.ts b/src/types/FileType.ts index 2b6bc380..3781b7d9 100644 --- a/src/types/FileType.ts +++ b/src/types/FileType.ts @@ -4,5 +4,5 @@ export enum FileType { ChargingStationConfiguration = 'charging station configuration', ChargingStationTemplate = 'charging station template', PerformanceRecords = 'performance records', - JsonSchema = 'json schema' + JsonSchema = 'json schema', } diff --git a/src/types/Storage.ts b/src/types/Storage.ts index 3301f5ca..92aa4cb4 100644 --- a/src/types/Storage.ts +++ b/src/types/Storage.ts @@ -7,12 +7,12 @@ export enum StorageType { MONGO_DB = 'mongodb', MYSQL = 'mysql', MARIA_DB = 'mariadb', - SQLITE = 'sqlite' + SQLITE = 'sqlite', } export enum DBName { MONGO_DB = 'MongoDB', MYSQL = 'MySQL', MARIA_DB = 'MariaDB', - SQLITE = 'SQLite' + SQLITE = 'SQLite', } diff --git a/src/types/UIProtocol.ts b/src/types/UIProtocol.ts index f44475d8..4911f9ad 100644 --- a/src/types/UIProtocol.ts +++ b/src/types/UIProtocol.ts @@ -2,20 +2,20 @@ import type { JsonObject } from './JsonType.js' import type { BroadcastChannelResponsePayload } from './WorkerBroadcastChannel.js' export enum Protocol { - UI = 'ui' + UI = 'ui', } export enum ApplicationProtocol { HTTP = 'http', - WS = 'ws' + WS = 'ws', } export enum AuthenticationType { - BASIC_AUTH = 'basic-auth' + BASIC_AUTH = 'basic-auth', } export enum ProtocolVersion { - '0.0.1' = '0.0.1' + '0.0.1' = '0.0.1', } export type ProtocolRequest = [string, ProcedureName, RequestPayload] @@ -47,7 +47,7 @@ export enum ProcedureName { METER_VALUES = 'meterValues', DATA_TRANSFER = 'dataTransfer', DIAGNOSTICS_STATUS_NOTIFICATION = 'diagnosticsStatusNotification', - FIRMWARE_STATUS_NOTIFICATION = 'firmwareStatusNotification' + FIRMWARE_STATUS_NOTIFICATION = 'firmwareStatusNotification', } export interface RequestPayload extends JsonObject { @@ -57,7 +57,7 @@ export interface RequestPayload extends JsonObject { export enum ResponseStatus { SUCCESS = 'success', - FAILURE = 'failure' + FAILURE = 'failure', } export interface ResponsePayload extends JsonObject { diff --git a/src/types/WebSocket.ts b/src/types/WebSocket.ts index 2f7269aa..c0d0bd9d 100644 --- a/src/types/WebSocket.ts +++ b/src/types/WebSocket.ts @@ -34,7 +34,7 @@ export enum WebSocketCloseEventStatusCode { CLOSE_SERVICE_RESTART = 1012, CLOSE_TRY_AGAIN_LATER = 1013, CLOSE_BAD_GATEWAY = 1014, - CLOSE_TLS_HANDSHAKE = 1015 + CLOSE_TLS_HANDSHAKE = 1015, } export interface WSError extends Error { diff --git a/src/types/WorkerBroadcastChannel.ts b/src/types/WorkerBroadcastChannel.ts index 8d807b9a..ac4ea8e6 100644 --- a/src/types/WorkerBroadcastChannel.ts +++ b/src/types/WorkerBroadcastChannel.ts @@ -3,7 +3,7 @@ import type { RequestPayload, ResponsePayload } from './UIProtocol.js' export type BroadcastChannelRequest = [ string, BroadcastChannelProcedureName, - BroadcastChannelRequestPayload + BroadcastChannelRequestPayload, ] export type BroadcastChannelResponse = [string, BroadcastChannelResponsePayload] @@ -24,7 +24,7 @@ export enum BroadcastChannelProcedureName { METER_VALUES = 'meterValues', DATA_TRANSFER = 'dataTransfer', DIAGNOSTICS_STATUS_NOTIFICATION = 'diagnosticsStatusNotification', - FIRMWARE_STATUS_NOTIFICATION = 'firmwareStatusNotification' + FIRMWARE_STATUS_NOTIFICATION = 'firmwareStatusNotification', } export interface BroadcastChannelRequestPayload extends RequestPayload { diff --git a/src/types/ocpp/1.6/ChargePointErrorCode.ts b/src/types/ocpp/1.6/ChargePointErrorCode.ts index db06d0c9..4255cd05 100644 --- a/src/types/ocpp/1.6/ChargePointErrorCode.ts +++ b/src/types/ocpp/1.6/ChargePointErrorCode.ts @@ -14,5 +14,5 @@ export enum OCPP16ChargePointErrorCode { READER_FAILURE = 'ReaderFailure', RESET_FAILURE = 'ResetFailure', UNDER_VOLTAGE = 'UnderVoltage', - WEAK_SIGNAL = 'WeakSignal' + WEAK_SIGNAL = 'WeakSignal', } diff --git a/src/types/ocpp/1.6/ChargePointStatus.ts b/src/types/ocpp/1.6/ChargePointStatus.ts index ef7467bd..4cef943e 100644 --- a/src/types/ocpp/1.6/ChargePointStatus.ts +++ b/src/types/ocpp/1.6/ChargePointStatus.ts @@ -7,5 +7,5 @@ export enum OCPP16ChargePointStatus { Finishing = 'Finishing', Reserved = 'Reserved', Unavailable = 'Unavailable', - Faulted = 'Faulted' + Faulted = 'Faulted', } diff --git a/src/types/ocpp/1.6/ChargingProfile.ts b/src/types/ocpp/1.6/ChargingProfile.ts index 744696c5..efd8f31a 100644 --- a/src/types/ocpp/1.6/ChargingProfile.ts +++ b/src/types/ocpp/1.6/ChargingProfile.ts @@ -28,22 +28,22 @@ export interface OCPP16ChargingSchedulePeriod extends JsonObject { export enum OCPP16ChargingRateUnitType { WATT = 'W', - AMPERE = 'A' + AMPERE = 'A', } export enum OCPP16ChargingProfileKindType { ABSOLUTE = 'Absolute', RECURRING = 'Recurring', - RELATIVE = 'Relative' + RELATIVE = 'Relative', } export enum OCPP16ChargingProfilePurposeType { CHARGE_POINT_MAX_PROFILE = 'ChargePointMaxProfile', TX_DEFAULT_PROFILE = 'TxDefaultProfile', - TX_PROFILE = 'TxProfile' + TX_PROFILE = 'TxProfile', } export enum OCPP16RecurrencyKindType { DAILY = 'Daily', - WEEKLY = 'Weekly' + WEEKLY = 'Weekly', } diff --git a/src/types/ocpp/1.6/Configuration.ts b/src/types/ocpp/1.6/Configuration.ts index a5888d93..1bd92376 100644 --- a/src/types/ocpp/1.6/Configuration.ts +++ b/src/types/ocpp/1.6/Configuration.ts @@ -4,7 +4,7 @@ export enum OCPP16SupportedFeatureProfiles { LocalAuthListManagement = 'LocalAuthListManagement', Reservation = 'Reservation', SmartCharging = 'SmartCharging', - RemoteTrigger = 'RemoteTrigger' + RemoteTrigger = 'RemoteTrigger', } export enum OCPP16StandardParametersKey { @@ -51,9 +51,9 @@ export enum OCPP16StandardParametersKey { ChargingScheduleAllowedChargingRateUnit = 'ChargingScheduleAllowedChargingRateUnit', ChargingScheduleMaxPeriods = 'ChargingScheduleMaxPeriods', ConnectorSwitch3to1PhaseSupported = 'ConnectorSwitch3to1PhaseSupported', - MaxChargingProfilesInstalled = 'MaxChargingProfilesInstalled' + MaxChargingProfilesInstalled = 'MaxChargingProfilesInstalled', } export enum OCPP16VendorParametersKey { - ConnectionUrl = 'ConnectionUrl' + ConnectionUrl = 'ConnectionUrl', } diff --git a/src/types/ocpp/1.6/DiagnosticsStatus.ts b/src/types/ocpp/1.6/DiagnosticsStatus.ts index c9feccea..c8c2c890 100644 --- a/src/types/ocpp/1.6/DiagnosticsStatus.ts +++ b/src/types/ocpp/1.6/DiagnosticsStatus.ts @@ -2,5 +2,5 @@ export enum OCPP16DiagnosticsStatus { Idle = 'Idle', Uploaded = 'Uploaded', UploadFailed = 'UploadFailed', - Uploading = 'Uploading' + Uploading = 'Uploading', } diff --git a/src/types/ocpp/1.6/MeterValues.ts b/src/types/ocpp/1.6/MeterValues.ts index 92cac7c3..1fd18982 100644 --- a/src/types/ocpp/1.6/MeterValues.ts +++ b/src/types/ocpp/1.6/MeterValues.ts @@ -17,7 +17,7 @@ export enum OCPP16MeterValueUnit { TEMP_CELSIUS = 'Celsius', TEMP_FAHRENHEIT = 'Fahrenheit', TEMP_KELVIN = 'K', - PERCENT = 'Percent' + PERCENT = 'Percent', } export enum OCPP16MeterValueContext { @@ -28,7 +28,7 @@ export enum OCPP16MeterValueContext { SAMPLE_PERIODIC = 'Sample.Periodic', TRANSACTION_BEGIN = 'Transaction.Begin', TRANSACTION_END = 'Transaction.End', - TRIGGER = 'Trigger' + TRIGGER = 'Trigger', } export enum OCPP16MeterValueMeasurand { @@ -53,7 +53,7 @@ export enum OCPP16MeterValueMeasurand { FAN_RPM = 'RPM', STATE_OF_CHARGE = 'SoC', TEMPERATURE = 'Temperature', - VOLTAGE = 'Voltage' + VOLTAGE = 'Voltage', } export enum OCPP16MeterValueLocation { @@ -61,7 +61,7 @@ export enum OCPP16MeterValueLocation { CABLE = 'Cable', EV = 'EV', INLET = 'Inlet', - OUTLET = 'Outlet' + OUTLET = 'Outlet', } export enum OCPP16MeterValuePhase { @@ -74,12 +74,12 @@ export enum OCPP16MeterValuePhase { L3_N = 'L3-N', L1_L2 = 'L1-L2', L2_L3 = 'L2-L3', - L3_L1 = 'L3-L1' + L3_L1 = 'L3-L1', } enum OCPP16MeterValueFormat { RAW = 'Raw', - SIGNED_DATA = 'SignedData' + SIGNED_DATA = 'SignedData', } export interface OCPP16SampledValue extends JsonObject { diff --git a/src/types/ocpp/1.6/Requests.ts b/src/types/ocpp/1.6/Requests.ts index 32d9757f..a3c4911c 100644 --- a/src/types/ocpp/1.6/Requests.ts +++ b/src/types/ocpp/1.6/Requests.ts @@ -20,7 +20,7 @@ export enum OCPP16RequestCommand { METER_VALUES = 'MeterValues', DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification', FIRMWARE_STATUS_NOTIFICATION = 'FirmwareStatusNotification', - DATA_TRANSFER = 'DataTransfer' + DATA_TRANSFER = 'DataTransfer', } export enum OCPP16IncomingRequestCommand { @@ -40,7 +40,7 @@ export enum OCPP16IncomingRequestCommand { DATA_TRANSFER = 'DataTransfer', UPDATE_FIRMWARE = 'UpdateFirmware', RESERVE_NOW = 'ReserveNow', - CANCEL_RESERVATION = 'CancelReservation' + CANCEL_RESERVATION = 'CancelReservation', } export type OCPP16HeartbeatRequest = EmptyObject @@ -96,7 +96,7 @@ export interface GetConfigurationRequest extends JsonObject { enum ResetType { HARD = 'Hard', - SOFT = 'Soft' + SOFT = 'Soft', } export interface ResetRequest extends JsonObject { @@ -116,7 +116,7 @@ export interface SetChargingProfileRequest extends JsonObject { export enum OCPP16AvailabilityType { Inoperative = 'Inoperative', - Operative = 'Operative' + Operative = 'Operative', } export interface OCPP16ChangeAvailabilityRequest extends JsonObject { @@ -145,7 +145,7 @@ export enum OCPP16FirmwareStatus { Idle = 'Idle', InstallationFailed = 'InstallationFailed', Installing = 'Installing', - Installed = 'Installed' + Installed = 'Installed', } export type OCPP16FirmwareStatusNotificationRequest = { @@ -170,7 +170,7 @@ export enum OCPP16MessageTrigger { FirmwareStatusNotification = 'FirmwareStatusNotification', Heartbeat = 'Heartbeat', MeterValues = 'MeterValues', - StatusNotification = 'StatusNotification' + StatusNotification = 'StatusNotification', } export interface OCPP16TriggerMessageRequest extends JsonObject { diff --git a/src/types/ocpp/1.6/Responses.ts b/src/types/ocpp/1.6/Responses.ts index b8c36ed2..f1e8b0e2 100644 --- a/src/types/ocpp/1.6/Responses.ts +++ b/src/types/ocpp/1.6/Responses.ts @@ -11,7 +11,7 @@ export interface OCPP16HeartbeatResponse extends JsonObject { export enum OCPP16UnlockStatus { UNLOCKED = 'Unlocked', UNLOCK_FAILED = 'UnlockFailed', - NOT_SUPPORTED = 'NotSupported' + NOT_SUPPORTED = 'NotSupported', } export interface UnlockConnectorResponse extends JsonObject { @@ -22,7 +22,7 @@ export enum OCPP16ConfigurationStatus { ACCEPTED = 'Accepted', REJECTED = 'Rejected', REBOOT_REQUIRED = 'RebootRequired', - NOT_SUPPORTED = 'NotSupported' + NOT_SUPPORTED = 'NotSupported', } export interface ChangeConfigurationResponse extends JsonObject { @@ -45,7 +45,7 @@ export interface GetConfigurationResponse extends JsonObject { export enum OCPP16ChargingProfileStatus { ACCEPTED = 'Accepted', REJECTED = 'Rejected', - NOT_SUPPORTED = 'NotSupported' + NOT_SUPPORTED = 'NotSupported', } export interface OCPP16GetCompositeScheduleResponse extends JsonObject { @@ -62,7 +62,7 @@ export interface SetChargingProfileResponse extends JsonObject { export enum OCPP16AvailabilityStatus { ACCEPTED = 'Accepted', REJECTED = 'Rejected', - SCHEDULED = 'Scheduled' + SCHEDULED = 'Scheduled', } export interface OCPP16ChangeAvailabilityResponse extends JsonObject { @@ -71,7 +71,7 @@ export interface OCPP16ChangeAvailabilityResponse extends JsonObject { export enum OCPP16ClearChargingProfileStatus { ACCEPTED = 'Accepted', - UNKNOWN = 'Unknown' + UNKNOWN = 'Unknown', } export interface OCPP16ClearChargingProfileResponse extends JsonObject { @@ -91,7 +91,7 @@ export type OCPP16DiagnosticsStatusNotificationResponse = EmptyObject export enum OCPP16TriggerMessageStatus { ACCEPTED = 'Accepted', REJECTED = 'Rejected', - NOT_IMPLEMENTED = 'NotImplemented' + NOT_IMPLEMENTED = 'NotImplemented', } export interface OCPP16TriggerMessageResponse extends JsonObject { @@ -102,7 +102,7 @@ export enum OCPP16DataTransferStatus { ACCEPTED = 'Accepted', REJECTED = 'Rejected', UNKNOWN_MESSAGE_ID = 'UnknownMessageId', - UNKNOWN_VENDOR_ID = 'UnknownVendorId' + UNKNOWN_VENDOR_ID = 'UnknownVendorId', } export interface OCPP16DataTransferResponse extends JsonObject { @@ -116,7 +116,7 @@ export enum OCPP16ReservationStatus { OCCUPIED = 'Occupied', REJECTED = 'Rejected', UNAVAILABLE = 'Unavailable', - NOT_SUPPORTED = 'NotSupported' + NOT_SUPPORTED = 'NotSupported', } export interface OCPP16ReserveNowResponse extends JsonObject { diff --git a/src/types/ocpp/1.6/Transaction.ts b/src/types/ocpp/1.6/Transaction.ts index 2e6c7289..58f7e96c 100644 --- a/src/types/ocpp/1.6/Transaction.ts +++ b/src/types/ocpp/1.6/Transaction.ts @@ -12,7 +12,7 @@ export enum OCPP16StopTransactionReason { REMOTE = 'Remote', SOFT_RESET = 'SoftReset', UNLOCK_COMMAND = 'UnlockCommand', - DE_AUTHORIZED = 'DeAuthorized' + DE_AUTHORIZED = 'DeAuthorized', } export enum OCPP16AuthorizationStatus { @@ -20,7 +20,7 @@ export enum OCPP16AuthorizationStatus { BLOCKED = 'Blocked', EXPIRED = 'Expired', INVALID = 'Invalid', - CONCURRENT_TX = 'ConcurrentTx' + CONCURRENT_TX = 'ConcurrentTx', } interface IdTagInfo extends JsonObject { diff --git a/src/types/ocpp/2.0/Common.ts b/src/types/ocpp/2.0/Common.ts index 9d13b2a8..01fed13b 100644 --- a/src/types/ocpp/2.0/Common.ts +++ b/src/types/ocpp/2.0/Common.ts @@ -9,7 +9,7 @@ export enum DataEnumType { boolean = 'boolean', OptionList = 'OptionList', SequenceList = 'SequenceList', - MemberList = 'MemberList' + MemberList = 'MemberList', } export enum BootReasonEnumType { @@ -21,12 +21,12 @@ export enum BootReasonEnumType { ScheduledReset = 'ScheduledReset', Triggered = 'Triggered', Unknown = 'Unknown', - Watchdog = 'Watchdog' + Watchdog = 'Watchdog', } export enum OperationalStatusEnumType { Operative = 'Operative', - Inoperative = 'Inoperative' + Inoperative = 'Inoperative', } export enum OCPP20ConnectorStatusEnumType { @@ -34,7 +34,7 @@ export enum OCPP20ConnectorStatusEnumType { Occupied = 'Occupied', Reserved = 'Reserved', Unavailable = 'Unavailable', - Faulted = 'Faulted' + Faulted = 'Faulted', } export type GenericStatusEnumType = GenericStatus @@ -42,7 +42,7 @@ export type GenericStatusEnumType = GenericStatus export enum HashAlgorithmEnumType { SHA256 = 'SHA256', SHA384 = 'SHA384', - SHA512 = 'SHA512' + SHA512 = 'SHA512', } export enum GetCertificateIdUseEnumType { @@ -50,46 +50,46 @@ export enum GetCertificateIdUseEnumType { MORootCertificate = 'MORootCertificate', CSMSRootCertificate = 'CSMSRootCertificate', V2GCertificateChain = 'V2GCertificateChain', - ManufacturerRootCertificate = 'ManufacturerRootCertificate' + ManufacturerRootCertificate = 'ManufacturerRootCertificate', } export enum GetCertificateStatusEnumType { Accepted = 'Accepted', - Failed = 'Failed' + Failed = 'Failed', } export enum GetInstalledCertificateStatusEnumType { Accepted = 'Accepted', - NotFound = 'NotFound' + NotFound = 'NotFound', } export enum InstallCertificateStatusEnumType { Accepted = 'Accepted', Rejected = 'Rejected', - Failed = 'Failed' + Failed = 'Failed', } export enum InstallCertificateUseEnumType { V2GRootCertificate = 'V2GRootCertificate', MORootCertificate = 'MORootCertificate', CSMSRootCertificate = 'CSMSRootCertificate', - ManufacturerRootCertificate = 'ManufacturerRootCertificate' + ManufacturerRootCertificate = 'ManufacturerRootCertificate', } export enum DeleteCertificateStatusEnumType { Accepted = 'Accepted', Failed = 'Failed', - NotFound = 'NotFound' + NotFound = 'NotFound', } export enum CertificateActionEnumType { Install = 'Install', - Update = 'Update' + Update = 'Update', } export enum CertificateSigningUseEnumType { ChargingStationCertificate = 'ChargingStationCertificate', - V2GCertificate = 'V2GCertificate' + V2GCertificate = 'V2GCertificate', } export type CertificateSignedStatusEnumType = GenericStatusEnumType diff --git a/src/types/ocpp/2.0/Requests.ts b/src/types/ocpp/2.0/Requests.ts index ef7a5161..0404936e 100644 --- a/src/types/ocpp/2.0/Requests.ts +++ b/src/types/ocpp/2.0/Requests.ts @@ -10,13 +10,13 @@ import type { JsonObject } from '../../JsonType.js' export enum OCPP20RequestCommand { BOOT_NOTIFICATION = 'BootNotification', HEARTBEAT = 'Heartbeat', - STATUS_NOTIFICATION = 'StatusNotification' + STATUS_NOTIFICATION = 'StatusNotification', } export enum OCPP20IncomingRequestCommand { CLEAR_CACHE = 'ClearCache', REQUEST_START_TRANSACTION = 'RequestStartTransaction', - REQUEST_STOP_TRANSACTION = 'RequestStopTransaction' + REQUEST_STOP_TRANSACTION = 'RequestStopTransaction', } type ModemType = { diff --git a/src/types/ocpp/2.0/Variables.ts b/src/types/ocpp/2.0/Variables.ts index b5cd53e5..2aa2ed33 100644 --- a/src/types/ocpp/2.0/Variables.ts +++ b/src/types/ocpp/2.0/Variables.ts @@ -19,7 +19,7 @@ enum OCPP20ComponentName { SecurityCtrlr = 'SecurityCtrlr', SmartChargingCtrlr = 'SmartChargingCtrlr', TariffCostCtrlr = 'TariffCostCtrlr', - TxCtrlr = 'TxCtrlr' + TxCtrlr = 'TxCtrlr', } export enum OCPP20RequiredVariableName { @@ -50,23 +50,23 @@ export enum OCPP20RequiredVariableName { TxEndedMeasurands = 'TxEndedMeasurands', TxStartedMeasurands = 'TxStartedMeasurands', TxUpdatedMeasurands = 'TxUpdatedMeasurands', - TxUpdatedInterval = 'TxUpdatedInterval' + TxUpdatedInterval = 'TxUpdatedInterval', } export enum OCPP20OptionalVariableName { HeartbeatInterval = 'HeartbeatInterval', - WebSocketPingInterval = 'WebSocketPingInterval' + WebSocketPingInterval = 'WebSocketPingInterval', } export enum OCPP20VendorVariableName { - ConnectionUrl = 'ConnectionUrl' + ConnectionUrl = 'ConnectionUrl', } enum AttributeEnumType { Actual = 'Actual', Target = 'Target', MinSet = 'MinSet', - MaxSet = 'MaxSet' + MaxSet = 'MaxSet', } type ComponentType = { @@ -99,7 +99,7 @@ enum SetVariableStatusEnumType { UnknownComponent = 'UnknownComponent', UnknownVariable = 'UnknownVariable', NotSupportedAttributeType = 'NotSupportedAttributeType', - RebootRequired = 'RebootRequired' + RebootRequired = 'RebootRequired', } export type OCPP20SetVariableResultType = { diff --git a/src/types/ocpp/Common.ts b/src/types/ocpp/Common.ts index 55b92f10..e8923973 100644 --- a/src/types/ocpp/Common.ts +++ b/src/types/ocpp/Common.ts @@ -2,7 +2,7 @@ import type { JsonObject } from '../JsonType.js' export enum GenericStatus { Accepted = 'Accepted', - Rejected = 'Rejected' + Rejected = 'Rejected', } export interface GenericResponse extends JsonObject { @@ -12,5 +12,5 @@ export interface GenericResponse extends JsonObject { export enum RegistrationStatusEnumType { ACCEPTED = 'Accepted', PENDING = 'Pending', - REJECTED = 'Rejected' + REJECTED = 'Rejected', } diff --git a/src/types/ocpp/Configuration.ts b/src/types/ocpp/Configuration.ts index ac8a0945..75062774 100644 --- a/src/types/ocpp/Configuration.ts +++ b/src/types/ocpp/Configuration.ts @@ -39,7 +39,7 @@ export enum ConnectorPhaseRotation { SRT = 'SRT', STR = 'STR', TRS = 'TRS', - TSR = 'TSR' + TSR = 'TSR', } export type ConfigurationKeyType = string | StandardParametersKey | VendorParametersKey diff --git a/src/types/ocpp/ErrorType.ts b/src/types/ocpp/ErrorType.ts index d6d8357f..e8762380 100644 --- a/src/types/ocpp/ErrorType.ts +++ b/src/types/ocpp/ErrorType.ts @@ -19,5 +19,5 @@ export enum ErrorType { // Payload for Action is syntactically correct but at least one of the fields violates data type constraints (e.g. "somestring" = 12) TYPE_CONSTRAINT_VIOLATION = 'TypeConstraintViolation', // Any other error not covered by the previous ones - GENERIC_ERROR = 'GenericError' + GENERIC_ERROR = 'GenericError', } diff --git a/src/types/ocpp/MessageType.ts b/src/types/ocpp/MessageType.ts index 972ed474..1346ee82 100644 --- a/src/types/ocpp/MessageType.ts +++ b/src/types/ocpp/MessageType.ts @@ -1,5 +1,5 @@ export enum MessageType { CALL_MESSAGE = 2, // Caller to Callee CALL_RESULT_MESSAGE = 3, // Callee to Caller - CALL_ERROR_MESSAGE = 4 // Callee to Caller + CALL_ERROR_MESSAGE = 4, // Callee to Caller } diff --git a/src/types/ocpp/OCPPProtocol.ts b/src/types/ocpp/OCPPProtocol.ts index 3342d81d..1df59397 100644 --- a/src/types/ocpp/OCPPProtocol.ts +++ b/src/types/ocpp/OCPPProtocol.ts @@ -1,3 +1,3 @@ export enum OCPPProtocol { - JSON = 'json' + JSON = 'json', } diff --git a/src/types/ocpp/OCPPVersion.ts b/src/types/ocpp/OCPPVersion.ts index 37690b5e..a19fc280 100644 --- a/src/types/ocpp/OCPPVersion.ts +++ b/src/types/ocpp/OCPPVersion.ts @@ -1,5 +1,5 @@ export enum OCPPVersion { VERSION_16 = '1.6', VERSION_20 = '2.0', - VERSION_201 = '2.0.1' + VERSION_201 = '2.0.1', } diff --git a/src/types/ocpp/Requests.ts b/src/types/ocpp/Requests.ts index c718f1e0..cc9a489e 100644 --- a/src/types/ocpp/Requests.ts +++ b/src/types/ocpp/Requests.ts @@ -64,7 +64,7 @@ export type CachedRequest = [ ResponseCallback, ErrorCallback, RequestCommand | IncomingRequestCommand, - JsonType + JsonType, ] export const MessageTrigger = { diff --git a/src/types/ocpp/Reservation.ts b/src/types/ocpp/Reservation.ts index 5f15838a..69050ed9 100644 --- a/src/types/ocpp/Reservation.ts +++ b/src/types/ocpp/Reservation.ts @@ -9,5 +9,5 @@ export enum ReservationTerminationReason { TRANSACTION_STARTED = 'TransactionStarted', CONNECTOR_STATE_CHANGED = 'ConnectorStateChanged', RESERVATION_CANCELED = 'ReservationCanceled', - REPLACE_EXISTING = 'ReplaceExisting' + REPLACE_EXISTING = 'ReplaceExisting', } diff --git a/src/utils/AsyncLock.ts b/src/utils/AsyncLock.ts index c6b35b84..b58e3a77 100644 --- a/src/utils/AsyncLock.ts +++ b/src/utils/AsyncLock.ts @@ -6,7 +6,7 @@ import { Constants } from './Constants.js' export enum AsyncLockType { configuration = 'configuration', - performance = 'performance' + performance = 'performance', } type ResolveType = (value: void | PromiseLike) => void diff --git a/src/utils/ChargingStationConfigurationUtils.ts b/src/utils/ChargingStationConfigurationUtils.ts index b25aba8c..1869fdbf 100644 --- a/src/utils/ChargingStationConfigurationUtils.ts +++ b/src/utils/ChargingStationConfigurationUtils.ts @@ -29,7 +29,7 @@ export const buildConnectorsStatus = (chargingStation: ChargingStation): Connect export const enum OutputFormat { configuration = 'configuration', - worker = 'worker' + worker = 'worker', } export const buildEvsesStatus = ( diff --git a/src/utils/CircularArray.ts b/src/utils/CircularArray.ts index 3a1a89c9..ee72c34e 100644 --- a/src/utils/CircularArray.ts +++ b/src/utils/CircularArray.ts @@ -47,7 +47,7 @@ export class CircularArray extends Array { public splice (start: number, deleteCount?: number, ...items: T[]): CircularArray { let itemsRemoved: T[] = [] - if (arguments.length >= 3 && deleteCount !== undefined) { + if (arguments.length >= 3 && deleteCount != null) { itemsRemoved = super.splice(start, deleteCount, ...items) if (this.length > this.size) { const itemsOverflowing = super.splice(0, this.length - this.size) diff --git a/src/utils/ConfigurationUtils.ts b/src/utils/ConfigurationUtils.ts index 925e7c13..fd976859 100644 --- a/src/utils/ConfigurationUtils.ts +++ b/src/utils/ConfigurationUtils.ts @@ -71,7 +71,7 @@ export const checkWorkerElementsPerWorker = ( elementsPerWorker: ElementsPerWorkerType | undefined ): void => { if ( - elementsPerWorker !== undefined && + elementsPerWorker != null && elementsPerWorker !== 'auto' && elementsPerWorker !== 'all' && !Number.isSafeInteger(elementsPerWorker) diff --git a/src/worker/WorkerTypes.ts b/src/worker/WorkerTypes.ts index faf327db..205cec42 100644 --- a/src/worker/WorkerTypes.ts +++ b/src/worker/WorkerTypes.ts @@ -6,7 +6,7 @@ export enum WorkerProcessType { workerSet = 'workerSet', /** @experimental */ dynamicPool = 'dynamicPool', - fixedPool = 'fixedPool' + fixedPool = 'fixedPool', } export interface SetInfo { @@ -23,7 +23,7 @@ export enum WorkerSetEvents { stopped = 'stopped', error = 'error', elementStarted = 'elementStarted', - elementError = 'elementError' + elementError = 'elementError', } export const WorkerEvents = { @@ -57,5 +57,5 @@ export interface WorkerMessage { export enum WorkerMessageEvents { startWorkerElement = 'startWorkerElement', startWorkerElementError = 'startWorkerElementError', - startedWorkerElement = 'startedWorkerElement' + startedWorkerElement = 'startedWorkerElement', } diff --git a/ui/web/.eslintrc.cjs b/ui/web/.eslintrc.cjs index 3855772d..875ab418 100644 --- a/ui/web/.eslintrc.cjs +++ b/ui/web/.eslintrc.cjs @@ -5,7 +5,7 @@ module.exports = defineConfig({ root: true, env: { - node: true + node: true, }, plugins: ['import'], @@ -15,19 +15,19 @@ module.exports = defineConfig({ 'plugin:import/recommended', 'plugin:vue/vue3-recommended', '@vue/eslint-config-prettier', - '@vue/eslint-config-typescript/recommended' + '@vue/eslint-config-typescript/recommended', ], settings: { 'import/resolver': { typescript: { - project: './tsconfig.json' - } - } + project: './tsconfig.json', + }, + }, }, parserOptions: { - ecmaVersion: 'latest' + ecmaVersion: 'latest', }, rules: { @@ -38,9 +38,9 @@ module.exports = defineConfig({ 'sort-imports': [ 'error', { - ignoreDeclarationSort: true - } + ignoreDeclarationSort: true, + }, ], - 'import/order': 'error' - } + 'import/order': 'error', + }, }) diff --git a/ui/web/.lintstagedrc.js b/ui/web/.lintstagedrc.js index a8ba217a..59a73cec 100644 --- a/ui/web/.lintstagedrc.js +++ b/ui/web/.lintstagedrc.js @@ -1,5 +1,5 @@ export default { '*.{.css,json,md,yml,yaml,html,js,jsx,cjs,mjs,ts,tsx,cts,mts}': 'prettier --cache --write', '*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}': - 'eslint . --cache --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore' + 'eslint . --cache --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore', } diff --git a/ui/web/.prettierrc.json b/ui/web/.prettierrc.json index 6632aaeb..baeeb0d4 100644 --- a/ui/web/.prettierrc.json +++ b/ui/web/.prettierrc.json @@ -3,5 +3,5 @@ "printWidth": 100, "semi": false, "singleQuote": true, - "trailingComma": "none" + "trailingComma": "es5" } diff --git a/ui/web/package.json b/ui/web/package.json index 784bf990..c30f5978 100644 --- a/ui/web/package.json +++ b/ui/web/package.json @@ -34,7 +34,7 @@ "dependencies": { "finalhandler": "^1.2.0", "serve-static": "^1.15.0", - "vue": "^3.3.13", + "vue": "^3.4.0", "vue-router": "^4.2.5" }, "devDependencies": { @@ -43,10 +43,10 @@ "@types/node": "^20.10.5", "@typescript-eslint/eslint-plugin": "^6.16.0", "@typescript-eslint/parser": "^6.16.0", - "@vitejs/plugin-vue": "^5.0.0", + "@vitejs/plugin-vue": "^5.0.1", "@vitejs/plugin-vue-jsx": "^3.1.0", "@vitest/coverage-v8": "^1.1.0", - "@vue/eslint-config-prettier": "^8.0.0", + "@vue/eslint-config-prettier": "^9.0.0", "@vue/eslint-config-typescript": "^12.0.0", "@vue/test-utils": "^2.4.3", "@vue/tsconfig": "^0.5.1", diff --git a/ui/web/pnpm-lock.yaml b/ui/web/pnpm-lock.yaml index 227c01be..5e1b67df 100644 --- a/ui/web/pnpm-lock.yaml +++ b/ui/web/pnpm-lock.yaml @@ -15,11 +15,11 @@ dependencies: specifier: ^1.15.0 version: 1.15.0 vue: - specifier: ^3.3.13 - version: 3.3.13(typescript@5.3.3) + specifier: ^3.4.0 + version: 3.4.0(typescript@5.3.3) vue-router: specifier: ^4.2.5 - version: 4.2.5(vue@3.3.13) + version: 4.2.5(vue@3.4.0) devDependencies: '@tsconfig/node20': @@ -38,23 +38,23 @@ devDependencies: specifier: ^6.16.0 version: 6.16.0(eslint@8.56.0)(typescript@5.3.3) '@vitejs/plugin-vue': - specifier: ^5.0.0 - version: 5.0.0(vite@5.0.10)(vue@3.3.13) + specifier: ^5.0.1 + version: 5.0.1(vite@5.0.10)(vue@3.4.0) '@vitejs/plugin-vue-jsx': specifier: ^3.1.0 - version: 3.1.0(vite@5.0.10)(vue@3.3.13) + version: 3.1.0(vite@5.0.10)(vue@3.4.0) '@vitest/coverage-v8': specifier: ^1.1.0 version: 1.1.0(vitest@1.1.0) '@vue/eslint-config-prettier': - specifier: ^8.0.0 - version: 8.0.0(eslint@8.56.0)(prettier@3.1.1) + specifier: ^9.0.0 + version: 9.0.0(eslint@8.56.0)(prettier@3.1.1) '@vue/eslint-config-typescript': specifier: ^12.0.0 version: 12.0.0(eslint-plugin-vue@9.19.2)(eslint@8.56.0)(typescript@5.3.3) '@vue/test-utils': specifier: ^2.4.3 - version: 2.4.3(vue@3.3.13) + version: 2.4.3(vue@3.4.0) '@vue/tsconfig': specifier: ^0.5.1 version: 0.5.1 @@ -1033,7 +1033,7 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vitejs/plugin-vue-jsx@3.1.0(vite@5.0.10)(vue@3.3.13): + /@vitejs/plugin-vue-jsx@3.1.0(vite@5.0.10)(vue@3.4.0): resolution: {integrity: sha512-w9M6F3LSEU5kszVb9An2/MmXNxocAnUb3WhRr8bHlimhDrXNt6n6D2nJQR3UXpGlZHh/EsgouOHCsM8V3Ln+WA==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -1044,20 +1044,20 @@ packages: '@babel/plugin-transform-typescript': 7.23.6(@babel/core@7.23.6) '@vue/babel-plugin-jsx': 1.1.5(@babel/core@7.23.6) vite: 5.0.10(@types/node@20.10.5) - vue: 3.3.13(typescript@5.3.3) + vue: 3.4.0(typescript@5.3.3) transitivePeerDependencies: - supports-color dev: true - /@vitejs/plugin-vue@5.0.0(vite@5.0.10)(vue@3.3.13): - resolution: {integrity: sha512-7x5e8X4J1Wi4NxudGjJBd2OFerAi/0nzF80ojCzvfj347WVr0YSn82C8BSsgwSHzlk9Kw5xnZfj0/7RLnNwP5w==} + /@vitejs/plugin-vue@5.0.1(vite@5.0.10)(vue@3.4.0): + resolution: {integrity: sha512-lwvZX5tDhJpRJEKsjoUSWgaD26Lk9X4aDYGAPpr/Q6cLTT3PC8LPu2dsnYEweAZiNgHsbyKL2Svc/CDrFOsbtw==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: vite: ^5.0.0 vue: ^3.2.25 dependencies: vite: 5.0.10(@types/node@20.10.5) - vue: 3.3.13(typescript@5.3.3) + vue: 3.4.0(typescript@5.3.3) dev: true /@vitest/coverage-v8@1.1.0(vitest@1.1.0): @@ -1144,53 +1144,53 @@ packages: - supports-color dev: true - /@vue/compiler-core@3.3.13: - resolution: {integrity: sha512-bwi9HShGu7uaZLOErZgsH2+ojsEdsjerbf2cMXPwmvcgZfVPZ2BVZzCVnwZBxTAYd6Mzbmf6izcUNDkWnBBQ6A==} + /@vue/compiler-core@3.4.0: + resolution: {integrity: sha512-cw4S15PkNGTKkP9OFFl4wnQoJJk+HqaYBafgrpDnSukiQGpcYJeRpzmqnCVCIkl6V6Eqsv58E0OAdl6b592vuA==} dependencies: '@babel/parser': 7.23.6 - '@vue/shared': 3.3.13 + '@vue/shared': 3.4.0 + entities: 4.5.0 estree-walker: 2.0.2 source-map-js: 1.0.2 - /@vue/compiler-dom@3.3.13: - resolution: {integrity: sha512-EYRDpbLadGtNL0Gph+HoKiYqXLqZ0xSSpR5Dvnu/Ep7ggaCbjRDIus1MMxTS2Qm0koXED4xSlvTZaTnI8cYAsw==} + /@vue/compiler-dom@3.4.0: + resolution: {integrity: sha512-E957uOhpoE48YjZGWeAoLmNYd3UeU4oIP8kJi8Rcsb9l2tV8Z48Jn07Zgq1aW0v3vuhlmydEKkKKbhLpADHXEA==} dependencies: - '@vue/compiler-core': 3.3.13 - '@vue/shared': 3.3.13 + '@vue/compiler-core': 3.4.0 + '@vue/shared': 3.4.0 - /@vue/compiler-sfc@3.3.13: - resolution: {integrity: sha512-DQVmHEy/EKIgggvnGRLx21hSqnr1smUS9Aq8tfxiiot8UR0/pXKHN9k78/qQ7etyQTFj5em5nruODON7dBeumw==} + /@vue/compiler-sfc@3.4.0: + resolution: {integrity: sha512-PWE0mE2yW7bJS7PmaCrVDEG6KPaDJo0pb4AKnCxJ5lRRDO4IwL/fswBGhCpov+v/c+N/e+hQHpXNwvqU9BtUXg==} dependencies: '@babel/parser': 7.23.6 - '@vue/compiler-core': 3.3.13 - '@vue/compiler-dom': 3.3.13 - '@vue/compiler-ssr': 3.3.13 - '@vue/reactivity-transform': 3.3.13 - '@vue/shared': 3.3.13 + '@vue/compiler-core': 3.4.0 + '@vue/compiler-dom': 3.4.0 + '@vue/compiler-ssr': 3.4.0 + '@vue/shared': 3.4.0 estree-walker: 2.0.2 magic-string: 0.30.5 postcss: 8.4.32 source-map-js: 1.0.2 - /@vue/compiler-ssr@3.3.13: - resolution: {integrity: sha512-d/P3bCeUGmkJNS1QUZSAvoCIW4fkOKK3l2deE7zrp0ypJEy+En2AcypIkqvcFQOcw3F0zt2VfMvNsA9JmExTaw==} + /@vue/compiler-ssr@3.4.0: + resolution: {integrity: sha512-+oXKy105g9DIYQKDi3Gwung0xqQX5gJHr0GR+Vf7yK/WkNDM6q61ummcKmKAB85EIst8y3vj2PA9z9YU5Oc4DQ==} dependencies: - '@vue/compiler-dom': 3.3.13 - '@vue/shared': 3.3.13 + '@vue/compiler-dom': 3.4.0 + '@vue/shared': 3.4.0 /@vue/devtools-api@6.5.1: resolution: {integrity: sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==} dev: false - /@vue/eslint-config-prettier@8.0.0(eslint@8.56.0)(prettier@3.1.1): - resolution: {integrity: sha512-55dPqtC4PM/yBjhAr+yEw6+7KzzdkBuLmnhBrDfp4I48+wy+Giqqj9yUr5T2uD/BkBROjjmqnLZmXRdOx/VtQg==} + /@vue/eslint-config-prettier@9.0.0(eslint@8.56.0)(prettier@3.1.1): + resolution: {integrity: sha512-z1ZIAAUS9pKzo/ANEfd2sO+v2IUalz7cM/cTLOZ7vRFOPk5/xuRKQteOu1DErFLAh/lYGXMVZ0IfYKlyInuDVg==} peerDependencies: eslint: '>= 8.0.0' prettier: '>= 3.0.0' dependencies: eslint: 8.56.0 - eslint-config-prettier: 8.10.0(eslint@8.56.0) - eslint-plugin-prettier: 5.1.2(eslint-config-prettier@8.10.0)(eslint@8.56.0)(prettier@3.1.1) + eslint-config-prettier: 9.1.0(eslint@8.56.0) + eslint-plugin-prettier: 5.1.2(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.1.1) prettier: 3.1.1 transitivePeerDependencies: - '@types/eslint' @@ -1217,46 +1217,37 @@ packages: - supports-color dev: true - /@vue/reactivity-transform@3.3.13: - resolution: {integrity: sha512-oWnydGH0bBauhXvh5KXUy61xr9gKaMbtsMHk40IK9M4gMuKPJ342tKFarY0eQ6jef8906m35q37wwA8DMZOm5Q==} + /@vue/reactivity@3.4.0: + resolution: {integrity: sha512-X6BvQjNcgKKHWPQzlRJjZvIu72Kkn8xJSv6VNptqWh8dToMknD0Hch1l4N7llKgVt6Diq4lMeUnErbZFvuGlAA==} dependencies: - '@babel/parser': 7.23.6 - '@vue/compiler-core': 3.3.13 - '@vue/shared': 3.3.13 - estree-walker: 2.0.2 - magic-string: 0.30.5 + '@vue/shared': 3.4.0 - /@vue/reactivity@3.3.13: - resolution: {integrity: sha512-fjzCxceMahHhi4AxUBzQqqVhuA21RJ0COaWTbIBl1PruGW1CeY97louZzLi4smpYx+CHfFPPU/CS8NybbGvPKQ==} + /@vue/runtime-core@3.4.0: + resolution: {integrity: sha512-NYrj/JgMMqnSWcIud8lLzDQrBLu+EVEeQ56QE9DYJeKG2eFrnQy8o/h57R9nCprafHs0uImKL3xsdXjHseYVxw==} dependencies: - '@vue/shared': 3.3.13 + '@vue/reactivity': 3.4.0 + '@vue/shared': 3.4.0 - /@vue/runtime-core@3.3.13: - resolution: {integrity: sha512-1TzA5TvGuh2zUwMJgdfvrBABWZ7y8kBwBhm7BXk8rvdx2SsgcGfz2ruv2GzuGZNvL1aKnK8CQMV/jFOrxNQUMA==} + /@vue/runtime-dom@3.4.0: + resolution: {integrity: sha512-1ZoHEsA5l77qbx2F+SWo/hQdBksPuOmww1t/jznidDG+xMB/iidafEFvo2ZTtZii0JfTIrlDhjshfYUvQC17wQ==} dependencies: - '@vue/reactivity': 3.3.13 - '@vue/shared': 3.3.13 - - /@vue/runtime-dom@3.3.13: - resolution: {integrity: sha512-JJkpE8R/hJKXqVTgUoODwS5wqKtOsmJPEqmp90PDVGygtJ4C0PtOkcEYXwhiVEmef6xeXcIlrT3Yo5aQ4qkHhQ==} - dependencies: - '@vue/runtime-core': 3.3.13 - '@vue/shared': 3.3.13 + '@vue/runtime-core': 3.4.0 + '@vue/shared': 3.4.0 csstype: 3.1.3 - /@vue/server-renderer@3.3.13(vue@3.3.13): - resolution: {integrity: sha512-vSnN+nuf6iSqTL3Qgx/9A+BT+0Zf/VJOgF5uMZrKjYPs38GMYyAU1coDyBNHauehXDaP+zl73VhwWv0vBRBHcg==} + /@vue/server-renderer@3.4.0(vue@3.4.0): + resolution: {integrity: sha512-GuOVCyLDlWPu8nKo5AUxb8B+iB/Ik4I1WwqAlBqf5+y48z6D6rvKshp7KR3cJea+pte1tdTsb0+Ja82KizMZOw==} peerDependencies: - vue: 3.3.13 + vue: 3.4.0 dependencies: - '@vue/compiler-ssr': 3.3.13 - '@vue/shared': 3.3.13 - vue: 3.3.13(typescript@5.3.3) + '@vue/compiler-ssr': 3.4.0 + '@vue/shared': 3.4.0 + vue: 3.4.0(typescript@5.3.3) - /@vue/shared@3.3.13: - resolution: {integrity: sha512-/zYUwiHD8j7gKx2argXEMCUXVST6q/21DFU0sTfNX0URJroCe3b1UF6vLJ3lQDfLNIiiRl2ONp7Nh5UVWS6QnA==} + /@vue/shared@3.4.0: + resolution: {integrity: sha512-Nhh3ed3G1R6HDAWiG6YYFt0Zmq/To6u5vjzwa9TIquGheCXPY6nEdIAO8ZdlwXsWqC2yNLj700FOvShpYt5CEA==} - /@vue/test-utils@2.4.3(vue@3.3.13): + /@vue/test-utils@2.4.3(vue@3.4.0): resolution: {integrity: sha512-F4K7mF+ad++VlTrxMJVRnenKSJmO6fkQt2wpRDiKDesQMkfpniGWsqEi/JevxGBo2qEkwwjvTUAoiGJLNx++CA==} peerDependencies: '@vue/server-renderer': ^3.0.1 @@ -1266,7 +1257,7 @@ packages: optional: true dependencies: js-beautify: 1.14.11 - vue: 3.3.13(typescript@5.3.3) + vue: 3.4.0(typescript@5.3.3) vue-component-type-helpers: 1.8.27 dev: true @@ -1279,12 +1270,12 @@ packages: engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dev: true - /acorn-jsx@5.3.2(acorn@8.11.2): + /acorn-jsx@5.3.2(acorn@8.11.3): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.11.2 + acorn: 8.11.3 dev: true /acorn-walk@8.3.1: @@ -1292,8 +1283,8 @@ packages: engines: {node: '>=0.4.0'} dev: true - /acorn@8.11.2: - resolution: {integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==} + /acorn@8.11.3: + resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} engines: {node: '>=0.4.0'} hasBin: true dev: true @@ -1780,7 +1771,6 @@ packages: /entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} - dev: true /es-abstract@1.22.3: resolution: {integrity: sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==} @@ -1901,8 +1891,8 @@ packages: engines: {node: '>=10'} dev: true - /eslint-config-prettier@8.10.0(eslint@8.56.0): - resolution: {integrity: sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==} + /eslint-config-prettier@9.1.0(eslint@8.56.0): + resolution: {integrity: sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==} hasBin: true peerDependencies: eslint: '>=7.0.0' @@ -2013,7 +2003,7 @@ packages: - supports-color dev: true - /eslint-plugin-prettier@5.1.2(eslint-config-prettier@8.10.0)(eslint@8.56.0)(prettier@3.1.1): + /eslint-plugin-prettier@5.1.2(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.1.1): resolution: {integrity: sha512-dhlpWc9vOwohcWmClFcA+HjlvUpuyynYs0Rf+L/P6/0iQE6vlHW9l5bkfzN62/Stm9fbq8ku46qzde76T1xlSg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -2028,7 +2018,7 @@ packages: optional: true dependencies: eslint: 8.56.0 - eslint-config-prettier: 8.10.0(eslint@8.56.0) + eslint-config-prettier: 9.1.0(eslint@8.56.0) prettier: 3.1.1 prettier-linter-helpers: 1.0.0 synckit: 0.8.8 @@ -2044,7 +2034,7 @@ packages: eslint: 8.56.0 natural-compare: 1.4.0 nth-check: 2.1.1 - postcss-selector-parser: 6.0.14 + postcss-selector-parser: 6.0.15 semver: 7.5.4 vue-eslint-parser: 9.3.2(eslint@8.56.0) xml-name-validator: 4.0.0 @@ -2116,8 +2106,8 @@ packages: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.11.2 - acorn-jsx: 5.3.2(acorn@8.11.2) + acorn: 8.11.3 + acorn-jsx: 5.3.2(acorn@8.11.3) eslint-visitor-keys: 3.4.3 dev: true @@ -2998,7 +2988,7 @@ packages: /mlly@1.4.2: resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==} dependencies: - acorn: 8.11.2 + acorn: 8.11.3 pathe: 1.1.1 pkg-types: 1.0.3 ufo: 1.3.2 @@ -3231,8 +3221,8 @@ packages: pathe: 1.1.1 dev: true - /postcss-selector-parser@6.0.14: - resolution: {integrity: sha512-65xXYsT40i9GyWzlHQ5ShZoK7JZdySeOozi/tz2EezDo6c04q6+ckYMeoY7idaie1qp2dT5KoYQ2yky6JuoHnA==} + /postcss-selector-parser@6.0.15: + resolution: {integrity: sha512-rEYkQOMUCEMhsKbK66tbEU9QVIxbhN18YiniAwA7XQYTVBqrBy+P2p5JcdqsHgKM2zWylp8d7J6eszocfds5Sw==} engines: {node: '>=4'} dependencies: cssesc: 3.0.0 @@ -3610,7 +3600,7 @@ packages: /strip-literal@1.3.0: resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==} dependencies: - acorn: 8.11.2 + acorn: 8.11.3 dev: true /supports-color@5.5.0: @@ -3996,28 +3986,28 @@ packages: - supports-color dev: true - /vue-router@4.2.5(vue@3.3.13): + /vue-router@4.2.5(vue@3.4.0): resolution: {integrity: sha512-DIUpKcyg4+PTQKfFPX88UWhlagBEBEfJ5A8XDXRJLUnZOvcpMF8o/dnL90vpVkGaPbjvXazV/rC1qBKrZlFugw==} peerDependencies: vue: ^3.2.0 dependencies: '@vue/devtools-api': 6.5.1 - vue: 3.3.13(typescript@5.3.3) + vue: 3.4.0(typescript@5.3.3) dev: false - /vue@3.3.13(typescript@5.3.3): - resolution: {integrity: sha512-LDnUpQvDgsfc0u/YgtAgTMXJlJQqjkxW1PVcOnJA5cshPleULDjHi7U45pl2VJYazSSvLH8UKcid/kzH8I0a0Q==} + /vue@3.4.0(typescript@5.3.3): + resolution: {integrity: sha512-iTE9Ve/7DO/H39+gXHrNkRdnh1jDwPe/fap4brbPKkp1APMkS03OiZ+UY0dwpqtRX0iPWQTkh8Fu3hKgLtaxfA==} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@vue/compiler-dom': 3.3.13 - '@vue/compiler-sfc': 3.3.13 - '@vue/runtime-dom': 3.3.13 - '@vue/server-renderer': 3.3.13(vue@3.3.13) - '@vue/shared': 3.3.13 + '@vue/compiler-dom': 3.4.0 + '@vue/compiler-sfc': 3.4.0 + '@vue/runtime-dom': 3.4.0 + '@vue/server-renderer': 3.4.0(vue@3.4.0) + '@vue/shared': 3.4.0 typescript: 5.3.3 /w3c-xmlserializer@5.0.0: diff --git a/ui/web/src/assets/config.ts b/ui/web/src/assets/config.ts index cf6f3eb2..c9068f9b 100644 --- a/ui/web/src/assets/config.ts +++ b/ui/web/src/assets/config.ts @@ -4,8 +4,8 @@ const config: BaseConfig = { uiServer: { host: 'localhost', port: 8080, - protocol: 'ui0.0.1' - } + protocol: 'ui0.0.1', + }, } export default config diff --git a/ui/web/src/composables/UIClient.ts b/ui/web/src/composables/UIClient.ts index de796ba9..10f2d3de 100644 --- a/ui/web/src/composables/UIClient.ts +++ b/ui/web/src/composables/UIClient.ts @@ -3,7 +3,7 @@ import { type ProtocolResponse, type RequestPayload, type ResponsePayload, - ResponseStatus + ResponseStatus, } from '@/types' import config from '@/assets/config' @@ -57,13 +57,13 @@ export class UIClient { public async openConnection(hashId: string): Promise { return this.sendRequest(ProcedureName.OPEN_CONNECTION, { - hashIds: [hashId] + hashIds: [hashId], }) } public async closeConnection(hashId: string): Promise { return this.sendRequest(ProcedureName.CLOSE_CONNECTION, { - hashIds: [hashId] + hashIds: [hashId], }) } @@ -75,7 +75,7 @@ export class UIClient { return this.sendRequest(ProcedureName.START_TRANSACTION, { hashIds: [hashId], connectorId, - idTag + idTag, }) } @@ -85,7 +85,7 @@ export class UIClient { ): Promise { return this.sendRequest(ProcedureName.STOP_TRANSACTION, { hashIds: [hashId], - transactionId + transactionId, }) } @@ -95,7 +95,7 @@ export class UIClient { ): Promise { return this.sendRequest(ProcedureName.START_AUTOMATIC_TRANSACTION_GENERATOR, { hashIds: [hashId], - connectorIds: [connectorId] + connectorIds: [connectorId], }) } @@ -105,7 +105,7 @@ export class UIClient { ): Promise { return this.sendRequest(ProcedureName.STOP_AUTOMATIC_TRANSACTION_GENERATOR, { hashIds: [hashId], - connectorIds: [connectorId] + connectorIds: [connectorId], }) } diff --git a/ui/web/src/composables/Utils.ts b/ui/web/src/composables/Utils.ts index 4ff26db6..ea51bc23 100644 --- a/ui/web/src/composables/Utils.ts +++ b/ui/web/src/composables/Utils.ts @@ -8,7 +8,7 @@ export const ifUndefined = (value: T | undefined, isValue: T): T => { } // const isIterable = (obj: T): boolean => { -// if (obj === null || obj === undefined) { +// if (obj == null) { // return false // } // return typeof (obj as unknown as Iterable)[Symbol.iterator] === 'function' diff --git a/ui/web/src/router/index.ts b/ui/web/src/router/index.ts index 1015d923..b58a4d2a 100644 --- a/ui/web/src/router/index.ts +++ b/ui/web/src/router/index.ts @@ -5,13 +5,13 @@ const routes: RouteRecordRaw[] = [ { path: '/', name: 'charging-stations', - component: ChargingStationsView - } + component: ChargingStationsView, + }, ] const router = createRouter({ history: createWebHistory(), - routes + routes, }) export default router diff --git a/ui/web/src/types/ChargingStationType.ts b/ui/web/src/types/ChargingStationType.ts index 2e79fbc8..1479e1d7 100644 --- a/ui/web/src/types/ChargingStationType.ts +++ b/ui/web/src/types/ChargingStationType.ts @@ -21,11 +21,11 @@ export enum OCPP16FirmwareStatus { Idle = 'Idle', InstallationFailed = 'InstallationFailed', Installing = 'Installing', - Installed = 'Installed' + Installed = 'Installed', } export const FirmwareStatus = { - ...OCPP16FirmwareStatus + ...OCPP16FirmwareStatus, } as const export type FirmwareStatus = OCPP16FirmwareStatus @@ -99,11 +99,11 @@ export enum OCPP16IncomingRequestCommand { REMOTE_START_TRANSACTION = 'RemoteStartTransaction', REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction', GET_DIAGNOSTICS = 'GetDiagnostics', - TRIGGER_MESSAGE = 'TriggerMessage' + TRIGGER_MESSAGE = 'TriggerMessage', } export const IncomingRequestCommand = { - ...OCPP16IncomingRequestCommand + ...OCPP16IncomingRequestCommand, } as const export type IncomingRequestCommand = OCPP16IncomingRequestCommand @@ -115,11 +115,11 @@ export enum OCPP16RequestCommand { START_TRANSACTION = 'StartTransaction', STOP_TRANSACTION = 'StopTransaction', METER_VALUES = 'MeterValues', - DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification' + DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification', } export const RequestCommand = { - ...OCPP16RequestCommand + ...OCPP16RequestCommand, } as const export type RequestCommand = OCPP16RequestCommand @@ -128,7 +128,7 @@ export type BootNotificationResponse = OCPP16BootNotificationResponse export enum OCPP16RegistrationStatus { ACCEPTED = 'Accepted', PENDING = 'Pending', - REJECTED = 'Rejected' + REJECTED = 'Rejected', } export interface OCPP16BootNotificationResponse extends JsonObject { @@ -143,11 +143,11 @@ export enum OCPP16MessageTrigger { FirmwareStatusNotification = 'FirmwareStatusNotification', Heartbeat = 'Heartbeat', MeterValues = 'MeterValues', - StatusNotification = 'StatusNotification' + StatusNotification = 'StatusNotification', } export const MessageTrigger = { - ...OCPP16MessageTrigger + ...OCPP16MessageTrigger, } as const export type MessageTrigger = OCPP16MessageTrigger @@ -158,30 +158,30 @@ type CommandsSupport = { export enum OCPPVersion { VERSION_16 = '1.6', - VERSION_20 = '2.0' + VERSION_20 = '2.0', } export enum OCPPProtocol { - JSON = 'json' + JSON = 'json', } export enum CurrentType { AC = 'AC', - DC = 'DC' + DC = 'DC', } export enum Voltage { VOLTAGE_110 = 110, VOLTAGE_230 = 230, VOLTAGE_400 = 400, - VOLTAGE_800 = 800 + VOLTAGE_800 = 800, } export enum AmpereUnits { MILLI_AMPERE = 'mA', CENTI_AMPERE = 'cA', DECI_AMPERE = 'dA', - AMPERE = 'A' + AMPERE = 'A', } export type ConnectorStatus = { @@ -207,7 +207,7 @@ export type EvseStatus = { export enum OCPP16AvailabilityType { INOPERATIVE = 'Inoperative', - OPERATIVE = 'Operative' + OPERATIVE = 'Operative', } export type AvailabilityType = OCPP16AvailabilityType @@ -221,7 +221,7 @@ export enum OCPP16ChargePointStatus { FINISHING = 'Finishing', RESERVED = 'Reserved', UNAVAILABLE = 'Unavailable', - FAULTED = 'Faulted' + FAULTED = 'Faulted', } export type ChargePointStatus = OCPP16ChargePointStatus diff --git a/ui/web/src/types/UIProtocol.ts b/ui/web/src/types/UIProtocol.ts index 07eb5212..48b0f1a8 100644 --- a/ui/web/src/types/UIProtocol.ts +++ b/ui/web/src/types/UIProtocol.ts @@ -1,16 +1,16 @@ import type { JsonObject } from './JsonType' export enum Protocol { - UI = 'ui' + UI = 'ui', } export enum ApplicationProtocol { HTTP = 'http', - WS = 'ws' + WS = 'ws', } export enum ProtocolVersion { - '0.0.1' = '0.0.1' + '0.0.1' = '0.0.1', } export type ProtocolRequest = [string, ProcedureName, RequestPayload] @@ -31,7 +31,7 @@ export enum ProcedureName { START_AUTOMATIC_TRANSACTION_GENERATOR = 'startAutomaticTransactionGenerator', STOP_AUTOMATIC_TRANSACTION_GENERATOR = 'stopAutomaticTransactionGenerator', START_TRANSACTION = 'startTransaction', - STOP_TRANSACTION = 'stopTransaction' + STOP_TRANSACTION = 'stopTransaction', } export interface RequestPayload extends JsonObject { @@ -41,7 +41,7 @@ export interface RequestPayload extends JsonObject { export enum ResponseStatus { SUCCESS = 'success', - FAILURE = 'failure' + FAILURE = 'failure', } export interface ResponsePayload extends JsonObject { diff --git a/ui/web/src/types/index.ts b/ui/web/src/types/index.ts index ec7821f3..d866d361 100644 --- a/ui/web/src/types/index.ts +++ b/ui/web/src/types/index.ts @@ -1,7 +1,7 @@ export type { ChargingStationData, ChargingStationInfo, - ConnectorStatus + ConnectorStatus, } from './ChargingStationType' export type { BaseConfig } from './ConfigurationType' export { @@ -9,5 +9,5 @@ export { type ProtocolResponse, type RequestPayload, type ResponsePayload, - ResponseStatus + ResponseStatus, } from './UIProtocol' diff --git a/ui/web/src/views/ChargingStationsView.vue b/ui/web/src/views/ChargingStationsView.vue index 5e385955..707cce54 100644 --- a/ui/web/src/views/ChargingStationsView.vue +++ b/ui/web/src/views/ChargingStationsView.vue @@ -39,7 +39,7 @@ type State = { const state: State = reactive({ isLoading: false, chargingStations: [], - idTag: '' + idTag: '', }) async function load(): Promise { diff --git a/ui/web/start.js b/ui/web/start.js index 03141953..99a794d5 100644 --- a/ui/web/start.js +++ b/ui/web/start.js @@ -5,7 +5,7 @@ import { fileURLToPath } from 'node:url' import finalhandler from 'finalhandler' import serveStatic from 'serve-static' -const isCFEnvironment = env.VCAP_APPLICATION !== undefined +const isCFEnvironment = env.VCAP_APPLICATION != null const PORT = isCFEnvironment ? parseInt(env.PORT) : 3030 const uiPath = join(dirname(fileURLToPath(import.meta.url)), './dist') diff --git a/ui/web/tests/unit/CSTable.spec.ts b/ui/web/tests/unit/CSTable.spec.ts index 39c980c5..a725df55 100644 --- a/ui/web/tests/unit/CSTable.spec.ts +++ b/ui/web/tests/unit/CSTable.spec.ts @@ -6,7 +6,7 @@ import type { ChargingStationData } from '@/types' test('renders CS table columns name', () => { const chargingStations: ChargingStationData[] = [] const wrapper = shallowMount(CSTable, { - props: { chargingStations, idTag: '0' } + props: { chargingStations, idTag: '0' }, }) expect(wrapper.text()).to.include('Action') expect(wrapper.text()).to.include('Connector') diff --git a/ui/web/vite.config.ts b/ui/web/vite.config.ts index a5a1d533..c258c4b1 100644 --- a/ui/web/vite.config.ts +++ b/ui/web/vite.config.ts @@ -7,7 +7,7 @@ export default defineConfig({ plugins: [vue(), vueJsx()], resolve: { alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)) - } - } + '@': fileURLToPath(new URL('./src', import.meta.url)), + }, + }, }) diff --git a/ui/web/vitest.config.ts b/ui/web/vitest.config.ts index 39905b29..b772de17 100644 --- a/ui/web/vitest.config.ts +++ b/ui/web/vitest.config.ts @@ -12,8 +12,8 @@ export default mergeConfig( root: fileURLToPath(new URL('./', import.meta.url)), coverage: { provider: 'v8', - reporter: ['text', 'lcov'] - } - } + reporter: ['text', 'lcov'], + }, + }, }) )