# disabled-timeout

Rule `sonarjs/disabled-timeout`. Disabling Mocha timeouts should be explicit

- Source: sonarjs
- Technologies: JavaScript
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 6.2M weekly downloads of presets that enable it
- Trend: +62.1% last quarter
- Rank: #1205 by reach, #506 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `sonarjs/disabled-timeout` | yes | no | package `eslint-plugin-sonarjs` | [docs](https://rules.sonarsource.com/javascript/RSPEC-6080/) |

## Code examples

### Incorrect: the rule reports this

```js
describe("testing this.timeout", function() {
  it("unexpectedly disables the timeout", function(done) {
    this.timeout(2147483648); // Noncompliant
  });
});
```

### Correct: the rule accepts this

```js
describe("testing this.timeout", function() {
  it("doesn't disable the timeout", function(done) {
    this.timeout(1000);
  });
});
```

```js
describe("testing this.timeout", function() {
  it("disables the timeout as expected", function(done) {
    this.timeout(0);
  });
});
```

Examples from the ESLint documentation.

## Enable it

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

```js
export default [
  {
    rules: {
      "sonarjs/disabled-timeout": "error",
    },
  },
];
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [SonarJS recommended](https://lintradar.dev/presets/sonarjs-recommended.md) | ESLint | `eslint-plugin-sonarjs` | 230 | 6.2M | +62.1% |

## Related rules

- [sonarjs/disabled-resource-integrity](https://lintradar.dev/rules/sonarjs/disabled-resource-integrity.md): Remote artifacts should not be used without integrity checks
- [sonarjs/dompurify-unsafe-config](https://lintradar.dev/rules/sonarjs/dompurify-unsafe-config.md): DOMPurify configuration should not be bypassable
- [sonarjs/disabled-auto-escaping](https://lintradar.dev/rules/sonarjs/disabled-auto-escaping.md): Auto-escaping in HTML template engines should not be disabled
- [sonarjs/duplicates-in-character-class](https://lintradar.dev/rules/sonarjs/duplicates-in-character-class.md): Character classes in regular expressions should not contain the same character twice
- [sonarjs/different-types-comparison](https://lintradar.dev/rules/sonarjs/different-types-comparison.md): Strict equality operators should not be used with dissimilar types
- [sonarjs/dynamically-constructed-templates](https://lintradar.dev/rules/sonarjs/dynamically-constructed-templates.md): Templates should not be constructed dynamically

---

Web page: https://lintradar.dev/rules/sonarjs/disabled-timeout. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
