# no-unmodified-loop-condition

Rule `eslint/no-unmodified-loop-condition`. Disallow unmodified loop conditions

- Source: eslint
- Technologies: JavaScript
- Kind: suspicious
- Needs type information: no
- Autofix: no
- Reach: 6.9M weekly downloads of presets that enable it
- Trend: +40.8% last quarter
- Rank: #1153 by reach, #934 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `no-unmodified-loop-condition` | no | no | package `eslint` | [docs](https://eslint.org/docs/latest/rules/no-unmodified-loop-condition) |
| Oxlint | `no-unmodified-loop-condition` | no | no | plugin `eslint`, category suspicious | [docs](https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unmodified-loop-condition.html) |
| Biome | `nursery/noUnmodifiedLoopCondition` | no | no | group nursery, since 2.5.12 | [docs](https://biomejs.dev/linter/rules/no-unmodified-loop-condition/) |

## Code examples

### Incorrect: the rule reports this

```js
let node = something;

while (node) {
    doSomething(node);
}
node = other;

for (let j = 0; j < 5;) {
    doSomething(j);
}

while (node !== root) {
    doSomething(node);
}
```

### Correct: the rule accepts this

```js
while (node) {
    doSomething(node);
    node = node.parent;
}

for (let j = 0; j < items.length; ++j) {
    doSomething(items[j]);
}

// OK, the result of this binary expression is changed in this loop.
while (node !== root) {
    doSomething(node);
    node = node.parent;
}

// OK, the result of this ternary expression is changed in this loop.
while (node ? A : B) {
    doSomething(node);
    node = node.parent;
}

// A property might be a getter which has side effect...
// Or "doSomething" can modify "obj.foo".
while (obj.foo) {
    doSomething(obj);
}

// A function call can return various values.
while (check(obj)) {
    doSomething(obj);
}
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
export default [
  {
    rules: {
      "no-unmodified-loop-condition": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "rules": {
    "no-unmodified-loop-condition": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noUnmodifiedLoopCondition": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [JavaScript Standard Style](https://lintradar.dev/presets/standard.md) | ESLint | `eslint-config-standard` | 161 | 3.1M | +12.9% |
| [Ultracite for Oxlint](https://lintradar.dev/presets/ultracite-oxlint.md) | Oxlint | `ultracite` | 475 | 2.1M | +151.7% |
| [Anthony Fu's config](https://lintradar.dev/presets/antfu.md) | ESLint | `@antfu/eslint-config` | 294 | 758.7K | +49.9% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |
| [neostandard](https://lintradar.dev/presets/neostandard.md) | ESLint | `neostandard` | 95 | 317.6K | +50.2% |
| [eslint-config-love](https://lintradar.dev/presets/love.md) | ESLint | `eslint-config-love` | 258 | 171.7K | +39.3% |
| [Alloy](https://lintradar.dev/presets/alloy.md) | ESLint | `eslint-config-alloy` | 166 | 31.4K | +32.4% |

## Related rules

- [eslint/accessor-pairs](https://lintradar.dev/rules/eslint/accessor-pairs.md): Enforce getter and setter pairs in objects and classes
- [eslint/consistent-return](https://lintradar.dev/rules/eslint/consistent-return.md): Require `return` statements to either always or never specify values
- [eslint/no-restricted-exports](https://lintradar.dev/rules/eslint/no-restricted-exports.md): Disallow specified names in exports
- [eslint/no-underscore-dangle](https://lintradar.dev/rules/eslint/no-underscore-dangle.md): Disallow dangling underscores in identifiers
- [eslint/no-continue](https://lintradar.dev/rules/eslint/no-continue.md): Disallow `continue` statements
- [eslint/no-console](https://lintradar.dev/rules/eslint/no-console.md): Disallow the use of `console`

---

Web page: https://lintradar.dev/rules/eslint/no-unmodified-loop-condition. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
