refactor: silence linter warnings
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 1 Nov 2024 16:17:56 +0000 (17:17 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 1 Nov 2024 16:17:56 +0000 (17:17 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
scripts/bundle.js
src/charging-station/ChargingStation.ts
src/charging-station/ocpp/OCPPServiceUtils.ts
tests/charging-station/Helpers.test.ts
tests/utils/ConfigurationUtils.test.ts
tests/utils/ErrorUtils.test.ts

index 35caeb5759d6eed953a4c2b89be82832027e98ee..66fbb00302d78c115c5bd55cdd666a155bf174d4 100644 (file)
@@ -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
index 5e0640b625b1f731fff3e6f3547406f007430251..5757e47d6663baf62b98c4aebc29725d820dc5f0 100644 (file)
@@ -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) {
index 6f54853f5b9d86a9629b355e2887320500d42114..226bffb270aefb3410e943914384962106c7f1eb 100644 (file)
@@ -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 = (
index 9d1df21b1f9e1b21267cb5198bdedb86949390c6..32c9e3330b0e3a33676690e8b8c15fe9a0516109 100644 (file)
@@ -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'
 
index 23f6c5ac544190203fea1068a0b3110efd00c763..a8c6d177bc804549a238c01f45f33e17a6a35991 100644 (file)
@@ -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'
index b05eec74684152d32cf0231f9e233a4684cef864..ff7cd5a74bb3e96820c3e3b51381510620810efa 100644 (file)
@@ -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'