Rules overview
eslint-plugin-runtime-cleanup rules target runtime resource lifetimes that are
easy to leak when allocation and teardown drift apart.
Stable rulesโ
no-floating-timersrequires timer handles to be retained so they can be cleared during cleanup.no-unmanaged-event-listenersrequires event listeners to use anAbortSignaloption or a matchingremoveEventListenercleanup call.no-floating-observersrequires native observer instances to be retained so they can be disconnected during cleanup.no-floating-workersrequires worker handles to be retained so they can be terminated during cleanup.no-floating-child-processesrequires child process handles to be retained so they can be killed during cleanup.
Future rules should continue to target explicit runtime resource lifetimes, including timers, listeners, observers, abort controllers, workers, streams, child processes, and disposable handles.
Rule authoring expectationsโ
Runtime cleanup rules should be conservative:
- report only resource allocation patterns with a clear cleanup obligation
- avoid whole-file heuristics that create noisy false positives
- use type information only when it materially improves precision
- prefer suggestions over autofixes when cleanup placement is ambiguous
- document the exact lifecycle pattern the rule expects
Presetsโ
The preset pages describe the exported config keys and are ready for future rules: