Skip to main content

What it flags

A FileHandle from fs/promises open() is not closed in finally, so an error before close() leaks the file descriptor. Handles that are returned, stored, passed on or turned into a stream are accepted.

How to review or fix

Confirm nothing else closes it, then close it in finally or use await using.

Configuration

Set the rule to "off" in loadwise.config.json to drop its findings: