refactor: renable standard JS linter rules
[poolifier.git] / src / pools / selection-strategies / interleaved-weighted-round-robin-worker-choice-strategy.ts
index db439f0209c2ddf21cbe081f3d2b72138453545b..fe4b48833ee98459880878c91a82204cac8408f5 100644 (file)
@@ -94,7 +94,8 @@ export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
         ) {
           this.workerNodeVirtualTaskRunTime = 0
         }
-        const workerWeight = this.opts.weights?.[workerNodeKey] as number
+        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+        const workerWeight = this.opts.weights![workerNodeKey]!
         if (
           this.isWorkerNodeReady(workerNodeKey) &&
           workerWeight >= this.roundWeights[roundIndex] &&
@@ -156,7 +157,8 @@ export class InterleavedWeightedRoundRobinWorkerChoiceStrategy<
   private getRoundWeights (): number[] {
     return [
       ...new Set(
-        Object.values(this.opts.weights as Record<number, number>)
+        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+        Object.values(this.opts.weights!)
           .slice()
           .sort((a, b) => a - b)
       )