---
url: /docs/guide/usage/linter/rules/eslint/no-unmodified-loop-condition.md
---

### What it does

Disallow references in loop conditions that are never modified within the loop.

### Why is this bad?

A loop condition that depends on values that never change within the loop body
can cause infinite loops or logic bugs.

### Examples

Examples of **incorrect** code for this rule:

```js
let done = false;
while (!done) {
  work();
}
```

Examples of **correct** code for this rule:

```js
let done = false;
while (!done) {
  done = checkDone();
}
```

## Configuration

This rule accepts a configuration object with the following properties:

### checkConditionalExpressions

type: `boolean`

default: `false`

Whether references in each branch of a conditional expression should be checked
independently instead of checking the result of the entire expression.

## How to use

## Version

This rule was added in v1.48.0.

## References
