refactor: renable standard JS linter rules
[poolifier.git] / src / pools / selection-strategies / weighted-round-robin-worker-choice-strategy.ts
index 4b7eac7a17d3f2f4963a21d3f7db429bc73a21b9..5ccc9c320ac6e09cce290c8a848c4e0ebdb60006 100644 (file)
@@ -89,9 +89,9 @@ export class WeightedRoundRobinWorkerChoiceStrategy<
   }
 
   private weightedRoundRobinNextWorkerNodeKey (): number | undefined {
-    const workerWeight = this.opts.weights?.[
-      this.nextWorkerNodeKey ?? this.previousWorkerNodeKey
-    ] as number
+    const workerWeight =
+      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+      this.opts.weights![this.nextWorkerNodeKey ?? this.previousWorkerNodeKey]!
     if (this.workerNodeVirtualTaskRunTime < workerWeight) {
       this.workerNodeVirtualTaskRunTime =
         this.workerNodeVirtualTaskRunTime +