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.
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +117 -0
- package/dist/_internal/ast-node.d.ts +19 -0
- package/dist/_internal/ast-node.d.ts.map +1 -0
- package/dist/_internal/ast-node.js +42 -0
- package/dist/_internal/ast-node.js.map +1 -0
- package/dist/_internal/bounded-cache.d.ts +37 -0
- package/dist/_internal/bounded-cache.d.ts.map +1 -0
- package/dist/_internal/bounded-cache.js +63 -0
- package/dist/_internal/bounded-cache.js.map +1 -0
- package/dist/_internal/cycle-safe-linked-search.d.ts +48 -0
- package/dist/_internal/cycle-safe-linked-search.d.ts.map +1 -0
- package/dist/_internal/cycle-safe-linked-search.js +70 -0
- package/dist/_internal/cycle-safe-linked-search.js.map +1 -0
- package/dist/_internal/expression-boolean-memoizer.d.ts +17 -0
- package/dist/_internal/expression-boolean-memoizer.d.ts.map +1 -0
- package/dist/_internal/expression-boolean-memoizer.js +22 -0
- package/dist/_internal/expression-boolean-memoizer.js.map +1 -0
- package/dist/_internal/filter-callback.d.ts +52 -0
- package/dist/_internal/filter-callback.d.ts.map +1 -0
- package/dist/_internal/filter-callback.js +108 -0
- package/dist/_internal/filter-callback.js.map +1 -0
- package/dist/_internal/floating-resource.d.ts +29 -0
- package/dist/_internal/floating-resource.d.ts.map +1 -0
- package/dist/_internal/floating-resource.js +114 -0
- package/dist/_internal/floating-resource.js.map +1 -0
- package/dist/_internal/member-call.d.ts +53 -0
- package/dist/_internal/member-call.d.ts.map +1 -0
- package/dist/_internal/member-call.js +61 -0
- package/dist/_internal/member-call.js.map +1 -0
- package/dist/_internal/normalize-expression-text.d.ts +21 -0
- package/dist/_internal/normalize-expression-text.d.ts.map +1 -0
- package/dist/_internal/normalize-expression-text.js +186 -0
- package/dist/_internal/normalize-expression-text.js.map +1 -0
- package/dist/_internal/nullish-comparison.d.ts +44 -0
- package/dist/_internal/nullish-comparison.d.ts.map +1 -0
- package/dist/_internal/nullish-comparison.js +162 -0
- package/dist/_internal/nullish-comparison.js.map +1 -0
- package/dist/_internal/plugin-settings.d.ts +30 -0
- package/dist/_internal/plugin-settings.d.ts.map +1 -0
- package/dist/_internal/plugin-settings.js +90 -0
- package/dist/_internal/plugin-settings.js.map +1 -0
- package/dist/_internal/report-adapter.d.ts +24 -0
- package/dist/_internal/report-adapter.d.ts.map +1 -0
- package/dist/_internal/report-adapter.js +35 -0
- package/dist/_internal/report-adapter.js.map +1 -0
- package/dist/_internal/rule-catalog.d.ts +47 -0
- package/dist/_internal/rule-catalog.d.ts.map +1 -0
- package/dist/_internal/rule-catalog.js +97 -0
- package/dist/_internal/rule-catalog.js.map +1 -0
- package/dist/_internal/rule-docs-metadata.d.ts +35 -0
- package/dist/_internal/rule-docs-metadata.d.ts.map +1 -0
- package/dist/_internal/rule-docs-metadata.js +172 -0
- package/dist/_internal/rule-docs-metadata.js.map +1 -0
- package/dist/_internal/rule-docs-url.d.ts +15 -0
- package/dist/_internal/rule-docs-url.d.ts.map +1 -0
- package/dist/_internal/rule-docs-url.js +15 -0
- package/dist/_internal/rule-docs-url.js.map +1 -0
- package/dist/_internal/rules-registry.d.ts +11 -0
- package/dist/_internal/rules-registry.d.ts.map +1 -0
- package/dist/_internal/rules-registry.js +53 -0
- package/dist/_internal/rules-registry.js.map +1 -0
- package/dist/_internal/runtime-cleanup-config-references.d.ts +38 -0
- package/dist/_internal/runtime-cleanup-config-references.d.ts.map +1 -0
- package/dist/_internal/runtime-cleanup-config-references.js +78 -0
- package/dist/_internal/runtime-cleanup-config-references.js.map +1 -0
- package/dist/_internal/safe-type-operation.d.ts +89 -0
- package/dist/_internal/safe-type-operation.d.ts.map +1 -0
- package/dist/_internal/safe-type-operation.js +147 -0
- package/dist/_internal/safe-type-operation.js.map +1 -0
- package/dist/_internal/scope-variable.d.ts +17 -0
- package/dist/_internal/scope-variable.d.ts.map +1 -0
- package/dist/_internal/scope-variable.js +30 -0
- package/dist/_internal/scope-variable.js.map +1 -0
- package/dist/_internal/type-checker.d.ts +11 -0
- package/dist/_internal/type-checker.d.ts.map +1 -0
- package/dist/_internal/type-checker.js +25 -0
- package/dist/_internal/type-checker.js.map +1 -0
- package/dist/_internal/type-predicate-autofix-safety.d.ts +16 -0
- package/dist/_internal/type-predicate-autofix-safety.d.ts.map +1 -0
- package/dist/_internal/type-predicate-autofix-safety.js +54 -0
- package/dist/_internal/type-predicate-autofix-safety.js.map +1 -0
- package/dist/_internal/type-reference-node.d.ts +23 -0
- package/dist/_internal/type-reference-node.d.ts.map +1 -0
- package/dist/_internal/type-reference-node.js +41 -0
- package/dist/_internal/type-reference-node.js.map +1 -0
- package/dist/_internal/typed-rule.d.ts +91 -0
- package/dist/_internal/typed-rule.d.ts.map +1 -0
- package/dist/_internal/typed-rule.js +121 -0
- package/dist/_internal/typed-rule.js.map +1 -0
- package/dist/_internal/value-rewrite-autofix-safety.d.ts +29 -0
- package/dist/_internal/value-rewrite-autofix-safety.d.ts.map +1 -0
- package/dist/_internal/value-rewrite-autofix-safety.js +108 -0
- package/dist/_internal/value-rewrite-autofix-safety.js.map +1 -0
- package/dist/plugin.cjs +3693 -0
- package/dist/plugin.cjs.map +7 -0
- package/dist/plugin.d.cts +75 -0
- package/dist/plugin.d.ts +75 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +223 -0
- package/dist/plugin.js.map +1 -0
- package/dist/rules/no-floating-abort-controllers.d.ts +9 -0
- package/dist/rules/no-floating-abort-controllers.d.ts.map +1 -0
- package/dist/rules/no-floating-abort-controllers.js +144 -0
- package/dist/rules/no-floating-abort-controllers.js.map +1 -0
- package/dist/rules/no-floating-audio-contexts.d.ts +9 -0
- package/dist/rules/no-floating-audio-contexts.d.ts.map +1 -0
- package/dist/rules/no-floating-audio-contexts.js +95 -0
- package/dist/rules/no-floating-audio-contexts.js.map +1 -0
- package/dist/rules/no-floating-broadcast-channels.d.ts +9 -0
- package/dist/rules/no-floating-broadcast-channels.d.ts.map +1 -0
- package/dist/rules/no-floating-broadcast-channels.js +151 -0
- package/dist/rules/no-floating-broadcast-channels.js.map +1 -0
- package/dist/rules/no-floating-child-processes.d.ts +9 -0
- package/dist/rules/no-floating-child-processes.d.ts.map +1 -0
- package/dist/rules/no-floating-child-processes.js +259 -0
- package/dist/rules/no-floating-child-processes.js.map +1 -0
- package/dist/rules/no-floating-disposable-stacks.d.ts +9 -0
- package/dist/rules/no-floating-disposable-stacks.d.ts.map +1 -0
- package/dist/rules/no-floating-disposable-stacks.js +177 -0
- package/dist/rules/no-floating-disposable-stacks.js.map +1 -0
- package/dist/rules/no-floating-file-watchers.d.ts +9 -0
- package/dist/rules/no-floating-file-watchers.d.ts.map +1 -0
- package/dist/rules/no-floating-file-watchers.js +241 -0
- package/dist/rules/no-floating-file-watchers.js.map +1 -0
- package/dist/rules/no-floating-geolocation-watches.d.ts +9 -0
- package/dist/rules/no-floating-geolocation-watches.d.ts.map +1 -0
- package/dist/rules/no-floating-geolocation-watches.js +156 -0
- package/dist/rules/no-floating-geolocation-watches.js.map +1 -0
- package/dist/rules/no-floating-infinite-animations.d.ts +9 -0
- package/dist/rules/no-floating-infinite-animations.d.ts.map +1 -0
- package/dist/rules/no-floating-infinite-animations.js +131 -0
- package/dist/rules/no-floating-infinite-animations.js.map +1 -0
- package/dist/rules/no-floating-media-streams.d.ts +9 -0
- package/dist/rules/no-floating-media-streams.d.ts.map +1 -0
- package/dist/rules/no-floating-media-streams.js +175 -0
- package/dist/rules/no-floating-media-streams.js.map +1 -0
- package/dist/rules/no-floating-message-channels.d.ts +9 -0
- package/dist/rules/no-floating-message-channels.d.ts.map +1 -0
- package/dist/rules/no-floating-message-channels.js +150 -0
- package/dist/rules/no-floating-message-channels.js.map +1 -0
- package/dist/rules/no-floating-network-connections.d.ts +9 -0
- package/dist/rules/no-floating-network-connections.d.ts.map +1 -0
- package/dist/rules/no-floating-network-connections.js +170 -0
- package/dist/rules/no-floating-network-connections.js.map +1 -0
- package/dist/rules/no-floating-object-urls.d.ts +9 -0
- package/dist/rules/no-floating-object-urls.d.ts.map +1 -0
- package/dist/rules/no-floating-object-urls.js +83 -0
- package/dist/rules/no-floating-object-urls.js.map +1 -0
- package/dist/rules/no-floating-observers.d.ts +9 -0
- package/dist/rules/no-floating-observers.d.ts.map +1 -0
- package/dist/rules/no-floating-observers.js +160 -0
- package/dist/rules/no-floating-observers.js.map +1 -0
- package/dist/rules/no-floating-servers.d.ts +9 -0
- package/dist/rules/no-floating-servers.d.ts.map +1 -0
- package/dist/rules/no-floating-servers.js +282 -0
- package/dist/rules/no-floating-servers.js.map +1 -0
- package/dist/rules/no-floating-streams.d.ts +9 -0
- package/dist/rules/no-floating-streams.d.ts.map +1 -0
- package/dist/rules/no-floating-streams.js +222 -0
- package/dist/rules/no-floating-streams.js.map +1 -0
- package/dist/rules/no-floating-timers.d.ts +9 -0
- package/dist/rules/no-floating-timers.d.ts.map +1 -0
- package/dist/rules/no-floating-timers.js +145 -0
- package/dist/rules/no-floating-timers.js.map +1 -0
- package/dist/rules/no-floating-wake-locks.d.ts +9 -0
- package/dist/rules/no-floating-wake-locks.d.ts.map +1 -0
- package/dist/rules/no-floating-wake-locks.js +159 -0
- package/dist/rules/no-floating-wake-locks.js.map +1 -0
- package/dist/rules/no-floating-web-stream-locks.d.ts +9 -0
- package/dist/rules/no-floating-web-stream-locks.d.ts.map +1 -0
- package/dist/rules/no-floating-web-stream-locks.js +87 -0
- package/dist/rules/no-floating-web-stream-locks.js.map +1 -0
- package/dist/rules/no-floating-workers.d.ts +9 -0
- package/dist/rules/no-floating-workers.d.ts.map +1 -0
- package/dist/rules/no-floating-workers.js +185 -0
- package/dist/rules/no-floating-workers.js.map +1 -0
- package/dist/rules/no-unmanaged-event-listeners.d.ts +9 -0
- package/dist/rules/no-unmanaged-event-listeners.d.ts.map +1 -0
- package/dist/rules/no-unmanaged-event-listeners.js +210 -0
- package/dist/rules/no-unmanaged-event-listeners.js.map +1 -0
- package/docs/rules/getting-started.md +29 -0
- package/docs/rules/guides/adoption-checklist.md +31 -0
- package/docs/rules/guides/preset-selection-strategy.md +24 -0
- package/docs/rules/guides/rollout-and-fix-safety.md +42 -0
- package/docs/rules/guides/snapshot-testing.md +20 -0
- package/docs/rules/guides/type-aware-linting-readiness.md +20 -0
- package/docs/rules/no-floating-abort-controllers.md +126 -0
- package/docs/rules/no-floating-audio-contexts.md +104 -0
- package/docs/rules/no-floating-broadcast-channels.md +105 -0
- package/docs/rules/no-floating-child-processes.md +123 -0
- package/docs/rules/no-floating-disposable-stacks.md +118 -0
- package/docs/rules/no-floating-file-watchers.md +111 -0
- package/docs/rules/no-floating-geolocation-watches.md +95 -0
- package/docs/rules/no-floating-infinite-animations.md +110 -0
- package/docs/rules/no-floating-media-streams.md +113 -0
- package/docs/rules/no-floating-message-channels.md +114 -0
- package/docs/rules/no-floating-network-connections.md +116 -0
- package/docs/rules/no-floating-object-urls.md +102 -0
- package/docs/rules/no-floating-observers.md +108 -0
- package/docs/rules/no-floating-servers.md +127 -0
- package/docs/rules/no-floating-streams.md +120 -0
- package/docs/rules/no-floating-timers.md +120 -0
- package/docs/rules/no-floating-wake-locks.md +109 -0
- package/docs/rules/no-floating-web-stream-locks.md +105 -0
- package/docs/rules/no-floating-workers.md +123 -0
- package/docs/rules/no-unmanaged-event-listeners.md +143 -0
- package/docs/rules/overview.md +44 -0
- package/docs/rules/presets/all.md +35 -0
- package/docs/rules/presets/experimental.md +44 -0
- package/docs/rules/presets/index.md +54 -0
- package/docs/rules/presets/minimal.md +17 -0
- package/docs/rules/presets/recommended-type-checked.md +43 -0
- package/docs/rules/presets/recommended.md +34 -0
- package/docs/rules/presets/strict.md +36 -0
- package/package.json +323 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { createRuleDocsUrl } from "./rule-docs-url.js";
|
|
2
|
+
import { isRuntimeCleanupConfigReference, runtimeCleanupConfigReferenceToName, } from "./runtime-cleanup-config-references.js";
|
|
3
|
+
const RULE_ID_PREFIX = "R";
|
|
4
|
+
const RULE_ID_LENGTH = 4;
|
|
5
|
+
const RULE_ID_DIGIT_START_INDEX = 1;
|
|
6
|
+
const ASCII_ZERO_CODE_POINT = 48;
|
|
7
|
+
const ASCII_NINE_CODE_POINT = 57;
|
|
8
|
+
/**
|
|
9
|
+
* Guard dynamic rule ids to the canonical `R###` identifier contract.
|
|
10
|
+
*/
|
|
11
|
+
const isRuleIdInCanonicalFormat = (value) => {
|
|
12
|
+
if (value.length !== RULE_ID_LENGTH || !value.startsWith(RULE_ID_PREFIX)) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
for (const character of value.slice(RULE_ID_DIGIT_START_INDEX)) {
|
|
16
|
+
const codePoint = character.codePointAt(0);
|
|
17
|
+
if (codePoint === undefined) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
if (codePoint < ASCII_ZERO_CODE_POINT ||
|
|
21
|
+
codePoint > ASCII_NINE_CODE_POINT) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Guard dynamic values to object-shaped records.
|
|
29
|
+
*/
|
|
30
|
+
const isUnknownRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31
|
+
/**
|
|
32
|
+
* Convert rule docs `runtimeCleanupConfigs` into a normalized, deduped
|
|
33
|
+
* reference list.
|
|
34
|
+
*/
|
|
35
|
+
const normalizeRuntimeCleanupConfigReferences = (ruleName, runtimeCleanupConfigs) => {
|
|
36
|
+
const candidates = typeof runtimeCleanupConfigs === "string"
|
|
37
|
+
? [runtimeCleanupConfigs]
|
|
38
|
+
: [...runtimeCleanupConfigs];
|
|
39
|
+
const references = [];
|
|
40
|
+
for (const candidate of candidates) {
|
|
41
|
+
if (!isRuntimeCleanupConfigReference(candidate)) {
|
|
42
|
+
throw new TypeError(`Rule '${ruleName}' has invalid docs.runtimeCleanupConfigs reference '${String(candidate)}'.`);
|
|
43
|
+
}
|
|
44
|
+
if (references.includes(candidate)) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
references.push(candidate);
|
|
48
|
+
}
|
|
49
|
+
if (references.length === 0) {
|
|
50
|
+
throw new TypeError(`Rule '${ruleName}' must declare at least one docs.runtimeCleanupConfigs reference.`);
|
|
51
|
+
}
|
|
52
|
+
return references;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Validate and narrow dynamic `meta.docs` values to the plugin docs contract.
|
|
56
|
+
*/
|
|
57
|
+
const getRuleDocsContract = (ruleName, docs) => {
|
|
58
|
+
if (!isUnknownRecord(docs)) {
|
|
59
|
+
throw new TypeError(`Rule '${ruleName}' must declare meta.docs.`);
|
|
60
|
+
}
|
|
61
|
+
const description = docs["description"];
|
|
62
|
+
const recommended = docs["recommended"];
|
|
63
|
+
const requiresTypeChecking = docs["requiresTypeChecking"];
|
|
64
|
+
const ruleId = docs["ruleId"];
|
|
65
|
+
const ruleNumber = docs["ruleNumber"];
|
|
66
|
+
const runtimeCleanupConfigs = docs["runtimeCleanupConfigs"];
|
|
67
|
+
const url = docs["url"];
|
|
68
|
+
if (typeof description !== "string" || description.trim().length === 0) {
|
|
69
|
+
throw new TypeError(`Rule '${ruleName}' must declare a non-empty docs.description.`);
|
|
70
|
+
}
|
|
71
|
+
if (typeof url !== "string" || url.trim().length === 0) {
|
|
72
|
+
throw new TypeError(`Rule '${ruleName}' must declare a non-empty docs.url.`);
|
|
73
|
+
}
|
|
74
|
+
const expectedRuleDocsUrl = createRuleDocsUrl(ruleName);
|
|
75
|
+
if (url !== expectedRuleDocsUrl) {
|
|
76
|
+
throw new TypeError(`Rule '${ruleName}' must declare docs.url as '${expectedRuleDocsUrl}'.`);
|
|
77
|
+
}
|
|
78
|
+
if (typeof recommended !== "boolean") {
|
|
79
|
+
throw new TypeError(`Rule '${ruleName}' must declare boolean docs.recommended.`);
|
|
80
|
+
}
|
|
81
|
+
if (typeof requiresTypeChecking !== "boolean") {
|
|
82
|
+
throw new TypeError(`Rule '${ruleName}' must declare boolean docs.requiresTypeChecking.`);
|
|
83
|
+
}
|
|
84
|
+
if (typeof ruleId !== "string" ||
|
|
85
|
+
!isRuleIdInCanonicalFormat(ruleId) ||
|
|
86
|
+
ruleId.trim().length === 0) {
|
|
87
|
+
throw new TypeError(`Rule '${ruleName}' must declare docs.ruleId using the 'R###' format.`);
|
|
88
|
+
}
|
|
89
|
+
if (typeof ruleNumber !== "number" ||
|
|
90
|
+
!Number.isInteger(ruleNumber) ||
|
|
91
|
+
ruleNumber < 1) {
|
|
92
|
+
throw new TypeError(`Rule '${ruleName}' must declare positive integer docs.ruleNumber.`);
|
|
93
|
+
}
|
|
94
|
+
if (typeof runtimeCleanupConfigs === "string") {
|
|
95
|
+
if (!isRuntimeCleanupConfigReference(runtimeCleanupConfigs)) {
|
|
96
|
+
throw new TypeError(`Rule '${ruleName}' has invalid docs.runtimeCleanupConfigs reference '${runtimeCleanupConfigs}'.`);
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
description,
|
|
100
|
+
recommended,
|
|
101
|
+
requiresTypeChecking,
|
|
102
|
+
ruleId,
|
|
103
|
+
ruleNumber,
|
|
104
|
+
runtimeCleanupConfigs,
|
|
105
|
+
url,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
if (!Array.isArray(runtimeCleanupConfigs)) {
|
|
109
|
+
throw new TypeError(`Rule '${ruleName}' must declare docs.runtimeCleanupConfigs as a preset reference or array.`);
|
|
110
|
+
}
|
|
111
|
+
for (const candidate of runtimeCleanupConfigs) {
|
|
112
|
+
if (typeof candidate !== "string" ||
|
|
113
|
+
!isRuntimeCleanupConfigReference(candidate)) {
|
|
114
|
+
throw new TypeError(`Rule '${ruleName}' has invalid docs.runtimeCleanupConfigs reference '${String(candidate)}'.`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return {
|
|
118
|
+
description,
|
|
119
|
+
recommended,
|
|
120
|
+
requiresTypeChecking,
|
|
121
|
+
ruleId,
|
|
122
|
+
ruleNumber,
|
|
123
|
+
runtimeCleanupConfigs,
|
|
124
|
+
url,
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Derive normalized docs metadata for all plugin rules.
|
|
129
|
+
*/
|
|
130
|
+
export const deriveRuleDocsMetadataByName = (rules) => {
|
|
131
|
+
const metadataByRuleName = {};
|
|
132
|
+
for (const [ruleName, ruleModule] of Object.entries(rules)) {
|
|
133
|
+
const ruleDocs = getRuleDocsContract(ruleName, ruleModule.meta.docs);
|
|
134
|
+
const runtimeCleanupConfigReferences = normalizeRuntimeCleanupConfigReferences(ruleName, ruleDocs.runtimeCleanupConfigs);
|
|
135
|
+
const runtimeCleanupConfigNames = runtimeCleanupConfigReferences.map((reference) => runtimeCleanupConfigReferenceToName[reference]);
|
|
136
|
+
metadataByRuleName[ruleName] = {
|
|
137
|
+
description: ruleDocs.description,
|
|
138
|
+
recommended: ruleDocs.recommended,
|
|
139
|
+
requiresTypeChecking: ruleDocs.requiresTypeChecking,
|
|
140
|
+
ruleId: ruleDocs.ruleId,
|
|
141
|
+
ruleNumber: ruleDocs.ruleNumber,
|
|
142
|
+
runtimeCleanupConfigNames,
|
|
143
|
+
runtimeCleanupConfigReferences,
|
|
144
|
+
url: ruleDocs.url,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
return metadataByRuleName;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Derive a typed-rule set from normalized docs metadata.
|
|
151
|
+
*/
|
|
152
|
+
export const deriveTypeCheckedRuleNameSet = (ruleDocsMetadataByName) => {
|
|
153
|
+
const ruleNames = [];
|
|
154
|
+
for (const [ruleName, metadata] of Object.entries(ruleDocsMetadataByName)) {
|
|
155
|
+
if (!metadata.requiresTypeChecking) {
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
ruleNames.push(ruleName);
|
|
159
|
+
}
|
|
160
|
+
return new Set(ruleNames);
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Derive canonical preset-membership map from normalized docs metadata.
|
|
164
|
+
*/
|
|
165
|
+
export const deriveRulePresetMembershipByRuleName = (ruleDocsMetadataByName) => {
|
|
166
|
+
const membershipByRuleName = {};
|
|
167
|
+
for (const [ruleName, metadata] of Object.entries(ruleDocsMetadataByName)) {
|
|
168
|
+
membershipByRuleName[ruleName] = metadata.runtimeCleanupConfigNames;
|
|
169
|
+
}
|
|
170
|
+
return membershipByRuleName;
|
|
171
|
+
};
|
|
172
|
+
//# sourceMappingURL=rule-docs-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-docs-metadata.js","sourceRoot":"","sources":["../../src/_internal/rule-docs-metadata.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACH,+BAA+B,EAG/B,mCAAmC,GACtC,MAAM,wCAAwC,CAAC;AAuChD,MAAM,cAAc,GAAG,GAAY,CAAC;AACpC,MAAM,cAAc,GAAG,CAAU,CAAC;AAClC,MAAM,yBAAyB,GAAG,CAAU,CAAC;AAC7C,MAAM,qBAAqB,GAAG,EAAW,CAAC;AAC1C,MAAM,qBAAqB,GAAG,EAAW,CAAC;AAE1C;;GAEG;AACH,MAAM,yBAAyB,GAAG,CAAC,KAAa,EAAW,EAAE;IACzD,IAAI,KAAK,CAAC,MAAM,KAAK,cAAc,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;QACvE,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,KAAK,CAAC,yBAAyB,CAAC,EAAE,CAAC;QAC7D,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAE3C,IAAI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AI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC;YACjC,SAAS;QACb,CAAC;QAED,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAChD,sBAA8C,EAGhD,EAAE;IACA,MAAM,oBAAoB,GAGtB,EAAE,CAAC;IAEP,KAAK,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAC7C,sBAAsB,CACzB,EAAE,CAAC;QACA,oBAAoB,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,yBAAyB,CAAC;IACxE,CAAC;IAED,OAAO,oBAAoB,CAAC;AAChC,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* Canonical rule documentation URL helpers.
|
|
4
|
+
*/
|
|
5
|
+
/** Stable docs host/prefix for generated rule docs links. */
|
|
6
|
+
export declare const RULE_DOCS_URL_BASE: "https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/";
|
|
7
|
+
/**
|
|
8
|
+
* Build the canonical documentation URL for one rule id.
|
|
9
|
+
*
|
|
10
|
+
* @param ruleName - Rule id (for example `require-timer-cleanup`).
|
|
11
|
+
*
|
|
12
|
+
* @returns Canonical docs URL for the rule page.
|
|
13
|
+
*/
|
|
14
|
+
export declare const createRuleDocsUrl: (ruleName: string) => string;
|
|
15
|
+
//# sourceMappingURL=rule-docs-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-docs-url.d.ts","sourceRoot":"","sources":["../../src/_internal/rule-docs-url.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,6DAA6D;AAC7D,eAAO,MAAM,kBAAkB,EAC3B,wEAAiF,CAAC;AAEtF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,KAAG,MACf,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* Canonical rule documentation URL helpers.
|
|
4
|
+
*/
|
|
5
|
+
/** Stable docs host/prefix for generated rule docs links. */
|
|
6
|
+
export const RULE_DOCS_URL_BASE = "https://nick2bad4u.github.io/eslint-plugin-runtime-cleanup/docs/rules/";
|
|
7
|
+
/**
|
|
8
|
+
* Build the canonical documentation URL for one rule id.
|
|
9
|
+
*
|
|
10
|
+
* @param ruleName - Rule id (for example `require-timer-cleanup`).
|
|
11
|
+
*
|
|
12
|
+
* @returns Canonical docs URL for the rule page.
|
|
13
|
+
*/
|
|
14
|
+
export const createRuleDocsUrl = (ruleName) => `${RULE_DOCS_URL_BASE}${ruleName}`;
|
|
15
|
+
//# sourceMappingURL=rule-docs-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-docs-url.js","sourceRoot":"","sources":["../../src/_internal/rule-docs-url.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,6DAA6D;AAC7D,MAAM,CAAC,MAAM,kBAAkB,GAC3B,wEAAiF,CAAC;AAEtF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAU,EAAE,CAC1D,GAAG,kBAAkB,GAAG,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* Canonical runtime registry of all rule modules shipped by eslint-plugin-runtime-cleanup.
|
|
4
|
+
*/
|
|
5
|
+
import type { TSESLint } from "@typescript-eslint/utils";
|
|
6
|
+
/** Runtime rule module shape used by registry/preset builders. */
|
|
7
|
+
export type RuleWithDocs = TSESLint.RuleModule<string, readonly unknown[]>;
|
|
8
|
+
/** Exported typed view consumed by the plugin entrypoint. */
|
|
9
|
+
export declare const runtimeCleanupRules: Readonly<Record<string, RuleWithDocs>>;
|
|
10
|
+
export default runtimeCleanupRules;
|
|
11
|
+
//# sourceMappingURL=rules-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules-registry.d.ts","sourceRoot":"","sources":["../../src/_internal/rules-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAuBzD,kEAAkE;AAClE,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC,CAAC;AA4B3E,6DAA6D;AAC7D,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CACzC,CAAC;AAE/B,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* Canonical runtime registry of all rule modules shipped by eslint-plugin-runtime-cleanup.
|
|
4
|
+
*/
|
|
5
|
+
import noFloatingAbortControllers from "../rules/no-floating-abort-controllers.js";
|
|
6
|
+
import noFloatingAudioContexts from "../rules/no-floating-audio-contexts.js";
|
|
7
|
+
import noFloatingBroadcastChannels from "../rules/no-floating-broadcast-channels.js";
|
|
8
|
+
import noFloatingChildProcesses from "../rules/no-floating-child-processes.js";
|
|
9
|
+
import noFloatingDisposableStacks from "../rules/no-floating-disposable-stacks.js";
|
|
10
|
+
import noFloatingFileWatchers from "../rules/no-floating-file-watchers.js";
|
|
11
|
+
import noFloatingGeolocationWatches from "../rules/no-floating-geolocation-watches.js";
|
|
12
|
+
import noFloatingInfiniteAnimations from "../rules/no-floating-infinite-animations.js";
|
|
13
|
+
import noFloatingMediaStreams from "../rules/no-floating-media-streams.js";
|
|
14
|
+
import noFloatingMessageChannels from "../rules/no-floating-message-channels.js";
|
|
15
|
+
import noFloatingNetworkConnections from "../rules/no-floating-network-connections.js";
|
|
16
|
+
import noFloatingObjectUrls from "../rules/no-floating-object-urls.js";
|
|
17
|
+
import noFloatingObservers from "../rules/no-floating-observers.js";
|
|
18
|
+
import noFloatingServers from "../rules/no-floating-servers.js";
|
|
19
|
+
import noFloatingStreams from "../rules/no-floating-streams.js";
|
|
20
|
+
import noFloatingTimers from "../rules/no-floating-timers.js";
|
|
21
|
+
import noFloatingWakeLocks from "../rules/no-floating-wake-locks.js";
|
|
22
|
+
import noFloatingWebStreamLocks from "../rules/no-floating-web-stream-locks.js";
|
|
23
|
+
import noFloatingWorkers from "../rules/no-floating-workers.js";
|
|
24
|
+
import noUnmanagedEventListeners from "../rules/no-unmanaged-event-listeners.js";
|
|
25
|
+
/**
|
|
26
|
+
* Runtime map of all rule modules keyed by unqualified rule name.
|
|
27
|
+
*/
|
|
28
|
+
const runtimeCleanupRuleRegistry = {
|
|
29
|
+
"no-floating-abort-controllers": noFloatingAbortControllers,
|
|
30
|
+
"no-floating-audio-contexts": noFloatingAudioContexts,
|
|
31
|
+
"no-floating-broadcast-channels": noFloatingBroadcastChannels,
|
|
32
|
+
"no-floating-child-processes": noFloatingChildProcesses,
|
|
33
|
+
"no-floating-disposable-stacks": noFloatingDisposableStacks,
|
|
34
|
+
"no-floating-file-watchers": noFloatingFileWatchers,
|
|
35
|
+
"no-floating-geolocation-watches": noFloatingGeolocationWatches,
|
|
36
|
+
"no-floating-infinite-animations": noFloatingInfiniteAnimations,
|
|
37
|
+
"no-floating-media-streams": noFloatingMediaStreams,
|
|
38
|
+
"no-floating-message-channels": noFloatingMessageChannels,
|
|
39
|
+
"no-floating-network-connections": noFloatingNetworkConnections,
|
|
40
|
+
"no-floating-object-urls": noFloatingObjectUrls,
|
|
41
|
+
"no-floating-observers": noFloatingObservers,
|
|
42
|
+
"no-floating-servers": noFloatingServers,
|
|
43
|
+
"no-floating-streams": noFloatingStreams,
|
|
44
|
+
"no-floating-timers": noFloatingTimers,
|
|
45
|
+
"no-floating-wake-locks": noFloatingWakeLocks,
|
|
46
|
+
"no-floating-web-stream-locks": noFloatingWebStreamLocks,
|
|
47
|
+
"no-floating-workers": noFloatingWorkers,
|
|
48
|
+
"no-unmanaged-event-listeners": noUnmanagedEventListeners,
|
|
49
|
+
};
|
|
50
|
+
/** Exported typed view consumed by the plugin entrypoint. */
|
|
51
|
+
export const runtimeCleanupRules = runtimeCleanupRuleRegistry;
|
|
52
|
+
export default runtimeCleanupRules;
|
|
53
|
+
//# sourceMappingURL=rules-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules-registry.js","sourceRoot":"","sources":["../../src/_internal/rules-registry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,0BAA0B,MAAM,2CAA2C,CAAC;AACnF,OAAO,uBAAuB,MAAM,wCAAwC,CAAC;AAC7E,OAAO,2BAA2B,MAAM,4CAA4C,CAAC;AACrF,OAAO,wBAAwB,MAAM,yCAAyC,CAAC;AAC/E,OAAO,0BAA0B,MAAM,2CAA2C,CAAC;AACnF,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,4BAA4B,MAAM,6CAA6C,CAAC;AACvF,OAAO,4BAA4B,MAAM,6CAA6C,CAAC;AACvF,OAAO,sBAAsB,MAAM,uCAAuC,CAAC;AAC3E,OAAO,yBAAyB,MAAM,0CAA0C,CAAC;AACjF,OAAO,4BAA4B,MAAM,6CAA6C,CAAC;AACvF,OAAO,oBAAoB,MAAM,qCAAqC,CAAC;AACvE,OAAO,mBAAmB,MAAM,mCAAmC,CAAC;AACpE,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAChE,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAChE,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,mBAAmB,MAAM,oCAAoC,CAAC;AACrE,OAAO,wBAAwB,MAAM,0CAA0C,CAAC;AAChF,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAChE,OAAO,yBAAyB,MAAM,0CAA0C,CAAC;AAKjF;;GAEG;AACH,MAAM,0BAA0B,GAA2C;IACvE,+BAA+B,EAAE,0BAA0B;IAC3D,4BAA4B,EAAE,uBAAuB;IACrD,gCAAgC,EAAE,2BAA2B;IAC7D,6BAA6B,EAAE,wBAAwB;IACvD,+BAA+B,EAAE,0BAA0B;IAC3D,2BAA2B,EAAE,sBAAsB;IACnD,iCAAiC,EAAE,4BAA4B;IAC/D,iCAAiC,EAAE,4BAA4B;IAC/D,2BAA2B,EAAE,sBAAsB;IACnD,8BAA8B,EAAE,yBAAyB;IACzD,iCAAiC,EAAE,4BAA4B;IAC/D,yBAAyB,EAAE,oBAAoB;IAC/C,uBAAuB,EAAE,mBAAmB;IAC5C,qBAAqB,EAAE,iBAAiB;IACxC,qBAAqB,EAAE,iBAAiB;IACxC,oBAAoB,EAAE,gBAAgB;IACtC,wBAAwB,EAAE,mBAAmB;IAC7C,8BAA8B,EAAE,wBAAwB;IACxD,qBAAqB,EAAE,iBAAiB;IACxC,8BAA8B,EAAE,yBAAyB;CAC5D,CAAC;AAEF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,mBAAmB,GAC5B,0BAA0B,CAAC;AAE/B,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* Shared runtime-cleanup preset/config reference constants and type guards.
|
|
4
|
+
*/
|
|
5
|
+
/** Canonical flat-config preset keys exposed through `plugin.configs`. */
|
|
6
|
+
export declare const runtimeCleanupConfigNames: readonly ["all", "experimental", "minimal", "recommended", "recommended-type-checked", "strict"];
|
|
7
|
+
/** Metadata contract shared across preset wiring, docs, and README rendering. */
|
|
8
|
+
export type RuntimeCleanupConfigMetadata = Readonly<{
|
|
9
|
+
icon: string;
|
|
10
|
+
presetName: `runtime-cleanup:${RuntimeCleanupConfigName}`;
|
|
11
|
+
readmeOrder: number;
|
|
12
|
+
requiresTypeChecking: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
/** Canonical flat-config preset key type exposed through `plugin.configs`. */
|
|
15
|
+
export type RuntimeCleanupConfigName = (typeof runtimeCleanupConfigNames)[number];
|
|
16
|
+
/**
|
|
17
|
+
* Canonical metadata for every exported `runtime-cleanup` preset key.
|
|
18
|
+
*/
|
|
19
|
+
export declare const runtimeCleanupConfigMetadataByName: Readonly<Record<RuntimeCleanupConfigName, RuntimeCleanupConfigMetadata>>;
|
|
20
|
+
/** Stable README legend/rendering order for preset icons. */
|
|
21
|
+
export declare const runtimeCleanupConfigNamesByReadmeOrder: readonly RuntimeCleanupConfigName[];
|
|
22
|
+
/** Metadata references supported in rule `meta.docs.runtimeCleanupConfigs`. */
|
|
23
|
+
export declare const runtimeCleanupConfigReferenceToName: Readonly<{
|
|
24
|
+
"runtime-cleanup.configs.all": "all";
|
|
25
|
+
"runtime-cleanup.configs.experimental": "experimental";
|
|
26
|
+
"runtime-cleanup.configs.minimal": "minimal";
|
|
27
|
+
"runtime-cleanup.configs.recommended": "recommended";
|
|
28
|
+
"runtime-cleanup.configs.recommended-type-checked": "recommended-type-checked";
|
|
29
|
+
"runtime-cleanup.configs.strict": "strict";
|
|
30
|
+
'runtime-cleanup.configs["recommended-type-checked"]': "recommended-type-checked";
|
|
31
|
+
}>;
|
|
32
|
+
/** Fully-qualified preset reference type accepted in rule docs metadata. */
|
|
33
|
+
export type RuntimeCleanupConfigReference = keyof typeof runtimeCleanupConfigReferenceToName;
|
|
34
|
+
/**
|
|
35
|
+
* Check whether a string is a supported rule docs preset reference.
|
|
36
|
+
*/
|
|
37
|
+
export declare const isRuntimeCleanupConfigReference: (value: string) => value is RuntimeCleanupConfigReference;
|
|
38
|
+
//# sourceMappingURL=runtime-cleanup-config-references.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-cleanup-config-references.d.ts","sourceRoot":"","sources":["../../src/_internal/runtime-cleanup-config-references.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0EAA0E;AAC1E,eAAO,MAAM,yBAAyB,kGAO5B,CAAC;AAEX,iFAAiF;AACjF,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CAAC;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,mBAAmB,wBAAwB,EAAE,CAAC;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,OAAO,CAAC;CACjC,CAAC,CAAC;AAEH,8EAA8E;AAC9E,MAAM,MAAM,wBAAwB,GAChC,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,kCAAkC,EAAE,QAAQ,CACrD,MAAM,CAAC,wBAAwB,EAAE,4BAA4B,CAAC,CAsCjE,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,sCAAsC,EAAE,SAAS,wBAAwB,EAQjF,CAAC;AAEN,+EAA+E;AAC/E,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CAAC;IACvD,6BAA6B,EAAE,KAAK,CAAC;IACrC,sCAAsC,EAAE,cAAc,CAAC;IACvD,iCAAiC,EAAE,SAAS,CAAC;IAC7C,qCAAqC,EAAE,aAAa,CAAC;IACrD,kDAAkD,EAAE,0BAA0B,CAAC;IAC/E,gCAAgC,EAAE,QAAQ,CAAC;IAC3C,qDAAqD,EAAE,0BAA0B,CAAC;CACrF,CAUA,CAAC;AAEF,4EAA4E;AAC5E,MAAM,MAAM,6BAA6B,GACrC,MAAM,OAAO,mCAAmC,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,+BAA+B,GACxC,OAAO,MAAM,KACd,KAAK,IAAI,6BACiD,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* Shared runtime-cleanup preset/config reference constants and type guards.
|
|
4
|
+
*/
|
|
5
|
+
/** Canonical flat-config preset keys exposed through `plugin.configs`. */
|
|
6
|
+
export const runtimeCleanupConfigNames = [
|
|
7
|
+
"all",
|
|
8
|
+
"experimental",
|
|
9
|
+
"minimal",
|
|
10
|
+
"recommended",
|
|
11
|
+
"recommended-type-checked",
|
|
12
|
+
"strict",
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* Canonical metadata for every exported `runtime-cleanup` preset key.
|
|
16
|
+
*/
|
|
17
|
+
export const runtimeCleanupConfigMetadataByName = {
|
|
18
|
+
all: {
|
|
19
|
+
icon: "A",
|
|
20
|
+
presetName: "runtime-cleanup:all",
|
|
21
|
+
readmeOrder: 5,
|
|
22
|
+
requiresTypeChecking: true,
|
|
23
|
+
},
|
|
24
|
+
experimental: {
|
|
25
|
+
icon: "E",
|
|
26
|
+
presetName: "runtime-cleanup:experimental",
|
|
27
|
+
readmeOrder: 6,
|
|
28
|
+
requiresTypeChecking: false,
|
|
29
|
+
},
|
|
30
|
+
minimal: {
|
|
31
|
+
icon: "M",
|
|
32
|
+
presetName: "runtime-cleanup:minimal",
|
|
33
|
+
readmeOrder: 1,
|
|
34
|
+
requiresTypeChecking: false,
|
|
35
|
+
},
|
|
36
|
+
recommended: {
|
|
37
|
+
icon: "R",
|
|
38
|
+
presetName: "runtime-cleanup:recommended",
|
|
39
|
+
readmeOrder: 2,
|
|
40
|
+
requiresTypeChecking: false,
|
|
41
|
+
},
|
|
42
|
+
"recommended-type-checked": {
|
|
43
|
+
icon: "T",
|
|
44
|
+
presetName: "runtime-cleanup:recommended-type-checked",
|
|
45
|
+
readmeOrder: 3,
|
|
46
|
+
requiresTypeChecking: true,
|
|
47
|
+
},
|
|
48
|
+
strict: {
|
|
49
|
+
icon: "S",
|
|
50
|
+
presetName: "runtime-cleanup:strict",
|
|
51
|
+
readmeOrder: 4,
|
|
52
|
+
requiresTypeChecking: true,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
/** Stable README legend/rendering order for preset icons. */
|
|
56
|
+
export const runtimeCleanupConfigNamesByReadmeOrder = [
|
|
57
|
+
"minimal",
|
|
58
|
+
"recommended",
|
|
59
|
+
"recommended-type-checked",
|
|
60
|
+
"strict",
|
|
61
|
+
"all",
|
|
62
|
+
"experimental",
|
|
63
|
+
];
|
|
64
|
+
/** Metadata references supported in rule `meta.docs.runtimeCleanupConfigs`. */
|
|
65
|
+
export const runtimeCleanupConfigReferenceToName = {
|
|
66
|
+
"runtime-cleanup.configs.all": "all",
|
|
67
|
+
"runtime-cleanup.configs.experimental": "experimental",
|
|
68
|
+
"runtime-cleanup.configs.minimal": "minimal",
|
|
69
|
+
"runtime-cleanup.configs.recommended": "recommended",
|
|
70
|
+
"runtime-cleanup.configs.recommended-type-checked": "recommended-type-checked",
|
|
71
|
+
"runtime-cleanup.configs.strict": "strict",
|
|
72
|
+
'runtime-cleanup.configs["recommended-type-checked"]': "recommended-type-checked",
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Check whether a string is a supported rule docs preset reference.
|
|
76
|
+
*/
|
|
77
|
+
export const isRuntimeCleanupConfigReference = (value) => Object.hasOwn(runtimeCleanupConfigReferenceToName, value);
|
|
78
|
+
//# sourceMappingURL=runtime-cleanup-config-references.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-cleanup-config-references.js","sourceRoot":"","sources":["../../src/_internal/runtime-cleanup-config-references.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0EAA0E;AAC1E,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACrC,KAAK;IACL,cAAc;IACd,SAAS;IACT,aAAa;IACb,0BAA0B;IAC1B,QAAQ;CACF,CAAC;AAcX;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAE3C;IACA,GAAG,EAAE;QACD,IAAI,EAAE,GAAG;QACT,UAAU,EAAE,qBAAqB;QACjC,WAAW,EAAE,CAAC;QACd,oBAAoB,EAAE,IAAI;KAC7B;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ation
|
|
3
|
+
* Structured error handling for best-effort typed AST operations.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Counter contract used by test-time debug instrumentation.
|
|
7
|
+
*/
|
|
8
|
+
export type SafeTypeOperationCounter<Reason extends string> = Readonly<{
|
|
9
|
+
getSnapshot: () => ReadonlyMap<Reason, number>;
|
|
10
|
+
onFailure: (failure: Readonly<{
|
|
11
|
+
error: unknown;
|
|
12
|
+
reason: Reason;
|
|
13
|
+
}>) => void;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Failure payload emitted when a safe typed operation throws.
|
|
17
|
+
*/
|
|
18
|
+
export type SafeTypeOperationFailure<Reason extends string> = Readonly<{
|
|
19
|
+
error: unknown;
|
|
20
|
+
reason: Reason;
|
|
21
|
+
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Optional observer called whenever an operation fails.
|
|
24
|
+
*/
|
|
25
|
+
export type SafeTypeOperationFailureObserver<Reason extends string> = (failure: Readonly<SafeTypeOperationFailure<Reason>>) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Failure payload emitted when an observer itself throws.
|
|
28
|
+
*/
|
|
29
|
+
export type SafeTypeOperationObserverFailure<Reason extends string> = Readonly<{
|
|
30
|
+
failure: Readonly<SafeTypeOperationFailure<Reason>>;
|
|
31
|
+
observerError: unknown;
|
|
32
|
+
observerKind: "global" | "local";
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* Optional observer called when an operation failure observer throws.
|
|
36
|
+
*/
|
|
37
|
+
export type SafeTypeOperationObserverFailureObserver<Reason extends string> = (failure: Readonly<SafeTypeOperationObserverFailure<Reason>>) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Register a process-local observer for observer failures.
|
|
40
|
+
*
|
|
41
|
+
* @param observer - Callback invoked when a local/global failure observer
|
|
42
|
+
* throws.
|
|
43
|
+
*
|
|
44
|
+
* @returns Unsubscribe callback to remove the observer.
|
|
45
|
+
*/
|
|
46
|
+
export declare const registerSafeTypeOperationObserverFailureObserver: (observer: SafeTypeOperationObserverFailureObserver<string>) => (() => void);
|
|
47
|
+
/**
|
|
48
|
+
* Register a process-local failure observer for typed operations.
|
|
49
|
+
*
|
|
50
|
+
* @param observer - Callback invoked for each operation failure.
|
|
51
|
+
*
|
|
52
|
+
* @returns Unsubscribe callback to remove the observer.
|
|
53
|
+
*/
|
|
54
|
+
export declare const registerSafeTypeOperationFailureObserver: (observer: SafeTypeOperationFailureObserver<string>) => (() => void);
|
|
55
|
+
/**
|
|
56
|
+
* Run one operation with a scoped failure observer that is always cleaned up.
|
|
57
|
+
*
|
|
58
|
+
* @param observer - Observer registered for the operation scope.
|
|
59
|
+
* @param operation - Synchronous operation to execute while observing failures.
|
|
60
|
+
*
|
|
61
|
+
* @returns Return value produced by `operation`.
|
|
62
|
+
*/
|
|
63
|
+
export declare const withSafeTypeOperationFailureObserver: <Result>(observer: SafeTypeOperationFailureObserver<string>, operation: () => Result) => Result;
|
|
64
|
+
/**
|
|
65
|
+
* Result shape for safe typed operations.
|
|
66
|
+
*/
|
|
67
|
+
export type SafeTypeOperationResult<Result, Reason extends string> = Readonly<{
|
|
68
|
+
failure: SafeTypeOperationFailure<Reason>;
|
|
69
|
+
ok: false;
|
|
70
|
+
}> | Readonly<{
|
|
71
|
+
ok: true;
|
|
72
|
+
value: Result;
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* Execute a typed operation with structured failure output instead of throws.
|
|
76
|
+
*/
|
|
77
|
+
export declare const safeTypeOperation: <Result, Reason extends string>({ onFailure, operation, reason, }: Readonly<{
|
|
78
|
+
onFailure?: SafeTypeOperationFailureObserver<Reason>;
|
|
79
|
+
operation: () => Result;
|
|
80
|
+
reason: Reason;
|
|
81
|
+
}>) => SafeTypeOperationResult<Result, Reason>;
|
|
82
|
+
/**
|
|
83
|
+
* Build a lightweight reason counter for debugging operation failures in tests.
|
|
84
|
+
*
|
|
85
|
+
* @param reasonsForTypeInference - Optional typed reason literals used to infer
|
|
86
|
+
* the `Reason` generic without requiring explicit type parameters.
|
|
87
|
+
*/
|
|
88
|
+
export declare const createSafeTypeOperationCounter: <Reason extends string = never>(reasonsForTypeInference?: readonly Reason[]) => SafeTypeOperationCounter<Reason>;
|
|
89
|
+
//# sourceMappingURL=safe-type-operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe-type-operation.d.ts","sourceRoot":"","sources":["../../src/_internal/safe-type-operation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,wBAAwB,CAAC,MAAM,SAAS,MAAM,IAAI,QAAQ,CAAC;IACnE,WAAW,EAAE,MAAM,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,SAAS,EAAE,CACP,OAAO,EAAE,QAAQ,CAAC;QACd,KAAK,EAAE,OAAO,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC,KACD,IAAI,CAAC;CACb,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,wBAAwB,CAAC,MAAM,SAAS,MAAM,IAAI,QAAQ,CAAC;IACnE,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,gCAAgC,CAAC,MAAM,SAAS,MAAM,IAAI,CAClE,OAAO,EAAE,QAAQ,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,KAClD,IAAI,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,gCAAgC,CAAC,MAAM,SAAS,MAAM,IAAI,QAAQ,CAAC;IAC3E,OAAO,EAAE,QAAQ,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAC;IACpD,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,QAAQ,GAAG,OAAO,CAAC;CACpC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,wCAAwC,CAAC,MAA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