eslint-plugin-runtime-cleanup 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +117 -0
  4. package/dist/_internal/ast-node.d.ts +19 -0
  5. package/dist/_internal/ast-node.d.ts.map +1 -0
  6. package/dist/_internal/ast-node.js +42 -0
  7. package/dist/_internal/ast-node.js.map +1 -0
  8. package/dist/_internal/bounded-cache.d.ts +37 -0
  9. package/dist/_internal/bounded-cache.d.ts.map +1 -0
  10. package/dist/_internal/bounded-cache.js +63 -0
  11. package/dist/_internal/bounded-cache.js.map +1 -0
  12. package/dist/_internal/cycle-safe-linked-search.d.ts +48 -0
  13. package/dist/_internal/cycle-safe-linked-search.d.ts.map +1 -0
  14. package/dist/_internal/cycle-safe-linked-search.js +70 -0
  15. package/dist/_internal/cycle-safe-linked-search.js.map +1 -0
  16. package/dist/_internal/expression-boolean-memoizer.d.ts +17 -0
  17. package/dist/_internal/expression-boolean-memoizer.d.ts.map +1 -0
  18. package/dist/_internal/expression-boolean-memoizer.js +22 -0
  19. package/dist/_internal/expression-boolean-memoizer.js.map +1 -0
  20. package/dist/_internal/filter-callback.d.ts +52 -0
  21. package/dist/_internal/filter-callback.d.ts.map +1 -0
  22. package/dist/_internal/filter-callback.js +108 -0
  23. package/dist/_internal/filter-callback.js.map +1 -0
  24. package/dist/_internal/floating-resource.d.ts +29 -0
  25. package/dist/_internal/floating-resource.d.ts.map +1 -0
  26. package/dist/_internal/floating-resource.js +114 -0
  27. package/dist/_internal/floating-resource.js.map +1 -0
  28. package/dist/_internal/member-call.d.ts +53 -0
  29. package/dist/_internal/member-call.d.ts.map +1 -0
  30. package/dist/_internal/member-call.js +61 -0
  31. package/dist/_internal/member-call.js.map +1 -0
  32. package/dist/_internal/normalize-expression-text.d.ts +21 -0
  33. package/dist/_internal/normalize-expression-text.d.ts.map +1 -0
  34. package/dist/_internal/normalize-expression-text.js +186 -0
  35. package/dist/_internal/normalize-expression-text.js.map +1 -0
  36. package/dist/_internal/nullish-comparison.d.ts +44 -0
  37. package/dist/_internal/nullish-comparison.d.ts.map +1 -0
  38. package/dist/_internal/nullish-comparison.js +162 -0
  39. package/dist/_internal/nullish-comparison.js.map +1 -0
  40. package/dist/_internal/plugin-settings.d.ts +30 -0
  41. package/dist/_internal/plugin-settings.d.ts.map +1 -0
  42. package/dist/_internal/plugin-settings.js +90 -0
  43. package/dist/_internal/plugin-settings.js.map +1 -0
  44. package/dist/_internal/report-adapter.d.ts +24 -0
  45. package/dist/_internal/report-adapter.d.ts.map +1 -0
  46. package/dist/_internal/report-adapter.js +35 -0
  47. package/dist/_internal/report-adapter.js.map +1 -0
  48. package/dist/_internal/rule-catalog.d.ts +47 -0
  49. package/dist/_internal/rule-catalog.d.ts.map +1 -0
  50. package/dist/_internal/rule-catalog.js +97 -0
  51. package/dist/_internal/rule-catalog.js.map +1 -0
  52. package/dist/_internal/rule-docs-metadata.d.ts +35 -0
  53. package/dist/_internal/rule-docs-metadata.d.ts.map +1 -0
  54. package/dist/_internal/rule-docs-metadata.js +172 -0
  55. package/dist/_internal/rule-docs-metadata.js.map +1 -0
  56. package/dist/_internal/rule-docs-url.d.ts +15 -0
  57. package/dist/_internal/rule-docs-url.d.ts.map +1 -0
  58. package/dist/_internal/rule-docs-url.js +15 -0
  59. package/dist/_internal/rule-docs-url.js.map +1 -0
  60. package/dist/_internal/rules-registry.d.ts +11 -0
  61. package/dist/_internal/rules-registry.d.ts.map +1 -0
  62. package/dist/_internal/rules-registry.js +53 -0
  63. package/dist/_internal/rules-registry.js.map +1 -0
  64. package/dist/_internal/runtime-cleanup-config-references.d.ts +38 -0
  65. package/dist/_internal/runtime-cleanup-config-references.d.ts.map +1 -0
  66. package/dist/_internal/runtime-cleanup-config-references.js +78 -0
  67. package/dist/_internal/runtime-cleanup-config-references.js.map +1 -0
  68. package/dist/_internal/safe-type-operation.d.ts +89 -0
  69. package/dist/_internal/safe-type-operation.d.ts.map +1 -0
  70. package/dist/_internal/safe-type-operation.js +147 -0
  71. package/dist/_internal/safe-type-operation.js.map +1 -0
  72. package/dist/_internal/scope-variable.d.ts +17 -0
  73. package/dist/_internal/scope-variable.d.ts.map +1 -0
  74. package/dist/_internal/scope-variable.js +30 -0
  75. package/dist/_internal/scope-variable.js.map +1 -0
  76. package/dist/_internal/type-checker.d.ts +11 -0
  77. package/dist/_internal/type-checker.d.ts.map +1 -0
  78. package/dist/_internal/type-checker.js +25 -0
  79. package/dist/_internal/type-checker.js.map +1 -0
  80. package/dist/_internal/type-predicate-autofix-safety.d.ts +16 -0
  81. package/dist/_internal/type-predicate-autofix-safety.d.ts.map +1 -0
  82. package/dist/_internal/type-predicate-autofix-safety.js +54 -0
  83. package/dist/_internal/type-predicate-autofix-safety.js.map +1 -0
  84. package/dist/_internal/type-reference-node.d.ts +23 -0
  85. package/dist/_internal/type-reference-node.d.ts.map +1 -0
  86. package/dist/_internal/type-reference-node.js +41 -0
  87. package/dist/_internal/type-reference-node.js.map +1 -0
  88. package/dist/_internal/typed-rule.d.ts +91 -0
  89. package/dist/_internal/typed-rule.d.ts.map +1 -0
  90. package/dist/_internal/typed-rule.js +121 -0
  91. package/dist/_internal/typed-rule.js.map +1 -0
  92. package/dist/_internal/value-rewrite-autofix-safety.d.ts +29 -0
  93. package/dist/_internal/value-rewrite-autofix-safety.d.ts.map +1 -0
  94. package/dist/_internal/value-rewrite-autofix-safety.js +108 -0
  95. package/dist/_internal/value-rewrite-autofix-safety.js.map +1 -0
  96. package/dist/plugin.cjs +3693 -0
  97. package/dist/plugin.cjs.map +7 -0
  98. package/dist/plugin.d.cts +75 -0
  99. package/dist/plugin.d.ts +75 -0
  100. package/dist/plugin.d.ts.map +1 -0
  101. package/dist/plugin.js +223 -0
  102. package/dist/plugin.js.map +1 -0
  103. package/dist/rules/no-floating-abort-controllers.d.ts +9 -0
  104. package/dist/rules/no-floating-abort-controllers.d.ts.map +1 -0
  105. package/dist/rules/no-floating-abort-controllers.js +144 -0
  106. package/dist/rules/no-floating-abort-controllers.js.map +1 -0
  107. package/dist/rules/no-floating-audio-contexts.d.ts +9 -0
  108. package/dist/rules/no-floating-audio-contexts.d.ts.map +1 -0
  109. package/dist/rules/no-floating-audio-contexts.js +95 -0
  110. package/dist/rules/no-floating-audio-contexts.js.map +1 -0
  111. package/dist/rules/no-floating-broadcast-channels.d.ts +9 -0
  112. package/dist/rules/no-floating-broadcast-channels.d.ts.map +1 -0
  113. package/dist/rules/no-floating-broadcast-channels.js +151 -0
  114. package/dist/rules/no-floating-broadcast-channels.js.map +1 -0
  115. package/dist/rules/no-floating-child-processes.d.ts +9 -0
  116. package/dist/rules/no-floating-child-processes.d.ts.map +1 -0
  117. package/dist/rules/no-floating-child-processes.js +259 -0
  118. package/dist/rules/no-floating-child-processes.js.map +1 -0
  119. package/dist/rules/no-floating-disposable-stacks.d.ts +9 -0
  120. package/dist/rules/no-floating-disposable-stacks.d.ts.map +1 -0
  121. package/dist/rules/no-floating-disposable-stacks.js +177 -0
  122. package/dist/rules/no-floating-disposable-stacks.js.map +1 -0
  123. package/dist/rules/no-floating-file-watchers.d.ts +9 -0
  124. package/dist/rules/no-floating-file-watchers.d.ts.map +1 -0
  125. package/dist/rules/no-floating-file-watchers.js +241 -0
  126. package/dist/rules/no-floating-file-watchers.js.map +1 -0
  127. package/dist/rules/no-floating-geolocation-watches.d.ts +9 -0
  128. package/dist/rules/no-floating-geolocation-watches.d.ts.map +1 -0
  129. package/dist/rules/no-floating-geolocation-watches.js +156 -0
  130. package/dist/rules/no-floating-geolocation-watches.js.map +1 -0
  131. package/dist/rules/no-floating-infinite-animations.d.ts +9 -0
  132. package/dist/rules/no-floating-infinite-animations.d.ts.map +1 -0
  133. package/dist/rules/no-floating-infinite-animations.js +131 -0
  134. package/dist/rules/no-floating-infinite-animations.js.map +1 -0
  135. package/dist/rules/no-floating-media-streams.d.ts +9 -0
  136. package/dist/rules/no-floating-media-streams.d.ts.map +1 -0
  137. package/dist/rules/no-floating-media-streams.js +175 -0
  138. package/dist/rules/no-floating-media-streams.js.map +1 -0
  139. package/dist/rules/no-floating-message-channels.d.ts +9 -0
  140. package/dist/rules/no-floating-message-channels.d.ts.map +1 -0
  141. package/dist/rules/no-floating-message-channels.js +150 -0
  142. package/dist/rules/no-floating-message-channels.js.map +1 -0
  143. package/dist/rules/no-floating-network-connections.d.ts +9 -0
  144. package/dist/rules/no-floating-network-connections.d.ts.map +1 -0
  145. package/dist/rules/no-floating-network-connections.js +170 -0
  146. package/dist/rules/no-floating-network-connections.js.map +1 -0
  147. package/dist/rules/no-floating-object-urls.d.ts +9 -0
  148. package/dist/rules/no-floating-object-urls.d.ts.map +1 -0
  149. package/dist/rules/no-floating-object-urls.js +83 -0
  150. package/dist/rules/no-floating-object-urls.js.map +1 -0
  151. package/dist/rules/no-floating-observers.d.ts +9 -0
  152. package/dist/rules/no-floating-observers.d.ts.map +1 -0
  153. package/dist/rules/no-floating-observers.js +160 -0
  154. package/dist/rules/no-floating-observers.js.map +1 -0
  155. package/dist/rules/no-floating-servers.d.ts +9 -0
  156. package/dist/rules/no-floating-servers.d.ts.map +1 -0
  157. package/dist/rules/no-floating-servers.js +282 -0
  158. package/dist/rules/no-floating-servers.js.map +1 -0
  159. package/dist/rules/no-floating-streams.d.ts +9 -0
  160. package/dist/rules/no-floating-streams.d.ts.map +1 -0
  161. package/dist/rules/no-floating-streams.js +222 -0
  162. package/dist/rules/no-floating-streams.js.map +1 -0
  163. package/dist/rules/no-floating-timers.d.ts +9 -0
  164. package/dist/rules/no-floating-timers.d.ts.map +1 -0
  165. package/dist/rules/no-floating-timers.js +145 -0
  166. package/dist/rules/no-floating-timers.js.map +1 -0
  167. package/dist/rules/no-floating-wake-locks.d.ts +9 -0
  168. package/dist/rules/no-floating-wake-locks.d.ts.map +1 -0
  169. package/dist/rules/no-floating-wake-locks.js +159 -0
  170. package/dist/rules/no-floating-wake-locks.js.map +1 -0
  171. package/dist/rules/no-floating-web-stream-locks.d.ts +9 -0
  172. package/dist/rules/no-floating-web-stream-locks.d.ts.map +1 -0
  173. package/dist/rules/no-floating-web-stream-locks.js +87 -0
  174. package/dist/rules/no-floating-web-stream-locks.js.map +1 -0
  175. package/dist/rules/no-floating-workers.d.ts +9 -0
  176. package/dist/rules/no-floating-workers.d.ts.map +1 -0
  177. package/dist/rules/no-floating-workers.js +185 -0
  178. package/dist/rules/no-floating-workers.js.map +1 -0
  179. package/dist/rules/no-unmanaged-event-listeners.d.ts +9 -0
  180. package/dist/rules/no-unmanaged-event-listeners.d.ts.map +1 -0
  181. package/dist/rules/no-unmanaged-event-listeners.js +210 -0
  182. package/dist/rules/no-unmanaged-event-listeners.js.map +1 -0
  183. package/docs/rules/getting-started.md +29 -0
  184. package/docs/rules/guides/adoption-checklist.md +31 -0
  185. package/docs/rules/guides/preset-selection-strategy.md +24 -0
  186. package/docs/rules/guides/rollout-and-fix-safety.md +42 -0
  187. package/docs/rules/guides/snapshot-testing.md +20 -0
  188. package/docs/rules/guides/type-aware-linting-readiness.md +20 -0
  189. package/docs/rules/no-floating-abort-controllers.md +126 -0
  190. package/docs/rules/no-floating-audio-contexts.md +104 -0
  191. package/docs/rules/no-floating-broadcast-channels.md +105 -0
  192. package/docs/rules/no-floating-child-processes.md +123 -0
  193. package/docs/rules/no-floating-disposable-stacks.md +118 -0
  194. package/docs/rules/no-floating-file-watchers.md +111 -0
  195. package/docs/rules/no-floating-geolocation-watches.md +95 -0
  196. package/docs/rules/no-floating-infinite-animations.md +110 -0
  197. package/docs/rules/no-floating-media-streams.md +113 -0
  198. package/docs/rules/no-floating-message-channels.md +114 -0
  199. package/docs/rules/no-floating-network-connections.md +116 -0
  200. package/docs/rules/no-floating-object-urls.md +102 -0
  201. package/docs/rules/no-floating-observers.md +108 -0
  202. package/docs/rules/no-floating-servers.md +127 -0
  203. package/docs/rules/no-floating-streams.md +120 -0
  204. package/docs/rules/no-floating-timers.md +120 -0
  205. package/docs/rules/no-floating-wake-locks.md +109 -0
  206. package/docs/rules/no-floating-web-stream-locks.md +105 -0
  207. package/docs/rules/no-floating-workers.md +123 -0
  208. package/docs/rules/no-unmanaged-event-listeners.md +143 -0
  209. package/docs/rules/overview.md +44 -0
  210. package/docs/rules/presets/all.md +35 -0
  211. package/docs/rules/presets/experimental.md +44 -0
  212. package/docs/rules/presets/index.md +54 -0
  213. package/docs/rules/presets/minimal.md +17 -0
  214. package/docs/rules/presets/recommended-type-checked.md +43 -0
  215. package/docs/rules/presets/recommended.md +34 -0
  216. package/docs/rules/presets/strict.md +36 -0
  217. package/package.json +323 -0
@@ -0,0 +1,105 @@
1
+ # no-floating-web-stream-locks
2
+
3
+ Require Web Stream readers and writers to be retained so their locks can be
4
+ released.
5
+
6
+ > **Rule catalog ID:** R019
7
+
8
+ ## Targeted pattern scope
9
+
10
+ This type-aware rule targets lock-producing Web Streams methods:
11
+
12
+ - `ReadableStream#getReader()`
13
+ - `WritableStream#getWriter()`
14
+
15
+ The rule uses TypeScript parser services to confirm that the receiver is a Web
16
+ `ReadableStream` or `WritableStream`. That avoids flagging project-local
17
+ objects that happen to expose methods named `getReader()` or `getWriter()`.
18
+
19
+ ## What this rule reports
20
+
21
+ The rule reports:
22
+
23
+ - discarded stream readers
24
+ - discarded stream writers
25
+ - immediately chained reader or writer use where the reader/writer handle is
26
+ lost
27
+
28
+ Immediate `releaseLock()` calls are allowed. The rule focuses on cases where the
29
+ lock owner is obviously unavailable to cleanup code.
30
+
31
+ ## Why this rule exists
32
+
33
+ `getReader()` and `getWriter()` lock the stream to the returned reader or writer.
34
+ The lock should be released with `releaseLock()` when the owner is done with the
35
+ stream. If the reader or writer is discarded, later cleanup code cannot release
36
+ that lock.
37
+
38
+ ## Incorrect
39
+
40
+ ```ts
41
+ new ReadableStream<Uint8Array>().getReader();
42
+ ```
43
+
44
+ ```ts
45
+ stream.getReader().read();
46
+ ```
47
+
48
+ ```ts
49
+ stream.getWriter().write(chunk);
50
+ ```
51
+
52
+ ## Correct
53
+
54
+ ```ts
55
+ const reader = stream.getReader();
56
+
57
+ try {
58
+ await reader.read();
59
+ } finally {
60
+ reader.releaseLock();
61
+ }
62
+ ```
63
+
64
+ ```ts
65
+ function createReader(stream: ReadableStream<Uint8Array>) {
66
+ return stream.getReader();
67
+ }
68
+ ```
69
+
70
+ ```ts
71
+ streamReaderRegistry.add(stream.getReader());
72
+ ```
73
+
74
+ ## Behavior and migration notes
75
+
76
+ This rule is type-aware and requires parser services. Enable it through a
77
+ type-checked preset or configure `parserOptions.projectService` yourself.
78
+
79
+ This rule does not autofix. Rewriting `stream.getReader().read()` into a
80
+ retained reader requires a surrounding `try`/`finally` cleanup shape, which is
81
+ too context-dependent for a safe automatic fix.
82
+
83
+ ## ESLint flat config example
84
+
85
+ ```js
86
+ import runtimeCleanup from "eslint-plugin-runtime-cleanup";
87
+
88
+ export default [
89
+ runtimeCleanup.configs["recommended-type-checked"],
90
+ ];
91
+ ```
92
+
93
+ ## When not to use it
94
+
95
+ Do not enable this rule in JavaScript-only projects without TypeScript parser
96
+ services. For code that intentionally locks a stream for the entire process
97
+ lifetime, use a narrow disable comment and document that ownership boundary.
98
+
99
+ ## Further reading
100
+
101
+ - [MDN: `ReadableStream.getReader()`](https://developer.mozilla.org/docs/Web/API/ReadableStream/getReader)
102
+ - [MDN: `ReadableStreamDefaultReader.releaseLock()`](https://developer.mozilla.org/docs/Web/API/ReadableStreamDefaultReader/releaseLock)
103
+ - [MDN: `WritableStream.getWriter()`](https://developer.mozilla.org/docs/Web/API/WritableStream/getWriter)
104
+ - [MDN: `WritableStreamDefaultWriter.releaseLock()`](https://developer.mozilla.org/docs/Web/API/WritableStreamDefaultWriter/releaseLock)
105
+
@@ -0,0 +1,123 @@
1
+ # no-floating-workers
2
+
3
+ Require worker handles to be retained so they can be terminated during cleanup.
4
+
5
+ > **Rule catalog ID:** R004
6
+
7
+ ## Targeted pattern scope
8
+
9
+ This rule targets worker constructors whose active thread or shared worker
10
+ connection should have an explicit lifecycle owner:
11
+
12
+ - `Worker`
13
+ - `SharedWorker`
14
+ - `window.Worker`, `self.Worker`, and `globalThis.Worker`
15
+ - `window.SharedWorker`, `self.SharedWorker`, and `globalThis.SharedWorker`
16
+ - `Worker` imported from `node:worker_threads` or `worker_threads`
17
+
18
+ The rule reports worker instances that are immediately discarded or chained
19
+ directly into a method call other than `.terminate()`. In both cases there is no
20
+ remaining worker handle available for teardown.
21
+
22
+ ## What this rule reports
23
+
24
+ The rule reports:
25
+
26
+ - standalone worker construction expressions such as `new Worker("./worker.js");`
27
+ - voided worker construction such as `void new SharedWorker("./worker.js");`
28
+ - immediate worker method chains such as
29
+ `new Worker("./worker.js").postMessage("start");`
30
+ - discarded Node.js `worker_threads` workers imported as `Worker`
31
+
32
+ It intentionally does not require same-function `terminate()` calls. Ownership
33
+ can be transferred to a component instance, resource manager, returned
34
+ disposable, `using` declaration, or longer-lived runtime owner.
35
+
36
+ ## Why this rule exists
37
+
38
+ Workers run independently from the creating script. Browser `Worker` instances
39
+ can be stopped with `terminate()`, and Node.js `worker_threads.Worker`
40
+ instances expose `terminate()` and `Symbol.asyncDispose`. If the worker handle is
41
+ not retained, later cleanup cannot reliably stop the work or release the owning
42
+ runtime resource.
43
+
44
+ `SharedWorker` instances are intentionally shared across same-origin browsing
45
+ contexts, but the creating page still needs a retained handle for its port and
46
+ ownership bookkeeping. Discarding the handle makes that lifecycle implicit.
47
+
48
+ ## Incorrect
49
+
50
+ ```ts
51
+ new Worker("./worker.js");
52
+ ```
53
+
54
+ ```ts
55
+ void new SharedWorker("./shared-worker.js");
56
+ ```
57
+
58
+ ```ts
59
+ new Worker("./worker.js").postMessage("start");
60
+ ```
61
+
62
+ ```ts
63
+ import { Worker } from "node:worker_threads";
64
+
65
+ new Worker("./worker.js");
66
+ ```
67
+
68
+ ## Correct
69
+
70
+ ```ts
71
+ const worker = new Worker("./worker.js");
72
+
73
+ worker.postMessage("start");
74
+ worker.terminate();
75
+ ```
76
+
77
+ ```ts
78
+ return new Worker("./worker.js");
79
+ ```
80
+
81
+ ```ts
82
+ registerWorker(new SharedWorker("./shared-worker.js"));
83
+ ```
84
+
85
+ ```ts
86
+ import { Worker } from "node:worker_threads";
87
+
88
+ await using worker = new Worker("./worker.js");
89
+ ```
90
+
91
+ ## Behavior and migration notes
92
+
93
+ Store worker instances in the lifecycle owner that will stop or dispose them.
94
+ For UI components, that is usually the component setup scope or a disposable
95
+ collection. For shared libraries, returning the worker or passing it to a
96
+ dedicated resource manager keeps ownership explicit.
97
+
98
+ This rule does not autofix. Choosing the owner and termination point is a
99
+ semantic decision, and inserting a variable without a matching `terminate()` or
100
+ disposal path would hide the lifecycle problem instead of fixing it.
101
+
102
+ ## ESLint flat config example
103
+
104
+ ```js
105
+ import runtimeCleanup from "eslint-plugin-runtime-cleanup";
106
+
107
+ export default [
108
+ runtimeCleanup.configs.recommended,
109
+ ];
110
+ ```
111
+
112
+ ## When not to use it
113
+
114
+ Do not enable this rule for code that intentionally creates page-lifetime or
115
+ process-lifetime workers and does not need an explicit cleanup owner. Prefer a
116
+ narrow disable comment with a reason when a worker is meant to live for the
117
+ whole runtime.
118
+
119
+ ## Further reading
120
+
121
+ - [MDN: `Worker.terminate()`](https://developer.mozilla.org/docs/Web/API/Worker/terminate)
122
+ - [MDN: `SharedWorker`](https://developer.mozilla.org/docs/Web/API/SharedWorker)
123
+ - [Node.js: `worker_threads.Worker`](https://nodejs.org/api/worker_threads.html#class-worker)
@@ -0,0 +1,143 @@
1
+ # no-unmanaged-event-listeners
2
+
3
+ Require event listeners to have an abort signal or a matching cleanup call.
4
+
5
+ > **Rule catalog ID:** R002
6
+
7
+ ## Targeted pattern scope
8
+
9
+ This rule targets `EventTarget#addEventListener(...)` calls where the listener
10
+ registration has no visible cleanup path.
11
+
12
+ The rule accepts two cleanup models:
13
+
14
+ - passing an options object with a `signal` property, so an `AbortController`
15
+ owns listener teardown;
16
+ - or calling `removeEventListener(...)` with the same target, event type,
17
+ listener, and capture mode in the same function or program boundary.
18
+
19
+ ## What this rule reports
20
+
21
+ The rule reports `addEventListener(...)` calls when both of these are true:
22
+
23
+ - the third argument does not resolve to an object with a `signal` property;
24
+ - and no matching `removeEventListener(...)` call exists in the same lexical
25
+ boundary.
26
+
27
+ The same-boundary requirement is intentional. Cleanup in a different function is
28
+ often real, but matching cross-function ownership without framework knowledge is
29
+ too noisy for a syntax-only rule.
30
+
31
+ ## Capture matching
32
+
33
+ `removeEventListener(...)` only removes the original listener when the capture
34
+ mode matches. This rule tracks the common capture forms:
35
+
36
+ - no options argument, which is treated as `false`;
37
+ - boolean options such as `true`;
38
+ - object options such as `{ capture: true }`.
39
+
40
+ Opaque option values are only considered a match when the same option expression
41
+ is passed to both calls.
42
+
43
+ ## Why this rule exists
44
+
45
+ Listeners keep callbacks and their captured state alive. In browser code, that
46
+ can retain component state after unmount. In long-lived services, repeated
47
+ registration without teardown creates duplicate work and memory leaks.
48
+
49
+ An abort signal is usually the clearest ownership model for modern event
50
+ targets. A matching `removeEventListener(...)` call is still valid when the
51
+ lifecycle boundary is small and obvious.
52
+
53
+ ## Incorrect
54
+
55
+ ```ts
56
+ button.addEventListener("click", handleClick);
57
+ ```
58
+
59
+ ```ts
60
+ window.addEventListener("resize", () => layout());
61
+ ```
62
+
63
+ ```ts
64
+ target.addEventListener("scroll", onScroll, true);
65
+ target.removeEventListener("scroll", onScroll, false);
66
+ ```
67
+
68
+ ```ts
69
+ function setup() {
70
+ window.addEventListener("resize", onResize);
71
+ }
72
+
73
+ function cleanup() {
74
+ window.removeEventListener("resize", onResize);
75
+ }
76
+ ```
77
+
78
+ ## Correct
79
+
80
+ ```ts
81
+ const controller = new AbortController();
82
+
83
+ button.addEventListener("click", handleClick, {
84
+ signal: controller.signal,
85
+ });
86
+
87
+ controller.abort();
88
+ ```
89
+
90
+ ```ts
91
+ button.addEventListener("click", handleClick);
92
+ button.removeEventListener("click", handleClick);
93
+ ```
94
+
95
+ ```ts
96
+ target.addEventListener("scroll", onScroll, { capture: true });
97
+ target.removeEventListener("scroll", onScroll, { capture: true });
98
+ ```
99
+
100
+ ```ts
101
+ function setup() {
102
+ window.addEventListener("resize", onResize);
103
+
104
+ return () => {
105
+ window.removeEventListener("resize", onResize);
106
+ };
107
+ }
108
+ ```
109
+
110
+ ## Behavior and migration notes
111
+
112
+ Prefer an `AbortController` when listener ownership belongs to a component,
113
+ request, disposable object, or other lifecycle boundary that may later own
114
+ multiple resources.
115
+
116
+ Use `removeEventListener(...)` when the add/remove pair is intentionally local
117
+ and the same callback reference is available. Inline callbacks without a signal
118
+ are reported because there is no stable callback reference to remove later.
119
+
120
+ This rule does not autofix because choosing the right cleanup lifetime is a
121
+ semantic decision.
122
+
123
+ ## ESLint flat config example
124
+
125
+ ```js
126
+ import runtimeCleanup from "eslint-plugin-runtime-cleanup";
127
+
128
+ export default [
129
+ runtimeCleanup.configs.recommended,
130
+ ];
131
+ ```
132
+
133
+ ## When not to use it
134
+
135
+ Do not enable this rule for code that intentionally registers process-lifetime
136
+ or page-lifetime listeners. Prefer a narrow disable comment with a reason when
137
+ the listener is meant to live for the whole runtime.
138
+
139
+ ## Further reading
140
+
141
+ - [MDN: `addEventListener`](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
142
+ - [MDN: `removeEventListener`](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
143
+ - [MDN: `AbortController`](https://developer.mozilla.org/docs/Web/API/AbortController)
@@ -0,0 +1,44 @@
1
+ # Rules overview
2
+
3
+ `eslint-plugin-runtime-cleanup` rules target runtime resource lifetimes that are
4
+ easy to leak when allocation and teardown drift apart.
5
+
6
+ ## Stable rules
7
+
8
+ - [`no-floating-timers`](./no-floating-timers.md) requires timer handles to be
9
+ retained so they can be cleared during cleanup.
10
+ - [`no-unmanaged-event-listeners`](./no-unmanaged-event-listeners.md) requires
11
+ event listeners to use an `AbortSignal` option or a matching
12
+ `removeEventListener` cleanup call.
13
+ - [`no-floating-observers`](./no-floating-observers.md) requires native
14
+ observer instances to be retained so they can be disconnected during cleanup.
15
+ - [`no-floating-workers`](./no-floating-workers.md) requires worker handles to
16
+ be retained so they can be terminated during cleanup.
17
+ - [`no-floating-child-processes`](./no-floating-child-processes.md) requires
18
+ child process handles to be retained so they can be killed during cleanup.
19
+
20
+ Future rules should continue to target explicit runtime resource lifetimes,
21
+ including timers, listeners, observers, abort controllers, workers, streams,
22
+ child processes, and disposable handles.
23
+
24
+ ## Rule authoring expectations
25
+
26
+ Runtime cleanup rules should be conservative:
27
+
28
+ - report only resource allocation patterns with a clear cleanup obligation
29
+ - avoid whole-file heuristics that create noisy false positives
30
+ - use type information only when it materially improves precision
31
+ - prefer suggestions over autofixes when cleanup placement is ambiguous
32
+ - document the exact lifecycle pattern the rule expects
33
+
34
+ ## Presets
35
+
36
+ The preset pages describe the exported config keys and are ready for future
37
+ rules:
38
+
39
+ - [`minimal`](./presets/minimal.md)
40
+ - [`recommended`](./presets/recommended.md)
41
+ - [`recommended-type-checked`](./presets/recommended-type-checked.md)
42
+ - [`strict`](./presets/strict.md)
43
+ - [`all`](./presets/all.md)
44
+ - [`experimental`](./presets/experimental.md)
@@ -0,0 +1,35 @@
1
+ # all
2
+
3
+ `runtime-cleanup.configs.all` is reserved for every stable runtime-cleanup rule.
4
+
5
+ ## Rules in this preset
6
+
7
+ This preset enables the following rules.
8
+
9
+ - `Fix` legend:
10
+ - `fix` = autofixable
11
+ - `suggest` = suggestions available
12
+ - `-` = report only
13
+
14
+ | Rule | Fix |
15
+ | --- | :-: |
16
+ | [`no-floating-abort-controllers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-abort-controllers) | - |
17
+ | [`no-floating-audio-contexts`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-audio-contexts) | - |
18
+ | [`no-floating-broadcast-channels`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-broadcast-channels) | - |
19
+ | [`no-floating-child-processes`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-child-processes) | - |
20
+ | [`no-floating-disposable-stacks`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-disposable-stacks) | - |
21
+ | [`no-floating-file-watchers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-file-watchers) | - |
22
+ | [`no-floating-geolocation-watches`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-geolocation-watches) | - |
23
+ | [`no-floating-infinite-animations`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-infinite-animations) | - |
24
+ | [`no-floating-media-streams`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-media-streams) | - |
25
+ | [`no-floating-message-channels`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-message-channels) | - |
26
+ | [`no-floating-network-connections`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-network-connections) | - |
27
+ | [`no-floating-object-urls`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-object-urls) | - |
28
+ | [`no-floating-observers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-observers) | - |
29
+ | [`no-floating-servers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-servers) | - |
30
+ | [`no-floating-streams`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-streams) | - |
31
+ | [`no-floating-timers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-timers) | - |
32
+ | [`no-floating-wake-locks`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-wake-locks) | - |
33
+ | [`no-floating-web-stream-locks`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-web-stream-locks) | - |
34
+ | [`no-floating-workers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-workers) | - |
35
+ | [`no-unmanaged-event-listeners`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-unmanaged-event-listeners) | - |
@@ -0,0 +1,44 @@
1
+ # experimental
2
+
3
+ `runtime-cleanup.configs.experimental` is reserved for cleanup rules that still
4
+ need production feedback on precision, performance, or fix safety.
5
+
6
+ ## Rules in this preset
7
+
8
+ No experimental rules are currently enabled by this preset.
9
+
10
+ - `Fix` legend:
11
+ - `fix` = autofixable
12
+ - `suggest` = suggestions available
13
+ - `-` = report only
14
+
15
+ ### Experimental additions over `all`
16
+
17
+ | Rule | Fix |
18
+ | --- | :-: |
19
+ | - | - |
20
+
21
+ ### Baseline rules inherited from `all`
22
+
23
+ | Rule | Fix |
24
+ | --- | :-: |
25
+ | [`no-floating-abort-controllers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-abort-controllers) | - |
26
+ | [`no-floating-audio-contexts`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-audio-contexts) | - |
27
+ | [`no-floating-broadcast-channels`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-broadcast-channels) | - |
28
+ | [`no-floating-child-processes`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-child-processes) | - |
29
+ | [`no-floating-disposable-stacks`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-disposable-stacks) | - |
30
+ | [`no-floating-file-watchers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-file-watchers) | - |
31
+ | [`no-floating-geolocation-watches`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-geolocation-watches) | - |
32
+ | [`no-floating-infinite-animations`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-infinite-animations) | - |
33
+ | [`no-floating-media-streams`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-media-streams) | - |
34
+ | [`no-floating-message-channels`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-message-channels) | - |
35
+ | [`no-floating-network-connections`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-network-connections) | - |
36
+ | [`no-floating-object-urls`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-object-urls) | - |
37
+ | [`no-floating-observers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-observers) | - |
38
+ | [`no-floating-servers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-servers) | - |
39
+ | [`no-floating-streams`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-streams) | - |
40
+ | [`no-floating-timers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-timers) | - |
41
+ | [`no-floating-wake-locks`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-wake-locks) | - |
42
+ | [`no-floating-web-stream-locks`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-web-stream-locks) | - |
43
+ | [`no-floating-workers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-workers) | - |
44
+ | [`no-unmanaged-event-listeners`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-unmanaged-event-listeners) | - |
@@ -0,0 +1,54 @@
1
+ # Presets
2
+
3
+ `eslint-plugin-runtime-cleanup` exposes stable flat-config presets so consumers
4
+ can adopt the package shape before concrete rules are published.
5
+
6
+ ## Preset list
7
+
8
+ | Preset | Type information | Intended use |
9
+ | --- | :-: | --- |
10
+ | `runtime-cleanup.configs.minimal` | No | Lowest-noise cleanup rules. |
11
+ | `runtime-cleanup.configs.recommended` | No | Broadly safe cleanup rules. |
12
+ | `runtime-cleanup.configs["recommended-type-checked"]` | Yes | Recommended rules that need TypeScript type information. |
13
+ | `runtime-cleanup.configs.strict` | No | Stronger cleanup enforcement. |
14
+ | `runtime-cleanup.configs.all` | No | All stable rules. |
15
+ | `runtime-cleanup.configs.experimental` | No | Rules still proving out behavior. |
16
+
17
+ ## Rule matrix
18
+
19
+ Runtime-cleanup rules are listed below. Each rule documents the exact resource-lifetime pattern it enforces.
20
+
21
+ - `Fix` legend:
22
+ - `fix` = autofixable
23
+ - `suggest` = suggestions available
24
+ - `-` = report only
25
+ - `Preset key` legend:
26
+ - [M](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/minimal) - [`runtime-cleanup.configs.minimal`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/minimal)
27
+ - [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) - [`runtime-cleanup.configs.recommended`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended)
28
+ - [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) - [`runtime-cleanup.configs["recommended-type-checked"]`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked)
29
+ - [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) - [`runtime-cleanup.configs.strict`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict)
30
+ - [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) - [`runtime-cleanup.configs.all`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all)
31
+ - [E](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/experimental) - [`runtime-cleanup.configs.experimental`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/experimental)
32
+
33
+ | Rule | Fix | Preset key |
34
+ | --- | :-: | :-- |
35
+ | [`no-floating-abort-controllers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-abort-controllers) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
36
+ | [`no-floating-audio-contexts`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-audio-contexts) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
37
+ | [`no-floating-broadcast-channels`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-broadcast-channels) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
38
+ | [`no-floating-child-processes`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-child-processes) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
39
+ | [`no-floating-disposable-stacks`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-disposable-stacks) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
40
+ | [`no-floating-file-watchers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-file-watchers) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
41
+ | [`no-floating-geolocation-watches`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-geolocation-watches) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
42
+ | [`no-floating-infinite-animations`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-infinite-animations) | - | [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
43
+ | [`no-floating-media-streams`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-media-streams) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
44
+ | [`no-floating-message-channels`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-message-channels) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
45
+ | [`no-floating-network-connections`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-network-connections) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
46
+ | [`no-floating-object-urls`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-object-urls) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
47
+ | [`no-floating-observers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-observers) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
48
+ | [`no-floating-servers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-servers) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
49
+ | [`no-floating-streams`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-streams) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
50
+ | [`no-floating-timers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-timers) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
51
+ | [`no-floating-wake-locks`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-wake-locks) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
52
+ | [`no-floating-web-stream-locks`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-web-stream-locks) | - | [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
53
+ | [`no-floating-workers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-workers) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
54
+ | [`no-unmanaged-event-listeners`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-unmanaged-event-listeners) | - | [R](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended) [T](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/recommended-type-checked) [S](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/strict) [A](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/presets/all) |
@@ -0,0 +1,17 @@
1
+ # minimal
2
+
3
+ `runtime-cleanup.configs.minimal` is reserved for the lowest-noise runtime
4
+ cleanup rules.
5
+
6
+ ## Rules in this preset
7
+
8
+ No rules are currently enabled by this preset.
9
+
10
+ - `Fix` legend:
11
+ - `fix` = autofixable
12
+ - `suggest` = suggestions available
13
+ - `-` = report only
14
+
15
+ | Rule | Fix |
16
+ | --- | :-: |
17
+ | - | - |
@@ -0,0 +1,43 @@
1
+ # recommended-type-checked
2
+
3
+ `runtime-cleanup.configs["recommended-type-checked"]` is reserved for
4
+ recommended cleanup rules that need TypeScript parser services.
5
+
6
+ ## Rules in this preset
7
+
8
+ This preset enables recommended rules and any type-aware recommended additions.
9
+
10
+ - `Fix` legend:
11
+ - `fix` = autofixable
12
+ - `suggest` = suggestions available
13
+ - `-` = report only
14
+
15
+ ### Type-aware additions over `recommended`
16
+
17
+ | Rule | Fix |
18
+ | --- | :-: |
19
+ | [`no-floating-infinite-animations`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-infinite-animations) | - |
20
+ | [`no-floating-web-stream-locks`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-web-stream-locks) | - |
21
+
22
+ ### Baseline rules inherited from `recommended`
23
+
24
+ | Rule | Fix |
25
+ | --- | :-: |
26
+ | [`no-floating-abort-controllers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-abort-controllers) | - |
27
+ | [`no-floating-audio-contexts`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-audio-contexts) | - |
28
+ | [`no-floating-broadcast-channels`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-broadcast-channels) | - |
29
+ | [`no-floating-child-processes`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-child-processes) | - |
30
+ | [`no-floating-disposable-stacks`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-disposable-stacks) | - |
31
+ | [`no-floating-file-watchers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-file-watchers) | - |
32
+ | [`no-floating-geolocation-watches`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-geolocation-watches) | - |
33
+ | [`no-floating-media-streams`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-media-streams) | - |
34
+ | [`no-floating-message-channels`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-message-channels) | - |
35
+ | [`no-floating-network-connections`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-network-connections) | - |
36
+ | [`no-floating-object-urls`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-object-urls) | - |
37
+ | [`no-floating-observers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-observers) | - |
38
+ | [`no-floating-servers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-servers) | - |
39
+ | [`no-floating-streams`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-streams) | - |
40
+ | [`no-floating-timers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-timers) | - |
41
+ | [`no-floating-wake-locks`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-wake-locks) | - |
42
+ | [`no-floating-workers`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-floating-workers) | - |
43
+ | [`no-unmanaged-event-listeners`](https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/no-unmanaged-event-listeners) | - |