@jupyter/eslint-plugin 1.0.1 → 1.2.0

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 (53) hide show
  1. package/lib/index.d.ts +98 -1
  2. package/lib/index.js +61 -11
  3. package/lib/rules/galata-prefer-filebrowser-helper.d.ts +5 -0
  4. package/lib/rules/galata-prefer-filebrowser-helper.js +105 -0
  5. package/lib/rules/galata-prefer-menu-helper.d.ts +6 -0
  6. package/lib/rules/galata-prefer-menu-helper.js +478 -0
  7. package/lib/rules/galata-prefer-notebook-cell-helper.d.ts +6 -0
  8. package/lib/rules/galata-prefer-notebook-cell-helper.js +403 -0
  9. package/lib/rules/galata-prefer-sidebar-activity-helper.d.ts +6 -0
  10. package/lib/rules/galata-prefer-sidebar-activity-helper.js +332 -0
  11. package/lib/rules/incorrect-translator-usage.d.ts +4 -0
  12. package/lib/rules/incorrect-translator-usage.js +208 -0
  13. package/lib/rules/no-dynamic-translation.d.ts +4 -0
  14. package/lib/rules/no-dynamic-translation.js +92 -0
  15. package/lib/rules/no-pageconfig-base-url.d.ts +4 -0
  16. package/lib/rules/no-pageconfig-base-url.js +37 -0
  17. package/lib/rules/no-schema-enum.d.ts +1 -1
  18. package/lib/rules/no-schema-enum.js +54 -2
  19. package/lib/rules/no-translation-concatenation.js +46 -84
  20. package/lib/rules/no-untranslated-string.js +7 -4
  21. package/lib/rules/plugin-activation-args.js +1 -2
  22. package/lib/rules/prefer-lazy-imports.d.ts +6 -0
  23. package/lib/rules/prefer-lazy-imports.js +308 -0
  24. package/lib/rules/prefer-signal-this-arg.d.ts +7 -0
  25. package/lib/rules/prefer-signal-this-arg.js +196 -0
  26. package/lib/rules/require-disposable-ownership.d.ts +5 -0
  27. package/lib/rules/require-disposable-ownership.js +120 -0
  28. package/lib/rules/require-disposable-transfer.d.ts +5 -0
  29. package/lib/rules/require-disposable-transfer.js +223 -0
  30. package/lib/rules/require-signal-cleanup.d.ts +8 -0
  31. package/lib/rules/require-signal-cleanup.js +164 -0
  32. package/lib/rules/require-signal-this-arg.d.ts +5 -0
  33. package/lib/rules/require-signal-this-arg.js +74 -0
  34. package/lib/rules/token-format.js +1 -2
  35. package/lib/utils/disposables.d.ts +64 -0
  36. package/lib/utils/disposables.js +1723 -0
  37. package/lib/utils/lazy-imports.d.ts +70 -0
  38. package/lib/utils/lazy-imports.js +515 -0
  39. package/lib/utils/module-size.d.ts +12 -0
  40. package/lib/utils/module-size.js +240 -0
  41. package/lib/utils/playwright-selectors.d.ts +102 -0
  42. package/lib/utils/playwright-selectors.js +306 -0
  43. package/lib/utils/plugin-utils.d.ts +18 -0
  44. package/lib/utils/plugin-utils.js +127 -19
  45. package/lib/utils/shared-packages.d.ts +9 -0
  46. package/lib/utils/shared-packages.js +138 -0
  47. package/lib/utils/signal-lifetime.d.ts +158 -0
  48. package/lib/utils/signal-lifetime.js +816 -0
  49. package/lib/utils/signals.d.ts +143 -0
  50. package/lib/utils/signals.js +601 -0
  51. package/lib/utils/translation.d.ts +45 -0
  52. package/lib/utils/translation.js +122 -0
  53. package/package.json +9 -2
@@ -43,6 +43,9 @@ exports.getPluginId = getPluginId;
43
43
  exports.extractArrayTokens = extractArrayTokens;
44
44
  exports.isNullableAnnotation = isNullableAnnotation;
45
45
  exports.extractParameterType = extractParameterType;
