Skip to main content

Presets

eslint-plugin-runtime-cleanup exposes stable flat-config presets so consumers can choose a rule set without handing TypeScript project-service configuration to the plugin.

Type-aware presets include rules that require TypeScript parser services, but they do not set parserOptions.projectService. Configure type-aware parsing in your own flat config before adding one of those presets.

Preset listโ€‹

PresetType informationIntended use
runtime-cleanup.configs.minimalNoLowest-noise cleanup rules.
runtime-cleanup.configs.recommendedNoBroadly safe cleanup rules.
runtime-cleanup.configs["recommended-type-checked"]YesRecommended rules that need TypeScript type information.
runtime-cleanup.configs.strictYesStronger cleanup enforcement.
runtime-cleanup.configs.allYesAll stable rules.
runtime-cleanup.configs.experimentalNoRules still proving out behavior.
import tsParser from "@typescript-eslint/parser";
import runtimeCleanup from "eslint-plugin-runtime-cleanup";

export default [
{
files: ["**/*.{ts,tsx,mts,cts}"],
languageOptions: {
parser: tsParser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
runtimeCleanup.configs["recommended-type-checked"],
];

Rule matrixโ€‹

Runtime-cleanup rules are listed below. Each rule documents the exact resource-lifetime pattern it enforces.

RuleFixPresets
no-floating-abort-controllers-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-audio-contexts-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-broadcast-channels-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-child-processes-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-disposable-stacks-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-file-watchers-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-geolocation-watches-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-infinite-animations-๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-media-streams-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-message-channels-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-network-connections-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-object-urls-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-observers-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-servers-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-streams-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-timers-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-wake-locks-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-web-stream-locks-๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-floating-workers-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ
no-unmanaged-event-listeners-๐ŸŸก ๐Ÿงฌ ๐Ÿ”ด ๐ŸŸฃ