@jupyter/eslint-plugin 1.1.0 → 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.
- package/lib/index.d.ts +30 -1
- package/lib/index.js +24 -5
- package/lib/rules/galata-prefer-menu-helper.d.ts +6 -0
- package/lib/rules/galata-prefer-menu-helper.js +478 -0
- package/lib/rules/galata-prefer-notebook-cell-helper.d.ts +6 -0
- package/lib/rules/galata-prefer-notebook-cell-helper.js +403 -0
- package/lib/rules/galata-prefer-sidebar-activity-helper.d.ts +6 -0
- package/lib/rules/galata-prefer-sidebar-activity-helper.js +332 -0
- package/lib/rules/no-schema-enum.d.ts +1 -1
- package/lib/rules/no-schema-enum.js +54 -2
- package/lib/rules/prefer-lazy-imports.d.ts +6 -0
- package/lib/rules/prefer-lazy-imports.js +308 -0
- package/lib/utils/lazy-imports.d.ts +70 -0
- package/lib/utils/lazy-imports.js +515 -0
- package/lib/utils/module-size.d.ts +12 -0
- package/lib/utils/module-size.js +240 -0
- package/lib/utils/playwright-selectors.d.ts +41 -5
- package/lib/utils/playwright-selectors.js +125 -12
- package/lib/utils/plugin-utils.d.ts +18 -0
- package/lib/utils/plugin-utils.js +127 -19
- package/lib/utils/shared-packages.d.ts +9 -0
- package/lib/utils/shared-packages.js +138 -0
- package/lib/utils/signal-lifetime.js +66 -5
- package/package.json +1 -1
|
@@ -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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
90
|
-
|
|
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
|
+
}
|
|
@@ -64,6 +64,8 @@ exports.DEFAULT_LONG_LIVED_TYPES = [
|
|
|
64
64
|
'ILabShell',
|
|
65
65
|
'ILanguageServerManager',
|
|
66
66
|
'IRenderMimeRegistry',
|
|
67
|
+
'ISessionConnection',
|
|
68
|
+
'ISessionContext',
|
|
67
69
|
'ISettingRegistry',
|
|
68
70
|
'IShell',
|
|
69
71
|
'IStateDB',
|
|
@@ -354,8 +356,8 @@ function classHasDisposalProtocol(classNode) {
|
|
|
354
356
|
}
|
|
355
357
|
return false;
|
|
356
358
|
}
|
|
357
|
-
/** Resolves the symbol
|
|
358
|
-
function
|
|
359
|
+
/** Resolves the symbol of an expression's static type, if available. */
|
|
360
|
+
function typeSymbolOf(node, context) {
|
|
359
361
|
const { checker, services } = context;
|
|
360
362
|
if (!checker || !services || !services.esTreeNodeToTSNodeMap) {
|
|
361
363
|
return null;
|
|
@@ -385,12 +387,71 @@ function typeNameOf(node, context) {
|
|
|
385
387
|
// Keep the un-aliased symbol.
|
|
386
388
|
}
|
|
387
389
|
}
|
|
388
|
-
return symbol
|
|
390
|
+
return symbol;
|
|
389
391
|
}
|
|
390
392
|
catch {
|
|
391
393
|
return null;
|
|
392
394
|
}
|
|
393
395
|
}
|
|
396
|
+
/** Resolves the symbol name of an expression's static type, if available. */
|
|
397
|
+
function typeNameOf(node, context) {
|
|
398
|
+
const symbol = typeSymbolOf(node, context);
|
|
399
|
+
return symbol ? symbol.getName() : null;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* The namespace path of an expression's static type, outermost first:
|
|
403
|
+
* `ISessionConnection` declared in `namespace Session` comes back as
|
|
404
|
+
* `['Session', 'ISessionConnection']`.
|
|
405
|
+
*/
|
|
406
|
+
function typeNamePathOf(node, context) {
|
|
407
|
+
const symbol = typeSymbolOf(node, context);
|
|
408
|
+
if (!symbol || !context.checker) {
|
|
409
|
+
return [];
|
|
410
|
+
}
|
|
411
|
+
let qualified;
|
|
412
|
+
try {
|
|
413
|
+
qualified = context.checker.getFullyQualifiedName(symbol);
|
|
414
|
+
}
|
|
415
|
+
catch {
|
|
416
|
+
return [symbol.getName()];
|
|
417
|
+
}
|
|
418
|
+
// A module-scoped symbol is qualified by its quoted specifier, which may
|
|
419
|
+
// itself contain dots (`"@jupyterlab/services"`, `"./foo.bar"`).
|
|
420
|
+
const withoutModule = qualified.replace(/^(["'])(?:(?!\1).)*\1\.?/, '');
|
|
421
|
+
const segments = (withoutModule || qualified).split('.').filter(Boolean);
|
|
422
|
+
return segments.length > 0 ? segments : [symbol.getName()];
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* The `longLivedTypes` entry matching this expression's static type, or null.
|
|
426
|
+
*
|
|
427
|
+
* An entry matches when it is a suffix of the type's namespace path, so
|
|
428
|
+
* `Session.ISessionConnection` and a bare `ISessionConnection` both match
|
|
429
|
+
* `Session.ISessionConnection` while `Session.ISessionConnection` does not
|
|
430
|
+
* match some unrelated top-level `ISessionConnection`. When several entries
|
|
431
|
+
* match, the longest wins: a list carrying both `IContext` and
|
|
432
|
+
* `DocumentRegistry.IContext` reports the qualified one regardless of the order
|
|
433
|
+
* they were configured in.
|
|
434
|
+
*/
|
|
435
|
+
function matchLongLivedType(node, context) {
|
|
436
|
+
const path = typeNamePathOf(node, context);
|
|
437
|
+
if (path.length === 0) {
|
|
438
|
+
return null;
|
|
439
|
+
}
|
|
440
|
+
let best = null;
|
|
441
|
+
let bestLength = 0;
|
|
442
|
+
for (const entry of context.longLivedTypes) {
|
|
443
|
+
const wanted = entry.split('.').filter(Boolean);
|
|
444
|
+
if (wanted.length <= bestLength || wanted.length > path.length) {
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
const offset = path.length - wanted.length;
|
|
448
|
+
if (wanted.every((segment, i) => segment === path[offset + i])) {
|
|
449
|
+
best = entry;
|
|
450
|
+
bestLength = wanted.length;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
return best;
|
|
454
|
+
}
|
|
394
455
|
function isWidgetTyped(node, context) {
|
|
395
456
|
const { checker, services } = context;
|
|
396
457
|
if (!checker || !services || !services.esTreeNodeToTSNodeMap) {
|
|
@@ -608,8 +669,8 @@ function isLongLivedService(chain, context) {
|
|
|
608
669
|
// configured entry) is not matched against itself.
|
|
609
670
|
const start = chain.root?.type === 'ThisExpression' ? 1 : 0;
|
|
610
671
|
for (let i = start; i < chain.prefixes.length; i++) {
|
|
611
|
-
const name =
|
|
612
|
-
if (!name
|
|
672
|
+
const name = matchLongLivedType(chain.prefixes[i], context);
|
|
673
|
+
if (!name) {
|
|
613
674
|
continue;
|
|
614
675
|
}
|
|
615
676
|
let blocked = false;
|
package/package.json
CHANGED