@storm-software/linting-tools 1.85.1 → 1.85.3
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 +14 -0
- package/README.md +1 -1
- package/bin/lint.js +169 -79
- package/package.json +1 -1
- package/src/cli/index.js +169 -79
package/src/cli/index.js
CHANGED
|
@@ -90835,9 +90835,9 @@ var require_source_map_support = __commonJS({
|
|
|
90835
90835
|
}
|
|
90836
90836
|
});
|
|
90837
90837
|
|
|
90838
|
-
// node_modules/.pnpm/typescript@5.5.
|
|
90838
|
+
// node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/typescript.js
|
|
90839
90839
|
var require_typescript = __commonJS({
|
|
90840
|
-
"node_modules/.pnpm/typescript@5.5.
|
|
90840
|
+
"node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/typescript.js"(exports, module) {
|
|
90841
90841
|
/*! *****************************************************************************
|
|
90842
90842
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
90843
90843
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -93092,6 +93092,7 @@ var require_typescript = __commonJS({
|
|
|
93092
93092
|
trace: () => trace2,
|
|
93093
93093
|
tracing: () => tracing,
|
|
93094
93094
|
tracingEnabled: () => tracingEnabled,
|
|
93095
|
+
transferSourceFileChildren: () => transferSourceFileChildren,
|
|
93095
93096
|
transform: () => transform6,
|
|
93096
93097
|
transformClassFields: () => transformClassFields,
|
|
93097
93098
|
transformDeclarations: () => transformDeclarations,
|
|
@@ -93202,7 +93203,7 @@ var require_typescript = __commonJS({
|
|
|
93202
93203
|
});
|
|
93203
93204
|
module2.exports = __toCommonJS2(typescript_exports);
|
|
93204
93205
|
var versionMajorMinor = "5.5";
|
|
93205
|
-
var version4 = "5.5.
|
|
93206
|
+
var version4 = "5.5.4";
|
|
93206
93207
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
93207
93208
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
93208
93209
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -96075,10 +96076,12 @@ ${lanes.join("\n")}
|
|
|
96075
96076
|
if (isNodeLikeSystem()) {
|
|
96076
96077
|
try {
|
|
96077
96078
|
const { performance: performance2 } = __require("perf_hooks");
|
|
96078
|
-
|
|
96079
|
-
|
|
96080
|
-
|
|
96081
|
-
|
|
96079
|
+
if (performance2) {
|
|
96080
|
+
return {
|
|
96081
|
+
shouldWriteNativeEvents: false,
|
|
96082
|
+
performance: performance2
|
|
96083
|
+
};
|
|
96084
|
+
}
|
|
96082
96085
|
} catch {
|
|
96083
96086
|
}
|
|
96084
96087
|
}
|
|
@@ -97223,6 +97226,7 @@ ${lanes.join("\n")}
|
|
|
97223
97226
|
var EmitOnly = /* @__PURE__ */ ((EmitOnly4) => {
|
|
97224
97227
|
EmitOnly4[EmitOnly4["Js"] = 0] = "Js";
|
|
97225
97228
|
EmitOnly4[EmitOnly4["Dts"] = 1] = "Dts";
|
|
97229
|
+
EmitOnly4[EmitOnly4["BuilderSignature"] = 2] = "BuilderSignature";
|
|
97226
97230
|
return EmitOnly4;
|
|
97227
97231
|
})(EmitOnly || {});
|
|
97228
97232
|
var StructureIsReused = /* @__PURE__ */ ((StructureIsReused2) => {
|
|
@@ -103408,6 +103412,7 @@ ${lanes.join("\n")}
|
|
|
103408
103412
|
var tokenFlags;
|
|
103409
103413
|
var commentDirectives;
|
|
103410
103414
|
var skipJsDocLeadingAsterisks = 0;
|
|
103415
|
+
var asteriskSeen = false;
|
|
103411
103416
|
var scriptKind = 0;
|
|
103412
103417
|
var jsDocParsingMode = 0;
|
|
103413
103418
|
setText(text, start, length2);
|
|
@@ -103459,6 +103464,7 @@ ${lanes.join("\n")}
|
|
|
103459
103464
|
resetTokenState,
|
|
103460
103465
|
setTextPos: resetTokenState,
|
|
103461
103466
|
setSkipJsDocLeadingAsterisks,
|
|
103467
|
+
hasLeadingAsterisks,
|
|
103462
103468
|
tryScan,
|
|
103463
103469
|
lookAhead,
|
|
103464
103470
|
scanRange
|
|
@@ -104068,7 +104074,7 @@ ${lanes.join("\n")}
|
|
|
104068
104074
|
function scan3() {
|
|
104069
104075
|
fullStartPos = pos;
|
|
104070
104076
|
tokenFlags = 0;
|
|
104071
|
-
|
|
104077
|
+
asteriskSeen = false;
|
|
104072
104078
|
while (true) {
|
|
104073
104079
|
tokenStart = pos;
|
|
104074
104080
|
if (pos >= end) {
|
|
@@ -105943,6 +105949,9 @@ ${lanes.join("\n")}
|
|
|
105943
105949
|
function setSkipJsDocLeadingAsterisks(skip3) {
|
|
105944
105950
|
skipJsDocLeadingAsterisks += skip3 ? 1 : -1;
|
|
105945
105951
|
}
|
|
105952
|
+
function hasLeadingAsterisks() {
|
|
105953
|
+
return asteriskSeen;
|
|
105954
|
+
}
|
|
105946
105955
|
}
|
|
105947
105956
|
function codePointAt2(s2, i3) {
|
|
105948
105957
|
return s2.codePointAt(i3);
|
|
@@ -107905,7 +107914,7 @@ ${lanes.join("\n")}
|
|
|
107905
107914
|
}
|
|
107906
107915
|
if (isJSDocNode(node) || node.kind === 12) {
|
|
107907
107916
|
return skipTrivia(
|
|
107908
|
-
(sourceFile
|
|
107917
|
+
(sourceFile ?? getSourceFileOfNode(node)).text,
|
|
107909
107918
|
node.pos,
|
|
107910
107919
|
/*stopAfterLineBreak*/
|
|
107911
107920
|
false,
|
|
@@ -107917,13 +107926,14 @@ ${lanes.join("\n")}
|
|
|
107917
107926
|
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
|
|
107918
107927
|
}
|
|
107919
107928
|
if (node.kind === 352) {
|
|
107920
|
-
|
|
107929
|
+
sourceFile ?? (sourceFile = getSourceFileOfNode(node));
|
|
107930
|
+
const first22 = firstOrUndefined(getNodeChildren(node, sourceFile));
|
|
107921
107931
|
if (first22) {
|
|
107922
107932
|
return getTokenPosOfNode(first22, sourceFile, includeJsDoc);
|
|
107923
107933
|
}
|
|
107924
107934
|
}
|
|
107925
107935
|
return skipTrivia(
|
|
107926
|
-
(sourceFile
|
|
107936
|
+
(sourceFile ?? getSourceFileOfNode(node)).text,
|
|
107927
107937
|
node.pos,
|
|
107928
107938
|
/*stopAfterLineBreak*/
|
|
107929
107939
|
false,
|
|
@@ -111526,11 +111536,11 @@ ${lanes.join("\n")}
|
|
|
111526
111536
|
return emitOutputFilePathWithoutExtension + extension;
|
|
111527
111537
|
}
|
|
111528
111538
|
function getDeclarationEmitOutputFilePath(fileName, host) {
|
|
111529
|
-
return getDeclarationEmitOutputFilePathWorker(fileName, host.getCompilerOptions(), host
|
|
111539
|
+
return getDeclarationEmitOutputFilePathWorker(fileName, host.getCompilerOptions(), host);
|
|
111530
111540
|
}
|
|
111531
|
-
function getDeclarationEmitOutputFilePathWorker(fileName, options,
|
|
111541
|
+
function getDeclarationEmitOutputFilePathWorker(fileName, options, host) {
|
|
111532
111542
|
const outputDir = options.declarationDir || options.outDir;
|
|
111533
|
-
const path40 = outputDir ? getSourceFilePathInNewDirWorker(fileName, outputDir,
|
|
111543
|
+
const path40 = outputDir ? getSourceFilePathInNewDirWorker(fileName, outputDir, host.getCurrentDirectory(), host.getCommonSourceDirectory(), (f2) => host.getCanonicalFileName(f2)) : fileName;
|
|
111534
111544
|
const declarationExtension = getDeclarationEmitExtensionForPath(path40);
|
|
111535
111545
|
return removeFileExtension(path40) + declarationExtension;
|
|
111536
111546
|
}
|
|
@@ -120116,7 +120126,7 @@ ${lanes.join("\n")}
|
|
|
120116
120126
|
352
|
|
120117
120127
|
/* SyntaxList */
|
|
120118
120128
|
);
|
|
120119
|
-
|
|
120129
|
+
node._children = children;
|
|
120120
120130
|
return node;
|
|
120121
120131
|
}
|
|
120122
120132
|
function createNotEmittedStatement(original) {
|
|
@@ -123053,17 +123063,43 @@ ${lanes.join("\n")}
|
|
|
123053
123063
|
function isSyntaxList(n2) {
|
|
123054
123064
|
return n2.kind === 352;
|
|
123055
123065
|
}
|
|
123056
|
-
var
|
|
123057
|
-
function getNodeChildren(node) {
|
|
123058
|
-
|
|
123059
|
-
|
|
123066
|
+
var sourceFileToNodeChildren = /* @__PURE__ */ new WeakMap();
|
|
123067
|
+
function getNodeChildren(node, sourceFile) {
|
|
123068
|
+
var _a;
|
|
123069
|
+
const kind = node.kind;
|
|
123070
|
+
if (!isNodeKind(kind)) {
|
|
123071
|
+
return emptyArray;
|
|
123072
|
+
}
|
|
123073
|
+
if (kind === 352) {
|
|
123074
|
+
return node._children;
|
|
123075
|
+
}
|
|
123076
|
+
return (_a = sourceFileToNodeChildren.get(sourceFile)) == null ? void 0 : _a.get(node);
|
|
123060
123077
|
}
|
|
123061
|
-
function setNodeChildren(node, children) {
|
|
123062
|
-
|
|
123078
|
+
function setNodeChildren(node, sourceFile, children) {
|
|
123079
|
+
if (node.kind === 352) {
|
|
123080
|
+
Debug.fail("Should not need to re-set the children of a SyntaxList.");
|
|
123081
|
+
}
|
|
123082
|
+
let map22 = sourceFileToNodeChildren.get(sourceFile);
|
|
123083
|
+
if (map22 === void 0) {
|
|
123084
|
+
map22 = /* @__PURE__ */ new WeakMap();
|
|
123085
|
+
sourceFileToNodeChildren.set(sourceFile, map22);
|
|
123086
|
+
}
|
|
123087
|
+
map22.set(node, children);
|
|
123063
123088
|
return children;
|
|
123064
123089
|
}
|
|
123065
|
-
function unsetNodeChildren(node) {
|
|
123066
|
-
|
|
123090
|
+
function unsetNodeChildren(node, origSourceFile) {
|
|
123091
|
+
var _a;
|
|
123092
|
+
if (node.kind === 352) {
|
|
123093
|
+
Debug.fail("Did not expect to unset the children of a SyntaxList.");
|
|
123094
|
+
}
|
|
123095
|
+
(_a = sourceFileToNodeChildren.get(origSourceFile)) == null ? void 0 : _a.delete(node);
|
|
123096
|
+
}
|
|
123097
|
+
function transferSourceFileChildren(sourceFile, targetSourceFile) {
|
|
123098
|
+
const map22 = sourceFileToNodeChildren.get(sourceFile);
|
|
123099
|
+
if (map22 !== void 0) {
|
|
123100
|
+
sourceFileToNodeChildren.delete(sourceFile);
|
|
123101
|
+
sourceFileToNodeChildren.set(targetSourceFile, map22);
|
|
123102
|
+
}
|
|
123067
123103
|
}
|
|
123068
123104
|
function createEmptyExports(factory2) {
|
|
123069
123105
|
return factory2.createExportDeclaration(
|
|
@@ -126371,7 +126407,7 @@ ${lanes.join("\n")}
|
|
|
126371
126407
|
function createIdentifier(isIdentifier3, diagnosticMessage, privateIdentifierDiagnosticMessage) {
|
|
126372
126408
|
if (isIdentifier3) {
|
|
126373
126409
|
identifierCount++;
|
|
126374
|
-
const pos = getNodePos();
|
|
126410
|
+
const pos = scanner2.hasLeadingAsterisks() ? scanner2.getTokenStart() : getNodePos();
|
|
126375
126411
|
const originalKeywordKind = token();
|
|
126376
126412
|
const text = internIdentifier(scanner2.getTokenValue());
|
|
126377
126413
|
const hasExtendedUnicodeEscape = scanner2.hasExtendedUnicodeEscape();
|
|
@@ -133212,6 +133248,7 @@ ${lanes.join("\n")}
|
|
|
133212
133248
|
aggressiveChecks
|
|
133213
133249
|
);
|
|
133214
133250
|
result.impliedNodeFormat = sourceFile.impliedNodeFormat;
|
|
133251
|
+
transferSourceFileChildren(sourceFile, result);
|
|
133215
133252
|
return result;
|
|
133216
133253
|
}
|
|
133217
133254
|
IncrementalParser2.updateSourceFile = updateSourceFile2;
|
|
@@ -133247,7 +133284,7 @@ ${lanes.join("\n")}
|
|
|
133247
133284
|
}
|
|
133248
133285
|
}
|
|
133249
133286
|
}
|
|
133250
|
-
function moveElementEntirelyPastChangeRange(element, isArray22, delta, oldText, newText, aggressiveChecks) {
|
|
133287
|
+
function moveElementEntirelyPastChangeRange(element, origSourceFile, isArray22, delta, oldText, newText, aggressiveChecks) {
|
|
133251
133288
|
if (isArray22) {
|
|
133252
133289
|
visitArray2(element);
|
|
133253
133290
|
} else {
|
|
@@ -133259,7 +133296,7 @@ ${lanes.join("\n")}
|
|
|
133259
133296
|
if (aggressiveChecks && shouldCheckNode(node)) {
|
|
133260
133297
|
text = oldText.substring(node.pos, node.end);
|
|
133261
133298
|
}
|
|
133262
|
-
unsetNodeChildren(node);
|
|
133299
|
+
unsetNodeChildren(node, origSourceFile);
|
|
133263
133300
|
setTextRangePosEnd(node, node.pos + delta, node.end + delta);
|
|
133264
133301
|
if (aggressiveChecks && shouldCheckNode(node)) {
|
|
133265
133302
|
Debug.assert(text === newText.substring(node.pos, node.end));
|
|
@@ -133333,6 +133370,7 @@ ${lanes.join("\n")}
|
|
|
133333
133370
|
if (child.pos > changeRangeOldEnd) {
|
|
133334
133371
|
moveElementEntirelyPastChangeRange(
|
|
133335
133372
|
child,
|
|
133373
|
+
sourceFile,
|
|
133336
133374
|
/*isArray*/
|
|
133337
133375
|
false,
|
|
133338
133376
|
delta,
|
|
@@ -133345,7 +133383,7 @@ ${lanes.join("\n")}
|
|
|
133345
133383
|
const fullEnd = child.end;
|
|
133346
133384
|
if (fullEnd >= changeStart) {
|
|
133347
133385
|
markAsIntersectingIncrementalChange(child);
|
|
133348
|
-
unsetNodeChildren(child);
|
|
133386
|
+
unsetNodeChildren(child, sourceFile);
|
|
133349
133387
|
adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta);
|
|
133350
133388
|
forEachChild(child, visitNode3, visitArray2);
|
|
133351
133389
|
if (hasJSDocNodes(child)) {
|
|
@@ -133363,6 +133401,7 @@ ${lanes.join("\n")}
|
|
|
133363
133401
|
if (array.pos > changeRangeOldEnd) {
|
|
133364
133402
|
moveElementEntirelyPastChangeRange(
|
|
133365
133403
|
array,
|
|
133404
|
+
sourceFile,
|
|
133366
133405
|
/*isArray*/
|
|
133367
133406
|
true,
|
|
133368
133407
|
delta,
|
|
@@ -134075,7 +134114,6 @@ ${lanes.join("\n")}
|
|
|
134075
134114
|
affectsBuildInfo: true,
|
|
134076
134115
|
showInSimplifiedHelpView: true,
|
|
134077
134116
|
category: Diagnostics.Emit,
|
|
134078
|
-
transpileOptionValue: void 0,
|
|
134079
134117
|
defaultValueDescription: false,
|
|
134080
134118
|
description: Diagnostics.Create_sourcemaps_for_d_ts_files
|
|
134081
134119
|
},
|
|
@@ -134404,6 +134442,7 @@ ${lanes.join("\n")}
|
|
|
134404
134442
|
type: "boolean",
|
|
134405
134443
|
affectsEmit: true,
|
|
134406
134444
|
affectsBuildInfo: true,
|
|
134445
|
+
affectsSourceFile: true,
|
|
134407
134446
|
category: Diagnostics.Emit,
|
|
134408
134447
|
description: Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
|
|
134409
134448
|
defaultValueDescription: false
|
|
@@ -134871,6 +134910,7 @@ ${lanes.join("\n")}
|
|
|
134871
134910
|
affectsEmit: true,
|
|
134872
134911
|
affectsBuildInfo: true,
|
|
134873
134912
|
affectsModuleResolution: true,
|
|
134913
|
+
affectsSourceFile: true,
|
|
134874
134914
|
category: Diagnostics.Language_and_Environment,
|
|
134875
134915
|
description: Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk,
|
|
134876
134916
|
defaultValueDescription: "react"
|
|
@@ -144503,7 +144543,8 @@ ${lanes.join("\n")}
|
|
|
144503
144543
|
isUndefinedIdentifierExpression(node) {
|
|
144504
144544
|
Debug.assert(isExpressionNode(node));
|
|
144505
144545
|
return getSymbolAtLocation(node) === undefinedSymbol;
|
|
144506
|
-
}
|
|
144546
|
+
},
|
|
144547
|
+
isDefinitelyReferenceToGlobalSymbolObject
|
|
144507
144548
|
});
|
|
144508
144549
|
var evaluate = createEvaluator({
|
|
144509
144550
|
evaluateElementAccessExpression,
|
|
@@ -145368,6 +145409,7 @@ ${lanes.join("\n")}
|
|
|
145368
145409
|
};
|
|
145369
145410
|
var amalgamatedDuplicates;
|
|
145370
145411
|
var reverseMappedCache = /* @__PURE__ */ new Map();
|
|
145412
|
+
var reverseHomomorphicMappedCache = /* @__PURE__ */ new Map();
|
|
145371
145413
|
var ambientModulesCache;
|
|
145372
145414
|
var patternAmbientModules;
|
|
145373
145415
|
var patternAmbientModuleAugmentations;
|
|
@@ -145495,6 +145537,21 @@ ${lanes.join("\n")}
|
|
|
145495
145537
|
];
|
|
145496
145538
|
initializeTypeChecker();
|
|
145497
145539
|
return checker;
|
|
145540
|
+
function isDefinitelyReferenceToGlobalSymbolObject(node) {
|
|
145541
|
+
if (!isPropertyAccessExpression(node)) return false;
|
|
145542
|
+
if (!isIdentifier(node.name)) return false;
|
|
145543
|
+
if (!isPropertyAccessExpression(node.expression) && !isIdentifier(node.expression)) return false;
|
|
145544
|
+
if (isIdentifier(node.expression)) {
|
|
145545
|
+
return idText(node.expression) === "Symbol" && getResolvedSymbol(node.expression) === (getGlobalSymbol(
|
|
145546
|
+
"Symbol",
|
|
145547
|
+
111551 | 1048576,
|
|
145548
|
+
/*diagnostic*/
|
|
145549
|
+
void 0
|
|
145550
|
+
) || unknownSymbol);
|
|
145551
|
+
}
|
|
145552
|
+
if (!isIdentifier(node.expression.expression)) return false;
|
|
145553
|
+
return idText(node.expression.name) === "Symbol" && idText(node.expression.expression) === "globalThis" && getResolvedSymbol(node.expression.expression) === globalThisSymbol;
|
|
145554
|
+
}
|
|
145498
145555
|
function getCachedType(key) {
|
|
145499
145556
|
return key ? cachedTypes.get(key) : void 0;
|
|
145500
145557
|
}
|
|
@@ -148884,11 +148941,11 @@ ${lanes.join("\n")}
|
|
|
148884
148941
|
function tryReuseExistingTypeNode(context, typeNode, type2, host2, addUndefined) {
|
|
148885
148942
|
const originalType = type2;
|
|
148886
148943
|
if (addUndefined) {
|
|
148887
|
-
type2 = getOptionalType(type2);
|
|
148944
|
+
type2 = getOptionalType(type2, !isParameter(host2));
|
|
148888
148945
|
}
|
|
148889
148946
|
const clone2 = tryReuseExistingNonParameterTypeNode(context, typeNode, type2, host2);
|
|
148890
148947
|
if (clone2) {
|
|
148891
|
-
if (addUndefined && !someType(getTypeFromTypeNode2(context, typeNode), (t2) => !!(t2.flags & 32768))) {
|
|
148948
|
+
if (addUndefined && containsNonMissingUndefinedType(type2) && !someType(getTypeFromTypeNode2(context, typeNode), (t2) => !!(t2.flags & 32768))) {
|
|
148892
148949
|
return factory.createUnionTypeNode([clone2, factory.createKeywordTypeNode(
|
|
148893
148950
|
157
|
|
148894
148951
|
/* UndefinedKeyword */
|
|
@@ -149874,7 +149931,21 @@ ${lanes.join("\n")}
|
|
|
149874
149931
|
}
|
|
149875
149932
|
function shouldUsePlaceholderForProperty(propertySymbol, context) {
|
|
149876
149933
|
var _a;
|
|
149877
|
-
|
|
149934
|
+
const depth2 = 3;
|
|
149935
|
+
return !!(getCheckFlags(propertySymbol) & 8192) && (contains2(context.reverseMappedStack, propertySymbol) || ((_a = context.reverseMappedStack) == null ? void 0 : _a[0]) && !(getObjectFlags(last(context.reverseMappedStack).links.propertyType) & 16) || isDeeplyNestedReverseMappedTypeProperty());
|
|
149936
|
+
function isDeeplyNestedReverseMappedTypeProperty() {
|
|
149937
|
+
var _a2;
|
|
149938
|
+
if ((((_a2 = context.reverseMappedStack) == null ? void 0 : _a2.length) ?? 0) < depth2) {
|
|
149939
|
+
return false;
|
|
149940
|
+
}
|
|
149941
|
+
for (let i3 = 0; i3 < depth2; i3++) {
|
|
149942
|
+
const prop = context.reverseMappedStack[context.reverseMappedStack.length - 1 - i3];
|
|
149943
|
+
if (prop.links.mappedType.symbol !== propertySymbol.links.mappedType.symbol) {
|
|
149944
|
+
return false;
|
|
149945
|
+
}
|
|
149946
|
+
}
|
|
149947
|
+
return true;
|
|
149948
|
+
}
|
|
149878
149949
|
}
|
|
149879
149950
|
function addPropertyToElementList(propertySymbol, context, typeElements) {
|
|
149880
149951
|
var _a;
|
|
@@ -151078,8 +151149,8 @@ ${lanes.join("\n")}
|
|
|
151078
151149
|
return enclosingDeclaration;
|
|
151079
151150
|
}
|
|
151080
151151
|
function serializeTypeForDeclaration(context, declaration, type2, symbol) {
|
|
151081
|
-
var _a;
|
|
151082
|
-
const
|
|
151152
|
+
var _a, _b;
|
|
151153
|
+
const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration);
|
|
151083
151154
|
const enclosingDeclaration = context.enclosingDeclaration;
|
|
151084
151155
|
const oldFlags = context.flags;
|
|
151085
151156
|
if (declaration && hasInferredType(declaration) && !(context.flags & -2147483648)) {
|
|
@@ -151090,6 +151161,7 @@ ${lanes.join("\n")}
|
|
|
151090
151161
|
const declWithExistingAnnotation = declaration && getNonlocalEffectiveTypeAnnotationNode(declaration) ? declaration : getDeclarationWithTypeAnnotation(symbol);
|
|
151091
151162
|
if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation) && !isGetAccessorDeclaration(declWithExistingAnnotation)) {
|
|
151092
151163
|
const existing = getNonlocalEffectiveTypeAnnotationNode(declWithExistingAnnotation);
|
|
151164
|
+
const addUndefined = addUndefinedForParameter || !!(symbol.flags & 4 && symbol.flags & 16777216 && isOptionalDeclaration(declWithExistingAnnotation) && ((_a = symbol.links) == null ? void 0 : _a.mappedType) && containsNonMissingUndefinedType(type2));
|
|
151093
151165
|
const result2 = !isTypePredicateNode(existing) && tryReuseExistingTypeNode(context, existing, type2, declWithExistingAnnotation, addUndefined);
|
|
151094
151166
|
if (result2) {
|
|
151095
151167
|
context.flags = oldFlags;
|
|
@@ -151100,9 +151172,9 @@ ${lanes.join("\n")}
|
|
|
151100
151172
|
if (type2.flags & 8192 && type2.symbol === symbol && (!context.enclosingDeclaration || some(symbol.declarations, (d3) => getSourceFileOfNode(d3) === getSourceFileOfNode(context.enclosingDeclaration)))) {
|
|
151101
151173
|
context.flags |= 1048576;
|
|
151102
151174
|
}
|
|
151103
|
-
const decl = declaration ?? symbol.valueDeclaration ?? ((
|
|
151175
|
+
const decl = declaration ?? symbol.valueDeclaration ?? ((_b = symbol.declarations) == null ? void 0 : _b[0]);
|
|
151104
151176
|
const expr = decl && isDeclarationWithPossibleInnerTypeNodeReuse(decl) ? getPossibleTypeNodeReuseExpression(decl) : void 0;
|
|
151105
|
-
const result = expressionOrTypeToTypeNode(context, expr, type2,
|
|
151177
|
+
const result = expressionOrTypeToTypeNode(context, expr, type2, addUndefinedForParameter);
|
|
151106
151178
|
context.flags = oldFlags;
|
|
151107
151179
|
return result;
|
|
151108
151180
|
}
|
|
@@ -151144,9 +151216,9 @@ ${lanes.join("\n")}
|
|
|
151144
151216
|
const typePredicate = getTypePredicateOfSignature(signature);
|
|
151145
151217
|
const type2 = getReturnTypeOfSignature(signature);
|
|
151146
151218
|
if (context.enclosingDeclaration && (!isErrorType(type2) || context.flags & 1) && signature.declaration && !nodeIsSynthesized(signature.declaration)) {
|
|
151147
|
-
const annotation =
|
|
151148
|
-
if (annotation
|
|
151149
|
-
const result =
|
|
151219
|
+
const annotation = getNonlocalEffectiveReturnTypeAnnotationNode(signature.declaration);
|
|
151220
|
+
if (annotation) {
|
|
151221
|
+
const result = tryReuseExistingTypeNode(context, annotation, type2, context.enclosingDeclaration);
|
|
151150
151222
|
if (result) {
|
|
151151
151223
|
return result;
|
|
151152
151224
|
}
|
|
@@ -151672,7 +151744,10 @@ ${lanes.join("\n")}
|
|
|
151672
151744
|
);
|
|
151673
151745
|
}
|
|
151674
151746
|
if (isNamedDeclaration(node) && node.name.kind === 167 && !isLateBindableName(node.name)) {
|
|
151675
|
-
if (!
|
|
151747
|
+
if (!hasDynamicName(node)) {
|
|
151748
|
+
return visitEachChild2(node, visitExistingNodeTreeSymbols);
|
|
151749
|
+
}
|
|
151750
|
+
if (!(context.flags & 1 && isEntityNameExpression(node.name.expression) && checkComputedPropertyName(node.name).flags & 1)) {
|
|
151676
151751
|
return void 0;
|
|
151677
151752
|
}
|
|
151678
151753
|
}
|
|
@@ -151805,7 +151880,7 @@ ${lanes.join("\n")}
|
|
|
151805
151880
|
if (result) {
|
|
151806
151881
|
if (result.pos !== -1 || result.end !== -1) {
|
|
151807
151882
|
if (result === nodes) {
|
|
151808
|
-
result = factory.createNodeArray(nodes, nodes.hasTrailingComma);
|
|
151883
|
+
result = factory.createNodeArray(nodes.slice(), nodes.hasTrailingComma);
|
|
151809
151884
|
}
|
|
151810
151885
|
setTextRangePosEnd(result, -1, -1);
|
|
151811
151886
|
}
|
|
@@ -158230,7 +158305,7 @@ ${lanes.join("\n")}
|
|
|
158230
158305
|
);
|
|
158231
158306
|
}
|
|
158232
158307
|
function createSignatureTypeMapper(signature, typeArguments) {
|
|
158233
|
-
return createTypeMapper(signature.typeParameters, typeArguments);
|
|
158308
|
+
return createTypeMapper(sameMap(signature.typeParameters, (tp) => tp.mapper ? instantiateType(tp, tp.mapper) : tp), typeArguments);
|
|
158234
158309
|
}
|
|
158235
158310
|
function getErasedSignature(signature) {
|
|
158236
158311
|
return signature.typeParameters ? signature.erasedSignatureCache || (signature.erasedSignatureCache = createErasedSignature(signature)) : signature;
|
|
@@ -163068,6 +163143,10 @@ ${lanes.join("\n")}
|
|
|
163068
163143
|
function containsUndefinedType(type2) {
|
|
163069
163144
|
return !!((type2.flags & 1048576 ? type2.types[0] : type2).flags & 32768);
|
|
163070
163145
|
}
|
|
163146
|
+
function containsNonMissingUndefinedType(type2) {
|
|
163147
|
+
const candidate = type2.flags & 1048576 ? type2.types[0] : type2;
|
|
163148
|
+
return !!(candidate.flags & 32768) && candidate !== missingType;
|
|
163149
|
+
}
|
|
163071
163150
|
function isStringIndexSignatureOnlyType(type2) {
|
|
163072
163151
|
return type2.flags & 524288 && !isGenericMappedType(type2) && getPropertiesOfType(type2).length === 0 && getIndexInfosOfType(type2).length === 1 && !!getIndexInfoOfType(type2, stringType2) || type2.flags & 3145728 && every(type2.types, isStringIndexSignatureOnlyType) || false;
|
|
163073
163152
|
}
|
|
@@ -166946,11 +167025,11 @@ ${lanes.join("\n")}
|
|
|
166946
167025
|
}
|
|
166947
167026
|
function inferTypeForHomomorphicMappedType(source, target, constraint) {
|
|
166948
167027
|
const cacheKey = source.id + "," + target.id + "," + constraint.id;
|
|
166949
|
-
if (
|
|
166950
|
-
return
|
|
167028
|
+
if (reverseHomomorphicMappedCache.has(cacheKey)) {
|
|
167029
|
+
return reverseHomomorphicMappedCache.get(cacheKey);
|
|
166951
167030
|
}
|
|
166952
167031
|
const type2 = createReverseMappedType(source, target, constraint);
|
|
166953
|
-
|
|
167032
|
+
reverseHomomorphicMappedCache.set(cacheKey, type2);
|
|
166954
167033
|
return type2;
|
|
166955
167034
|
}
|
|
166956
167035
|
function isPartiallyInferableType(type2) {
|
|
@@ -170502,7 +170581,7 @@ ${lanes.join("\n")}
|
|
|
170502
170581
|
if (!canCollectSymbolAliasAccessabilityData) {
|
|
170503
170582
|
return;
|
|
170504
170583
|
}
|
|
170505
|
-
if (location2.flags & 33554432) {
|
|
170584
|
+
if (location2.flags & 33554432 && !isPropertySignature(location2) && !isPropertyDeclaration(location2)) {
|
|
170506
170585
|
return;
|
|
170507
170586
|
}
|
|
170508
170587
|
switch (hint) {
|
|
@@ -173696,11 +173775,7 @@ ${lanes.join("\n")}
|
|
|
173696
173775
|
checkGrammarJsxElement(node);
|
|
173697
173776
|
}
|
|
173698
173777
|
checkJsxPreconditions(node);
|
|
173699
|
-
|
|
173700
|
-
node,
|
|
173701
|
-
4
|
|
173702
|
-
/* Jsx */
|
|
173703
|
-
);
|
|
173778
|
+
markJsxAliasReferenced(node);
|
|
173704
173779
|
if (isNodeOpeningLikeElement) {
|
|
173705
173780
|
const jsxOpeningLikeNode = node;
|
|
173706
173781
|
const sig = getResolvedSignature(jsxOpeningLikeNode);
|
|
@@ -187474,15 +187549,14 @@ ${lanes.join("\n")}
|
|
|
187474
187549
|
function checkChildIdentifiers(node2) {
|
|
187475
187550
|
forEachNodeRecursively(node2, checkIdentifiers);
|
|
187476
187551
|
}
|
|
187552
|
+
function isExpressionNodeOrShorthandPropertyAssignmentName(node2) {
|
|
187553
|
+
return isExpressionNode(node2) || isShorthandPropertyAssignment(node2.parent) && (node2.parent.objectAssignmentInitializer ?? node2.parent.name) === node2;
|
|
187554
|
+
}
|
|
187477
187555
|
function checkSingleIdentifier(node2) {
|
|
187478
187556
|
const nodeLinks2 = getNodeLinks(node2);
|
|
187479
187557
|
nodeLinks2.calculatedFlags |= 536870912 | 16384 | 32768;
|
|
187480
|
-
if (isIdentifier(node2) &&
|
|
187481
|
-
const s2 =
|
|
187482
|
-
node2,
|
|
187483
|
-
/*ignoreErrors*/
|
|
187484
|
-
true
|
|
187485
|
-
);
|
|
187558
|
+
if (isIdentifier(node2) && isExpressionNodeOrShorthandPropertyAssignmentName(node2) && !(isPropertyAccessExpression(node2.parent) && node2.parent.name === node2)) {
|
|
187559
|
+
const s2 = getResolvedSymbol(node2);
|
|
187486
187560
|
if (s2 && s2 !== unknownSymbol) {
|
|
187487
187561
|
checkIdentifierCalculateNodeCheckFlags(node2, s2);
|
|
187488
187562
|
}
|
|
@@ -187999,7 +188073,8 @@ ${lanes.join("\n")}
|
|
|
187999
188073
|
resolveExternalModuleSymbol(sym);
|
|
188000
188074
|
return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker);
|
|
188001
188075
|
},
|
|
188002
|
-
isImportRequiredByAugmentation
|
|
188076
|
+
isImportRequiredByAugmentation,
|
|
188077
|
+
isDefinitelyReferenceToGlobalSymbolObject
|
|
188003
188078
|
};
|
|
188004
188079
|
function isImportRequiredByAugmentation(node) {
|
|
188005
188080
|
const file = getSourceFileOfNode(node);
|
|
@@ -215280,6 +215355,7 @@ ${lanes.join("\n")}
|
|
|
215280
215355
|
}
|
|
215281
215356
|
function reportInferenceFallback(node) {
|
|
215282
215357
|
if (!isolatedDeclarations || isSourceFileJS(currentSourceFile)) return;
|
|
215358
|
+
if (getSourceFileOfNode(node) !== currentSourceFile) return;
|
|
215283
215359
|
if (isVariableDeclaration(node) && resolver.isExpandoFunctionDeclaration(node)) {
|
|
215284
215360
|
reportExpandoFunctionErrors(node);
|
|
215285
215361
|
} else {
|
|
@@ -215939,15 +216015,17 @@ ${lanes.join("\n")}
|
|
|
215939
216015
|
if (isDeclarationAndNotVisible(input)) return;
|
|
215940
216016
|
if (hasDynamicName(input)) {
|
|
215941
216017
|
if (isolatedDeclarations) {
|
|
215942
|
-
if (
|
|
215943
|
-
|
|
215944
|
-
|
|
215945
|
-
|
|
215946
|
-
|
|
215947
|
-
|
|
215948
|
-
|
|
215949
|
-
|
|
215950
|
-
|
|
216018
|
+
if (!resolver.isDefinitelyReferenceToGlobalSymbolObject(input.name.expression)) {
|
|
216019
|
+
if (isClassDeclaration(input.parent) || isObjectLiteralExpression(input.parent)) {
|
|
216020
|
+
context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations));
|
|
216021
|
+
return;
|
|
216022
|
+
} else if (
|
|
216023
|
+
// Type declarations just need to double-check that the input computed name is an entity name expression
|
|
216024
|
+
(isInterfaceDeclaration(input.parent) || isTypeLiteralNode(input.parent)) && !isEntityNameExpression(input.name.expression)
|
|
216025
|
+
) {
|
|
216026
|
+
context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations));
|
|
216027
|
+
return;
|
|
216028
|
+
}
|
|
215951
216029
|
}
|
|
215952
216030
|
} else if (!resolver.isLateBound(getParseTreeNode(input)) || !isEntityNameExpression(input.name.expression)) {
|
|
215953
216031
|
return;
|
|
@@ -217827,7 +217905,7 @@ ${lanes.join("\n")}
|
|
|
217827
217905
|
noEmitHelpers: true,
|
|
217828
217906
|
module: compilerOptions.module,
|
|
217829
217907
|
target: compilerOptions.target,
|
|
217830
|
-
sourceMap:
|
|
217908
|
+
sourceMap: emitOnly !== 2 && compilerOptions.declarationMap,
|
|
217831
217909
|
inlineSourceMap: compilerOptions.inlineSourceMap,
|
|
217832
217910
|
extendedDiagnostics: compilerOptions.extendedDiagnostics,
|
|
217833
217911
|
onlyPrintJsDocStyle: true,
|
|
@@ -218054,7 +218132,8 @@ ${lanes.join("\n")}
|
|
|
218054
218132
|
getJsxFragmentFactoryEntity: notImplemented,
|
|
218055
218133
|
isBindingCapturedByNode: notImplemented,
|
|
218056
218134
|
getDeclarationStatementsForSourceFile: notImplemented,
|
|
218057
|
-
isImportRequiredByAugmentation: notImplemented
|
|
218135
|
+
isImportRequiredByAugmentation: notImplemented,
|
|
218136
|
+
isDefinitelyReferenceToGlobalSymbolObject: notImplemented
|
|
218058
218137
|
};
|
|
218059
218138
|
var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({}));
|
|
218060
218139
|
var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true }));
|
|
@@ -226450,7 +226529,8 @@ ${lanes.join("\n")}
|
|
|
226450
226529
|
if (options.outDir || // there is --outDir specified
|
|
226451
226530
|
options.rootDir || // there is --rootDir specified
|
|
226452
226531
|
options.sourceRoot || // there is --sourceRoot specified
|
|
226453
|
-
options.mapRoot
|
|
226532
|
+
options.mapRoot || // there is --mapRoot specified
|
|
226533
|
+
getEmitDeclarations(options) && options.declarationDir) {
|
|
226454
226534
|
const dir = getCommonSourceDirectory2();
|
|
226455
226535
|
if (options.outDir && dir === "" && files.some((file) => getRootLength(file.fileName) > 1)) {
|
|
226456
226536
|
createDiagnosticForOptionName(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files, "outDir");
|
|
@@ -227557,8 +227637,7 @@ ${lanes.join("\n")}
|
|
|
227557
227637
|
);
|
|
227558
227638
|
},
|
|
227559
227639
|
cancellationToken,
|
|
227560
|
-
|
|
227561
|
-
true,
|
|
227640
|
+
2,
|
|
227562
227641
|
/*customTransformers*/
|
|
227563
227642
|
void 0,
|
|
227564
227643
|
/*forceDtsEmit*/
|
|
@@ -234997,7 +235076,7 @@ ${lanes.join("\n")}
|
|
|
234997
235076
|
expression,
|
|
234998
235077
|
/*includeBigInt*/
|
|
234999
235078
|
false
|
|
235000
|
-
)) {
|
|
235079
|
+
) && !resolver.isDefinitelyReferenceToGlobalSymbolObject(expression)) {
|
|
235001
235080
|
context.tracker.reportInferenceFallback(prop.name);
|
|
235002
235081
|
result = false;
|
|
235003
235082
|
}
|
|
@@ -239112,6 +239191,7 @@ ${lanes.join("\n")}
|
|
|
239112
239191
|
function forEachNameOfDefaultExport(defaultExport, checker, compilerOptions, preferCapitalizedNames, cb) {
|
|
239113
239192
|
let chain;
|
|
239114
239193
|
let current2 = defaultExport;
|
|
239194
|
+
const seen = /* @__PURE__ */ new Map();
|
|
239115
239195
|
while (current2) {
|
|
239116
239196
|
const fromDeclaration = getDefaultLikeExportNameFromDeclaration(current2);
|
|
239117
239197
|
if (fromDeclaration) {
|
|
@@ -239123,6 +239203,7 @@ ${lanes.join("\n")}
|
|
|
239123
239203
|
if (final) return final;
|
|
239124
239204
|
}
|
|
239125
239205
|
chain = append(chain, current2);
|
|
239206
|
+
if (!addToSeen(seen, current2)) break;
|
|
239126
239207
|
current2 = current2.flags & 2097152 ? checker.getImmediateAliasedSymbol(current2) : void 0;
|
|
239127
239208
|
}
|
|
239128
239209
|
for (const symbol of chain ?? emptyArray) {
|
|
@@ -241734,7 +241815,7 @@ ${lanes.join("\n")}
|
|
|
241734
241815
|
}
|
|
241735
241816
|
const options = program2.getCompilerOptions();
|
|
241736
241817
|
const outPath = options.outFile;
|
|
241737
|
-
const declarationPath = outPath ? removeFileExtension(outPath) + ".d.ts" : getDeclarationEmitOutputFilePathWorker(info.fileName, program2.getCompilerOptions(),
|
|
241818
|
+
const declarationPath = outPath ? removeFileExtension(outPath) + ".d.ts" : getDeclarationEmitOutputFilePathWorker(info.fileName, program2.getCompilerOptions(), program2);
|
|
241738
241819
|
if (declarationPath === void 0) return void 0;
|
|
241739
241820
|
const newLoc = getDocumentPositionMapper2(declarationPath, info.fileName).getGeneratedPosition(info);
|
|
241740
241821
|
return newLoc === info ? void 0 : newLoc;
|
|
@@ -248827,9 +248908,9 @@ ${newComment.split("\n").map((c3) => ` * ${c3}`).join("\n")}
|
|
|
248827
248908
|
getChildAt(index2, sourceFile) {
|
|
248828
248909
|
return this.getChildren(sourceFile)[index2];
|
|
248829
248910
|
}
|
|
248830
|
-
getChildren(sourceFile) {
|
|
248911
|
+
getChildren(sourceFile = getSourceFileOfNode(this)) {
|
|
248831
248912
|
this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine");
|
|
248832
|
-
return getNodeChildren(this) ?? setNodeChildren(this, createChildren(this, sourceFile));
|
|
248913
|
+
return getNodeChildren(this, sourceFile) ?? setNodeChildren(this, sourceFile, createChildren(this, sourceFile));
|
|
248833
248914
|
}
|
|
248834
248915
|
getFirstToken(sourceFile) {
|
|
248835
248916
|
this.assertHasRealPosition();
|
|
@@ -248914,7 +248995,7 @@ ${newComment.split("\n").map((c3) => ` * ${c3}`).join("\n")}
|
|
|
248914
248995
|
pos = node.end;
|
|
248915
248996
|
}
|
|
248916
248997
|
addSyntheticNodes(children, pos, nodes.end, parent2);
|
|
248917
|
-
|
|
248998
|
+
list._children = children;
|
|
248918
248999
|
return list;
|
|
248919
249000
|
}
|
|
248920
249001
|
var TokenOrIdentifierObject = class {
|
|
@@ -262504,6 +262585,14 @@ ${newComment.split("\n").map((c3) => ` * ${c3}`).join("\n")}
|
|
|
262504
262585
|
function visit3(node) {
|
|
262505
262586
|
if (isLiteralImportTypeNode(node) && node.qualifier) {
|
|
262506
262587
|
const firstIdentifier = getFirstIdentifier(node.qualifier);
|
|
262588
|
+
if (!firstIdentifier.symbol) {
|
|
262589
|
+
return visitEachChild(
|
|
262590
|
+
node,
|
|
262591
|
+
visit3,
|
|
262592
|
+
/*context*/
|
|
262593
|
+
void 0
|
|
262594
|
+
);
|
|
262595
|
+
}
|
|
262507
262596
|
const name = getNameForExportedSymbol(firstIdentifier.symbol, scriptTarget);
|
|
262508
262597
|
const qualifier = name !== firstIdentifier.text ? replaceFirstIdentifierOfEntityName(node.qualifier, factory.createIdentifier(name)) : node.qualifier;
|
|
262509
262598
|
symbols = append(symbols, firstIdentifier.symbol);
|
|
@@ -269083,7 +269172,7 @@ ${newComment.split("\n").map((c3) => ` * ${c3}`).join("\n")}
|
|
|
269083
269172
|
return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol);
|
|
269084
269173
|
}
|
|
269085
269174
|
function getSourceFileLikeForImportDeclaration(node) {
|
|
269086
|
-
if (node.kind === 213) {
|
|
269175
|
+
if (node.kind === 213 || node.kind === 351) {
|
|
269087
269176
|
return node.getSourceFile();
|
|
269088
269177
|
}
|
|
269089
269178
|
const { parent: parent2 } = node;
|
|
@@ -283462,6 +283551,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
283462
283551
|
trace: () => trace2,
|
|
283463
283552
|
tracing: () => tracing,
|
|
283464
283553
|
tracingEnabled: () => tracingEnabled,
|
|
283554
|
+
transferSourceFileChildren: () => transferSourceFileChildren,
|
|
283465
283555
|
transform: () => transform6,
|
|
283466
283556
|
transformClassFields: () => transformClassFields,
|
|
283467
283557
|
transformDeclarations: () => transformDeclarations,
|
|
@@ -286272,7 +286362,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
286272
286362
|
this.generatedFilesMap.forEach((watcher, source) => {
|
|
286273
286363
|
const sourceFile = this.program.getSourceFileByPath(source);
|
|
286274
286364
|
if (!sourceFile || sourceFile.resolvedPath !== source || !this.isValidGeneratedFileWatcher(
|
|
286275
|
-
getDeclarationEmitOutputFilePathWorker(sourceFile.fileName, this.compilerOptions, this.
|
|
286365
|
+
getDeclarationEmitOutputFilePathWorker(sourceFile.fileName, this.compilerOptions, this.program),
|
|
286276
286366
|
watcher
|
|
286277
286367
|
)) {
|
|
286278
286368
|
closeFileWatcherOf(watcher);
|