Skip to content
← All rules
ResourcesRetries

resources/require-bounded-retries

Retries need a finite attempt count, elapsed-time limit, or deadline; cancellation alone does not guarantee a bound.

retrylimitsreliability
TypeScript
while (true) { try { return await request(); } catch {} }
Finding

Require a finite bound on retry behavior.

Setup

Install the package, register its plugin factory, then enable the rule.

Install the package

pnpm add -D @scruple/resources

Register the plugin

In scruple.config.ts, register the factory under the resources namespace used by the rule ID.

import { resources } from "@scruple/resources";

plugins: {
  "resources": resources(),
},

Enable the rule

"resources/require-bounded-retries": "warn"
Package
@scruple/resources
Default threshold
0.9
Minimum confidence
0.7

Released under the MIT License.