46
+ exports.typeMentionsJupyterPlugin = typeMentionsJupyterPlugin;
47
+ exports.isCallableProperty = isCallableProperty;
48
+ exports.looksLikePluginObject = looksLikePluginObject;
46
49
  const ts = __importStar(require("typescript"));
47
50
  /**
48
51
  * Gets plugin kind from a variable declaration type annotation.
@@ -68,26 +71,12 @@ function getJupyterPluginKind(node, checker, getTSNode) {
68
71
  }
69
72
  // Slow path: resolve import aliases via the TS checker.
70
73
  if (checker && getTSNode && typeNode.typeName.type === 'Identifier') {
71
- try {
72
- const tsNameNode = getTSNode(typeNode.typeName);
73
- if (tsNameNode) {
74
- const symbol = checker.getSymbolAtLocation(tsNameNode);
75
- if (symbol) {
76
- const resolved = symbol.flags & ts.SymbolFlags.Alias
77
- ? checker.getAliasedSymbol(symbol)
78
- : symbol;
79
- const resolvedName = resolved.getName();
80
- if (resolvedName === 'JupyterFrontEndPlugin') {
81
- return 'frontend';
82
- }
83
- if (resolvedName === 'ServiceManagerPlugin') {
84
- return 'service-manager';
85
- }
86
- }
87
- }
74
+ const resolvedName = resolveTypeAlias(typeNode.typeName, checker, getTSNode);
75
+ if (resolvedName === 'JupyterFrontEndPlugin') {
76
+ return 'frontend';
88
77
  }
89
- catch {
90
- // Fall through if checker/mapper unavailable
78
+ if (resolvedName === 'ServiceManagerPlugin') {
79
+ return 'service-manager';
91
80
  }
92
81
  }
93
82
  return null;
@@ -204,3 +193,122 @@ function extractTypeName(typeName) {
204
193
  }
205
194
  return null;
206
195
  }
196
+ const PLUGIN_TYPE_NAMES = ['JupyterFrontEndPlugin', 'ServiceManagerPlugin'];
197
+ /**
198
+ * Returns true when a type name refers to a JupyterLab plugin type. Only the
199
+ * last segment is compared, so a namespaced spelling such as
200
+ * `Private.JupyterFrontEndPlugin` matches too.
201
+ */
202
+ function isPluginTypeName(name) {
203
+ if (!name) {
204
+ return false;
205
+ }
206
+ const lastSegment = name.split('.').pop() ?? name;
207
+ return PLUGIN_TYPE_NAMES.includes(lastSegment);
208
+ }
209
+ /**
210
+ * Returns true when a type annotation mentions a JupyterLab plugin type at any
211
+ * depth, so arrays, unions and wrappers such as `Promise<...>` are recognised.
212
+ * Resolves import aliases through the TypeScript checker when it is available.
213
+ */
214
+ function typeMentionsJupyterPlugin(typeNode, checker, getTSNode, depth = 0) {
215
+ if (!typeNode || depth > 6) {
216
+ return false;
217
+ }
218
+ switch (typeNode.type) {
219
+ case 'TSTypeReference': {
220
+ if (isPluginTypeName(extractTypeName(typeNode.typeName))) {
221
+ return true;
222
+ }
223
+ if (checker &&
224
+ getTSNode &&
225
+ typeNode.typeName.type === 'Identifier' &&
226
+ isPluginTypeName(resolveTypeAlias(typeNode.typeName, checker, getTSNode))) {
227
+ return true;
228
+ }
229
+ return (typeNode.typeArguments?.params ?? []).some(param => typeMentionsJupyterPlugin(param, checker, getTSNode, depth + 1));
230
+ }
231
+ case 'TSArrayType':
232
+ return typeMentionsJupyterPlugin(typeNode.elementType, checker, getTSNode, depth + 1);
233
+ case 'TSUnionType':
234
+ case 'TSIntersectionType':
235
+ return typeNode.types.some(type => typeMentionsJupyterPlugin(type, checker, getTSNode, depth + 1));
236
+ case 'TSTupleType':
237
+ return typeNode.elementTypes.some(type => typeMentionsJupyterPlugin(type, checker, getTSNode, depth + 1));
238
+ case 'TSTypeOperator':
239
+ case 'TSRestType':
240
+ case 'TSOptionalType':
241
+ return typeMentionsJupyterPlugin(typeNode.typeAnnotation ?? null, checker, getTSNode, depth + 1);
242
+ case 'TSNamedTupleMember':
243
+ return typeMentionsJupyterPlugin(typeNode.elementType, checker, getTSNode, depth + 1);
244
+ default:
245
+ return false;
246
+ }
247
+ }
248
+ /**
249
+ * Resolves an identifier through the TypeScript checker to the name it aliases,
250
+ * e.g. `import { JupyterFrontEndPlugin as JFEP }` gives back the original name.
251
+ */
252
+ function resolveTypeAlias(identifier, checker, getTSNode) {
253
+ try {
254
+ const tsNode = getTSNode(identifier);
255
+ if (!tsNode) {
256
+ return null;
257
+ }
258
+ const symbol = checker.getSymbolAtLocation(tsNode);
259
+ if (!symbol) {
260
+ return null;
261
+ }
262
+ const resolved = symbol.flags & ts.SymbolFlags.Alias
263
+ ? checker.getAliasedSymbol(symbol)
264
+ : symbol;
265
+ return resolved.getName();
266
+ }
267
+ catch {
268
+ return null;
269
+ }
270
+ }
271
+ const PLUGIN_SHAPE_PROPERTIES = [
272
+ 'autoStart',
273
+ 'requires',
274
+ 'optional',
275
+ 'provides',
276
+ 'description'
277
+ ];
278
+ /**
279
+ * Returns true when a property holds something callable: a function written in
280
+ * place, or a name referring to one declared elsewhere.
281
+ */
282
+ function isCallableProperty(property) {
283
+ if (!property) {
284
+ return false;
285
+ }
286
+ switch (property.value.type) {
287
+ case 'FunctionExpression':
288
+ case 'ArrowFunctionExpression':
289
+ case 'Identifier':
290
+ case 'MemberExpression':
291
+ return true;
292
+ default:
293
+ return false;
294
+ }
295
+ }
296
+ /**
297
+ * Returns true when an object literal has the shape of a JupyterLab plugin:
298
+ * a string `id`, an `activate` function, and at least one of the properties
299
+ * which only plugins carry. Used for plugin objects written without a type
300
+ * annotation.
301
+ */
302
+ function looksLikePluginObject(node) {
303
+ const properties = getObjectProperties(node);
304
+ const id = properties.get('id');
305
+ if (!id ||
306
+ id.value.type !== 'Literal' ||
307
+ typeof id.value.value !== 'string') {
308
+ return false;
309
+ }
310
+ if (!isCallableProperty(properties.get('activate'))) {
311
+ return false;
312
+ }
313
+ return PLUGIN_SHAPE_PROPERTIES.some(name => properties.has(name));
314
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Walks up from a linted file to its labextension manifest and returns the
3
+ * packages the application provides at runtime. Importing one of those at the
4
+ * top of a plugin module adds nothing to the extension's own bundle.
5
+ *
6
+ * Returns an empty list when no manifest declares any, which is the common
7
+ * case outside a monorepo sharing packages between its extensions.
8
+ */
9
+ export declare function getHostProvidedPackages(fromFile: string): string[];
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) Jupyter Development Team.
4
+ * Distributed under the terms of the Modified BSD License.
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || (function () {
23
+ var ownKeys = function(o) {
24
+ ownKeys = Object.getOwnPropertyNames || function (o) {
25
+ var ar = [];
26
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
+ return ar;
28
+ };
29
+ return ownKeys(o);
30
+ };
31
+ return function (mod) {
32
+ if (mod && mod.__esModule) return mod;
33
+ var result = {};
34
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
+ __setModuleDefault(result, mod);
36
+ return result;
37
+ };
38
+ })();
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.getHostProvidedPackages = getHostProvidedPackages;
41
+ const fs = __importStar(require("fs"));
42
+ const path = __importStar(require("path"));
43
+ /** How far to look upwards for the labextension manifest. */
44
+ const MAX_LEVELS = 12;
45
+ const manifestCache = new Map();
46
+ /** Directory to the manifest which governs it, or null when there is none. */
47
+ const manifestPathCache = new Map();
48
+ /**
49
+ * Reads the packages which `jupyterlab.sharedPackages` marks as provided by
50
+ * the application rather than bundled here.
51
+ *
52
+ * `@jupyter/builder` turns `bundled: false` into `import: false`, which leaves
53
+ * the package to the host at runtime. Anything else stays in this extension's
54
+ * own bundle: `bundled: true`, an entry with no `bundled` key, and `false`,
55
+ * which removes the package from the shared scope altogether.
56
+ */
57
+ function readManifest(manifestPath) {
58
+ let mtimeMs;
59
+ try {
60
+ mtimeMs = fs.statSync(manifestPath).mtimeMs;
61
+ }
62
+ catch {
63
+ return null;
64
+ }
65
+ const cached = manifestCache.get(manifestPath);
66
+ if (cached && cached.mtimeMs === mtimeMs) {
67
+ return cached;
68
+ }
69
+ let data;
70
+ try {
71
+ data = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
72
+ }
73
+ catch {
74
+ manifestCache.set(manifestPath, null);
75
+ return null;
76
+ }
77
+ const jupyterlab = data.jupyterlab;
78
+ if (!jupyterlab || typeof jupyterlab !== 'object') {
79
+ // Not a labextension manifest, so keep looking further up.
80
+ manifestCache.set(manifestPath, null);
81
+ return null;
82
+ }
83
+ const shared = jupyterlab.sharedPackages ?? {};
84
+ const hostProvided = [];
85
+ for (const [name, entry] of Object.entries(shared)) {
86
+ if (entry &&
87
+ typeof entry === 'object' &&
88
+ entry.bundled === false) {
89
+ hostProvided.push(name);
90
+ }
91
+ }
92
+ const info = { mtimeMs, hostProvided };
93
+ manifestCache.set(manifestPath, info);
94
+ return info;
95
+ }
96
+ /**
97
+ * Walks up from a linted file to its labextension manifest and returns the
98
+ * packages the application provides at runtime. Importing one of those at the
99
+ * top of a plugin module adds nothing to the extension's own bundle.
100
+ *
101
+ * Returns an empty list when no manifest declares any, which is the common
102
+ * case outside a monorepo sharing packages between its extensions.
103
+ */
104
+ function getHostProvidedPackages(fromFile) {
105
+ const start = path.dirname(path.resolve(fromFile));
106
+ const cachedPath = manifestPathCache.get(start);
107
+ if (cachedPath !== undefined) {
108
+ // Re-enter the reader so an edited manifest is picked up.
109
+ return cachedPath === null
110
+ ? []
111
+ : (readManifest(cachedPath)?.hostProvided ?? []);
112
+ }
113
+ const visited = [];
114
+ let found = null;
115
+ let directory = start;
116
+ for (let level = 0; level < MAX_LEVELS; level++) {
117
+ visited.push(directory);
118
+ const manifestPath = path.join(directory, 'package.json');
119
+ if (readManifest(manifestPath)) {
120
+ found = manifestPath;
121
+ break;
122
+ }
123
+ // A repository root bounds the search, so an unrelated manifest further up
124
+ // cannot change what this extension is allowed to import.
125
+ if (fs.existsSync(path.join(directory, '.git'))) {
126
+ break;
127
+ }
128
+ const parent = path.dirname(directory);
129
+ if (parent === directory) {
130
+ break;
131
+ }
132
+ directory = parent;
133
+ }
134
+ for (const seen of visited) {
135
+ manifestPathCache.set(seen, found);
136
+ }
137
+ return found === null ? [] : (readManifest(found)?.hostProvided ?? []);
138
+ }
@@ -0,0 +1,158 @@
1
+ import { TSESTree } from '@typescript-eslint/types';
2
+ import { ParserServices, TSESLint } from '@typescript-eslint/utils';
3
+ import * as ts from 'typescript';
4
+ import { ClassLike } from './signals';
5
+ /**
6
+ * A Lumino connection leaks if and only if the **sender outlives the
7
+ * receiver**. Connections are stored in `WeakMap`s keyed by both sender and
8
+ * receiver, so a sender+receiver island that becomes unreachable together is
9
+ * collected whether or not a `thisArg` was passed.
10
+ *
11
+ * The helpers in this module therefore classify the *sender* rather than
12
+ * looking for absent cleanup on the receiver. Everything defaults to
13
+ * `'unknown'` — the rules only report senders that are positively proven to
14
+ * outlive their receiver.
15
+ */
16
+ export type SenderLifetime =
17
+ /** The sender is the enclosing instance itself (or something it intrinsically owns). */
18
+ 'self'
19
+ /** The enclosing class constructs, adopts, or disposes the sender. */
20
+ | 'owned'
21
+ /** A model/context in an MVC pair whose view is the enclosing class. */
22
+ | 'long-lived-model'
23
+ /** An injected application service from the configured allowlist. */
24
+ | 'long-lived-service'
25
+ /** Not provably anything — never reported. */
26
+ | 'unknown';
27
+ /**
28
+ * Application-lifetime service types. A connection to a signal owned by one of
29
+ * these outlives any per-document or per-widget receiver.
30
+ *
31
+ * Deliberately short and curated. Notably absent: `DocumentRegistry.Context`
32
+ * and `JupyterFrontEnd` — both are routinely *shorter*-lived than the objects
33
+ * that hold them, and including them re-introduces false positives.
34
+ */
35
+ export declare const DEFAULT_LONG_LIVED_TYPES: readonly string[];
36
+ export interface SenderChain {
37
+ /** The expression owning the signal — `a.b` in `a.b.changed.connect(...)`. */
38
+ sender: TSESTree.Expression;
39
+ /** Sub-expressions from the root outward, ending with `sender`. */
40
+ prefixes: TSESTree.Expression[];
41
+ /** Base of the chain, or null when it is not a plain object path. */
42
+ root: TSESTree.ThisExpression | TSESTree.Identifier | null;
43
+ /** Property names from the root to the sender; null for computed access. */
44
+ path: (string | null)[];
45
+ /** True when a call appears in the chain — not a stable object path. */
46
+ hasCall: boolean;
47
+ /** The signal's own property name (`changed`), when statically known. */
48
+ signalName: string | null;
49
+ }
50
+ /**
51
+ * Splits the receiver of a `.connect()` call into the signal name and the
52
+ * object path that owns it. Returns null when the receiver is not a
53
+ * `<object>.<signal>` member expression (a bare `signal.connect(cb)` on a
54
+ * local has no identifiable sender).
55
+ */
56
+ export declare function buildSenderChain(signalExpr: TSESTree.Expression): SenderChain | null;
57
+ /**
58
+ * Per-class facts about member fields, gathered in one pass over the class
59
+ * body. Nested classes are opaque.
60
+ */
61
+ /**
62
+ * One expression the class tears down sender-side. The node is kept alongside
63
+ * its text because names are not unique across scopes: `@jupyterlab/outputarea`
64
+ * has an `output` that is an `IOutputModel` in one loop and an adopted `Widget`
65
+ * in another method, and matching on text alone conflates them.
66
+ */
67
+ export interface TeardownRecord {
68
+ text: string;
69
+ node: TSESTree.Node;
70
+ }
71
+ export interface ClassOwnershipFacts {
72
+ /** Field names (without `#`) the class constructs, adopts, or disposes. */
73
+ ownedFields: Set<string>;
74
+ /**
75
+ * Expressions the class tears down sender-side: `x.dispose()`,
76
+ * `Signal.clearData(x)`, `Signal.disconnectSender(x)`, `parent.addWidget(x)`.
77
+ */
78
+ torndownSenders: TeardownRecord[];
79
+ /** Getter name → the field it forwards to, for `get editor() { return this._editor; }`. */
80
+ getterAliases: Map<string, string>;
81
+ }
82
+ /**
83
+ * Collects, for one class body, which fields it owns and which senders it
84
+ * tears down. Both are *suppression* evidence: any hit means a connection to
85
+ * that sender cannot outlive the receiver, so nothing is reported.
86
+ */
87
+ export declare function collectClassOwnershipFacts(classNode: ClassLike, sourceCode: Readonly<TSESLint.SourceCode>, signalLocalNames: ReadonlySet<string>): ClassOwnershipFacts;
88
+ /**
89
+ * Does this class have somewhere to put a disconnect at all — a `dispose()`
90
+ * method, an `isDisposed` member, or an `implements ...Disposable` clause?
91
+ *
92
+ * A class with no teardown protocol whatsoever is almost always a plugin-scope
93
+ * singleton (`MermaidManager`, `ThemeManager`, `LayoutRestorer`): it is created
94
+ * once in an `activate()` and lives as long as the services it connects to, so
95
+ * the connection never leaks and there is no `dispose()` in which to write the
96
+ * fix. It is indistinguishable, from inside the file, from a genuinely
97
+ * short-lived class that forgot to implement disposal — so both stay silent.
98
+ */
99
+ export declare function classHasDisposalProtocol(classNode: ClassLike): boolean;
100
+ export interface LifetimeContext {
101
+ classNode: ClassLike;
102
+ facts: ClassOwnershipFacts;
103
+ sourceCode: Readonly<TSESLint.SourceCode>;
104
+ scope: TSESLint.Scope.Scope;
105
+ checker: ts.TypeChecker | null;
106
+ services: ParserServices | null;
107
+ longLivedTypes: ReadonlySet<string>;
108
+ }
109
+ export interface SenderAnalysis {
110
+ lifetime: SenderLifetime;
111
+ /** Source text of the sender, for the diagnostic message. */
112
+ senderText: string;
113
+ /** Allowlisted service type name, when `lifetime` is `long-lived-service`. */
114
+ typeName: string | null;
115
+ }
116
+ /**
117
+ * Classifies the sender of a `.connect()` call. Everything that cannot be
118
+ * proven long-lived comes back as `'unknown'`, `'self'`, or `'owned'` — all of
119
+ * which the rules treat as silence.
120
+ */
121
+ export declare function analyzeSender(signalExpr: TSESTree.Expression, context: LifetimeContext): SenderAnalysis;
122
+ export type CallbackShape = 'bound' | 'inline' | 'referenced' | 'opaque';
123
+ /**
124
+ * How a connected callback can be removed later.
125
+ *
126
+ * - `bound`: `fn.bind(this)` allocates a fresh function, so no
127
+ * `disconnect(callback, ...)` can ever match it by identity.
128
+ * - `inline`: an arrow or function expression — same problem, unless the
129
+ * connection carries a `thisArg` that receiver-side cleanup can match.
130
+ * - `referenced`: a stable identifier or member expression, removable by a
131
+ * matching `disconnect()`.
132
+ */
133
+ export declare function classifyCallbackShape(callback: TSESTree.CallExpressionArgument): CallbackShape;
134
+ /**
135
+ * Measure C: is there a `.disconnect()` anywhere in the file that removes this
136
+ * callback?
137
+ *
138
+ * Searches the whole `Program` — including nested arrow functions, returned
139
+ * `DisposableDelegate` bodies and helper closures — and matches on the
140
+ * normalized text of the callback expression rather than on the sender chain.
141
+ * `@jupyterlab/lsp`'s `registerProvider` connects
142
+ * `registration.provider.sessionsChanged` and disconnects
143
+ * `provider.sessionsChanged` with the same `registration.onSessionsChanged`
144
+ * callback; comparing senders misses it, comparing callbacks does not.
145
+ *
146
+ * `arity` is the argument count the disconnect must have to match the connect:
147
+ * Lumino matches on the exact `(signal, slot, thisArg)` triple, so a
148
+ * one-argument `connect(cb)` is only undone by a one-argument
149
+ * `disconnect(cb)`.
150
+ */
151
+ export declare function hasMatchingDisconnect(program: TSESTree.Program, callback: TSESTree.CallExpressionArgument, sourceCode: Readonly<TSESLint.SourceCode>, arity: 1 | 2): boolean;
152
+ /**
153
+ * Measure E: `disposed`-style wiring is cleaned up sender-side — the signal
154
+ * fires exactly as its sender is torn down, and Lumino's own
155
+ * `Widget.dispose()` clears the connection immediately afterwards. This is the
156
+ * pattern the docs recommend, so neither rule may flag it.
157
+ */
158
+ export declare function isSelfTerminatingSignal(chain: SenderChain | null): boolean;