Skip to content

Commit 3083c1d

Browse files
authored
allow constant conditions for loops (#157)
1 parent e5b7cc7 commit 3083c1d

File tree

3 files changed

+1
-6
lines changed

3 files changed

+1
-6
lines changed

Diff for: .eslintrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ rules:
154154
no-compare-neg-zero: error
155155
no-cond-assign: error
156156
no-console: warn
157-
no-constant-condition: error
157+
no-constant-condition: [error, { checkLoops: false }]
158158
no-control-regex: error
159159
no-debugger: warn
160160
no-dupe-args: error

Diff for: src/execution/executor.ts

-4
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,6 @@ export class Executor {
14221422
const initialCount = stream.initialCount;
14231423

14241424
let index = _index;
1425-
// eslint-disable-next-line no-constant-condition
14261425
while (true) {
14271426
if (index >= initialCount) {
14281427
this.addIteratorValue(
@@ -1485,7 +1484,6 @@ export class Executor {
14851484
): number {
14861485
let index = _index;
14871486

1488-
// eslint-disable-next-line no-constant-condition
14891487
while (true) {
14901488
const iteration = iterator.next();
14911489
if (iteration.done) {
@@ -1578,7 +1576,6 @@ export class Executor {
15781576
const initialCount = stream.initialCount;
15791577
let index = 0;
15801578
try {
1581-
// eslint-disable-next-line no-constant-condition
15821579
while (true) {
15831580
if (index >= initialCount) {
15841581
// eslint-disable-next-line @typescript-eslint/no-floating-promises
@@ -1649,7 +1646,6 @@ export class Executor {
16491646
): Promise<void> {
16501647
let index = 0;
16511648
try {
1652-
// eslint-disable-next-line no-constant-condition
16531649
while (true) {
16541650
// eslint-disable-next-line no-await-in-loop
16551651
const iteration = await iterator.next();

Diff for: src/jsutils/publisher.ts

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export class Publisher<TSource, TPayload = TSource> {
4545
stop.then(onStop);
4646
}
4747

48-
// eslint-disable-next-line no-constant-condition
4948
while (true) {
5049
// eslint-disable-next-line no-await-in-loop
5150
await this._trigger;

0 commit comments

Comments
 (0)