---
url: https://scruple.dev/rules/resources/require-complete-resource-cleanup.md
description: Require complete cleanup of multiple resources.
---

# resources/require-complete-resource-cleanup

Require complete cleanup of multiple resources.

## What it checks

When a function acquires multiple resources, all of them must be cleaned up across acquisition, work, and cleanup failure paths.

## Rule metadata

* Package: `@scruple/resources`
* Category: Resource lifecycle
* Tags: cleanup, multiple-resources, failure-paths
* Default threshold: `plugin default`
* Minimum confidence: `plugin default`

## Examples

### Reported

```ts
const input = await openInput(); const output = await openOutput(); await copy(input, output); output.close();
```

### Accepted

```ts
await using input = await openInput(); await using output = await openOutput(); await copy(input, output);
```
