From: Jérôme Benoit Date: Fri, 1 Nov 2024 16:17:56 +0000 (+0100) Subject: refactor: silence linter warnings X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=fa8baf177c5691312128077deb9299a44a7e2f42;p=e-mobility-charging-stations-simulator.git refactor: silence linter warnings Signed-off-by: Jérôme Benoit --- diff --git a/scripts/bundle.js b/scripts/bundle.js index 35caeb57..66fbb003 100644 --- a/scripts/bundle.js +++ b/scripts/bundle.js @@ -1,9 +1,9 @@ +import { env } from 'node:process' /* eslint-disable n/no-unpublished-import */ import chalk from 'chalk' import { build } from 'esbuild' import { clean } from 'esbuild-plugin-clean' import { copy } from 'esbuild-plugin-copy' -import { env } from 'node:process' const isDevelopmentBuild = env.BUILD === 'development' const sourcemap = !!isDevelopmentBuild diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 5e0640b6..5757e47d 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1059,8 +1059,10 @@ export class ChargingStation extends EventEmitter { this, this.stationInfo.amperageLimitationOcppKey, // prettier-ignore - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - (this.stationInfo.maximumAmperage! * getAmperageLimitationUnitDivider(this.stationInfo)).toString() + ( + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + this.stationInfo.maximumAmperage! * getAmperageLimitationUnitDivider(this.stationInfo) + ).toString() ) } if (getConfigurationKey(this, StandardParametersKey.SupportedFeatureProfiles) == null) { diff --git a/src/charging-station/ocpp/OCPPServiceUtils.ts b/src/charging-station/ocpp/OCPPServiceUtils.ts index 6f54853f..226bffb2 100644 --- a/src/charging-station/ocpp/OCPPServiceUtils.ts +++ b/src/charging-station/ocpp/OCPPServiceUtils.ts @@ -1154,8 +1154,10 @@ const getLimitFromSampledValueTemplateCustomValue = ( minLimit ) } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - return (!isNaN(parsedValue) ? parsedValue : options.fallbackValue!) * options.unitMultiplier! + return ( + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + (!Number.isNaN(parsedValue) ? parsedValue : options.fallbackValue!) * options.unitMultiplier! + ) } const getSampledValueTemplate = ( diff --git a/tests/charging-station/Helpers.test.ts b/tests/charging-station/Helpers.test.ts index 9d1df21b..32c9e333 100644 --- a/tests/charging-station/Helpers.test.ts +++ b/tests/charging-station/Helpers.test.ts @@ -1,6 +1,6 @@ +import { describe, it } from 'node:test' /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { expect } from 'expect' -import { describe, it } from 'node:test' import type { ChargingStation } from '../../src/charging-station/index.js' diff --git a/tests/utils/ConfigurationUtils.test.ts b/tests/utils/ConfigurationUtils.test.ts index 23f6c5ac..a8c6d177 100644 --- a/tests/utils/ConfigurationUtils.test.ts +++ b/tests/utils/ConfigurationUtils.test.ts @@ -1,6 +1,6 @@ +import { describe, it } from 'node:test' /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { expect } from 'expect' -import { describe, it } from 'node:test' import { FileType } from '../../src/types/index.js' import { handleFileException, logPrefix } from '../../src/utils/ConfigurationUtils.js' diff --git a/tests/utils/ErrorUtils.test.ts b/tests/utils/ErrorUtils.test.ts index b05eec74..ff7cd5a7 100644 --- a/tests/utils/ErrorUtils.test.ts +++ b/tests/utils/ErrorUtils.test.ts @@ -1,6 +1,6 @@ +import { describe, it } from 'node:test' /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { expect } from 'expect' -import { describe, it } from 'node:test' import type { ChargingStation } from '../../src/charging-station/index.js'