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โ
| Preset | Type information | Intended use |
|---|---|---|
runtime-cleanup.configs.minimal | No | Lowest-noise cleanup rules. |
runtime-cleanup.configs.recommended | No | Broadly safe cleanup rules. |
runtime-cleanup.configs["recommended-type-checked"] | Yes | Recommended rules that need TypeScript type information. |
runtime-cleanup.configs.strict | Yes | Stronger cleanup enforcement. |
runtime-cleanup.configs.all | Yes | All stable rules. |
runtime-cleanup.configs.experimental | No | Rules 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.
Fixlegend:fix= autofixablesuggest= suggestions available-= report only
Preset emojilegend: