typescript 5.5.0-dev.20240426 → 5.5.0-dev.20240428

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 (3) hide show
  1. package/lib/tsc.js +107 -28
  2. package/lib/typescript.js +119 -28
  3. package/package.json +2 -2
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.5";
21
- var version = `${versionMajorMinor}.0-dev.20240426`;
21
+ var version = `${versionMajorMinor}.0-dev.20240428`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -447,13 +447,23 @@ function deduplicateSorted(array, comparer) {
447
447
  }
448
448
  return deduplicated;
449
449
  }
450
- function insertSorted(array, insert, compare, allowDuplicates) {
450
+ function insertSorted(array, insert, compare, equalityComparer, allowDuplicates) {
451
451
  if (array.length === 0) {
452
452
  array.push(insert);
453
453
  return true;
454
454
  }
455
455
  const insertIndex = binarySearch(array, insert, identity, compare);
456
456
  if (insertIndex < 0) {
457
+ if (equalityComparer && !allowDuplicates) {
458
+ const idx = ~insertIndex;
459
+ if (idx > 0 && equalityComparer(insert, array[idx - 1])) {
460
+ return false;
461
+ }
462
+ if (idx < array.length && equalityComparer(insert, array[idx])) {
463
+ array.splice(idx, 1, insert);
464
+ return true;
465
+ }
466
+ }
457
467
  array.splice(~insertIndex, 0, insert);
458
468
  return true;
459
469
  }
@@ -7457,6 +7467,7 @@ var Diagnostics = {
7457
7467
  Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: diag(6719, 3 /* Message */, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."),
7458
7468
  Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
7459
7469
  Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
7470
+ Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported: diag(6805, 3 /* Message */, "Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805", "Disable full type checking (only critical parse and emit errors will be reported)."),
7460
7471
  one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"),
7461
7472
  one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"),
7462
7473
  type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"),
@@ -11072,7 +11083,7 @@ function isExternalModuleNameRelative(moduleName) {
11072
11083
  return pathIsRelative(moduleName) || isRootedDiskPath(moduleName);
11073
11084
  }
11074
11085
  function sortAndDeduplicateDiagnostics(diagnostics) {
11075
- return sortAndDeduplicate(diagnostics, compareDiagnostics);
11086
+ return sortAndDeduplicate(diagnostics, compareDiagnostics, diagnosticsEqualityComparer);
11076
11087
  }
11077
11088
  function getDefaultLibFileName(options) {
11078
11089
  switch (getEmitScriptTarget(options)) {
@@ -15749,6 +15760,9 @@ function createDiagnosticCollection() {
15749
15760
  if (result >= 0) {
15750
15761
  return diagnostics[result];
15751
15762
  }
15763
+ if (~result > 0 && diagnosticsEqualityComparer(diagnostic, diagnostics[~result - 1])) {
15764
+ return diagnostics[~result - 1];
15765
+ }
15752
15766
  return void 0;
15753
15767
  }
15754
15768
  function add(diagnostic) {
@@ -15767,7 +15781,7 @@ function createDiagnosticCollection() {
15767
15781
  }
15768
15782
  diagnostics = nonFileDiagnostics;
15769
15783
  }
15770
- insertSorted(diagnostics, diagnostic, compareDiagnosticsSkipRelatedInformation);
15784
+ insertSorted(diagnostics, diagnostic, compareDiagnosticsSkipRelatedInformation, diagnosticsEqualityComparer);
15771
15785
  }
15772
15786
  function getGlobalDiagnostics() {
15773
15787
  hasReadNonFileDiagnostics = true;
@@ -17373,7 +17387,7 @@ function compareRelatedInformation(d1, d2) {
17373
17387
  return 0 /* EqualTo */;
17374
17388
  }
17375
17389
  if (d1.relatedInformation && d2.relatedInformation) {
17376
- return compareValues(d1.relatedInformation.length, d2.relatedInformation.length) || forEach(d1.relatedInformation, (d1i, index) => {
17390
+ return compareValues(d2.relatedInformation.length, d1.relatedInformation.length) || forEach(d1.relatedInformation, (d1i, index) => {
17377
17391
  const d2i = d2.relatedInformation[index];
17378
17392
  return compareDiagnostics(d1i, d2i);
17379
17393
  }) || 0 /* EqualTo */;
@@ -17383,38 +17397,78 @@ function compareRelatedInformation(d1, d2) {
17383
17397
  function compareMessageText(t1, t2) {
17384
17398
  if (typeof t1 === "string" && typeof t2 === "string") {
17385
17399
  return compareStringsCaseSensitive(t1, t2);
17386
- } else if (typeof t1 === "string") {
17387
- return -1 /* LessThan */;
17388
- } else if (typeof t2 === "string") {
17389
- return 1 /* GreaterThan */;
17390
17400
  }
17391
- let res = compareStringsCaseSensitive(t1.messageText, t2.messageText);
17401
+ if (typeof t1 === "string") {
17402
+ t1 = { messageText: t1 };
17403
+ }
17404
+ if (typeof t2 === "string") {
17405
+ t2 = { messageText: t2 };
17406
+ }
17407
+ const res = compareStringsCaseSensitive(t1.messageText, t2.messageText);
17392
17408
  if (res) {
17393
17409
  return res;
17394
17410
  }
17395
- if (!t1.next && !t2.next) {
17411
+ return compareMessageChain(t1.next, t2.next);
17412
+ }
17413
+ function compareMessageChain(c1, c2) {
17414
+ if (c1 === void 0 && c2 === void 0) {
17396
17415
  return 0 /* EqualTo */;
17397
17416
  }
17398
- if (!t1.next) {
17417
+ if (c1 === void 0) {
17418
+ return 1 /* GreaterThan */;
17419
+ }
17420
+ if (c2 === void 0) {
17399
17421
  return -1 /* LessThan */;
17400
17422
  }
17401
- if (!t2.next) {
17423
+ return compareMessageChainSize(c1, c2) || compareMessageChainContent(c1, c2);
17424
+ }
17425
+ function compareMessageChainSize(c1, c2) {
17426
+ if (c1 === void 0 && c2 === void 0) {
17427
+ return 0 /* EqualTo */;
17428
+ }
17429
+ if (c1 === void 0) {
17402
17430
  return 1 /* GreaterThan */;
17403
17431
  }
17404
- const len = Math.min(t1.next.length, t2.next.length);
17405
- for (let i = 0; i < len; i++) {
17406
- res = compareMessageText(t1.next[i], t2.next[i]);
17432
+ if (c2 === void 0) {
17433
+ return -1 /* LessThan */;
17434
+ }
17435
+ let res = compareValues(c2.length, c1.length);
17436
+ if (res) {
17437
+ return res;
17438
+ }
17439
+ for (let i = 0; i < c2.length; i++) {
17440
+ res = compareMessageChainSize(c1[i].next, c2[i].next);
17407
17441
  if (res) {
17408
17442
  return res;
17409
17443
  }
17410
17444
  }
17411
- if (t1.next.length < t2.next.length) {
17412
- return -1 /* LessThan */;
17413
- } else if (t1.next.length > t2.next.length) {
17414
- return 1 /* GreaterThan */;
17445
+ return 0 /* EqualTo */;
17446
+ }
17447
+ function compareMessageChainContent(c1, c2) {
17448
+ let res;
17449
+ for (let i = 0; i < c2.length; i++) {
17450
+ res = compareStringsCaseSensitive(c1[i].messageText, c2[i].messageText);
17451
+ if (res) {
17452
+ return res;
17453
+ }
17454
+ if (c1[i].next === void 0) {
17455
+ continue;
17456
+ }
17457
+ res = compareMessageChainContent(c1[i].next, c2[i].next);
17458
+ if (res) {
17459
+ return res;
17460
+ }
17415
17461
  }
17416
17462
  return 0 /* EqualTo */;
17417
17463
  }
17464
+ function diagnosticsEqualityComparer(d1, d2) {
17465
+ return compareStringsCaseSensitive(getDiagnosticFilePath(d1), getDiagnosticFilePath(d2)) === 0 /* EqualTo */ && compareValues(d1.start, d2.start) === 0 /* EqualTo */ && compareValues(d1.length, d2.length) === 0 /* EqualTo */ && compareValues(d1.code, d2.code) === 0 /* EqualTo */ && messageTextEqualityComparer(d1.messageText, d2.messageText);
17466
+ }
17467
+ function messageTextEqualityComparer(m1, m2) {
17468
+ const t1 = typeof m1 === "string" ? m1 : m1.messageText;
17469
+ const t2 = typeof m2 === "string" ? m2 : m2.messageText;
17470
+ return compareStringsCaseSensitive(t1, t2) === 0 /* EqualTo */;
17471
+ }
17418
17472
  function getLanguageVariant(scriptKind) {
17419
17473
  return scriptKind === 4 /* TSX */ || scriptKind === 2 /* JSX */ || scriptKind === 1 /* JS */ || scriptKind === 6 /* JSON */ ? 1 /* JSX */ : 0 /* Standard */;
17420
17474
  }
@@ -18282,7 +18336,7 @@ function rangeOfTypeParameters(sourceFile, typeParameters) {
18282
18336
  return { pos, end };
18283
18337
  }
18284
18338
  function skipTypeChecking(sourceFile, options, host) {
18285
- return options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName);
18339
+ return options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib || options.noCheck || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName);
18286
18340
  }
18287
18341
  function isJsonEqual(a, b) {
18288
18342
  return a === b || typeof a === "object" && a !== null && typeof b === "object" && b !== null && equalOwnProperties(a, b, isJsonEqual);
@@ -36002,6 +36056,20 @@ var commandOptionsWithoutBuild = [
36002
36056
  defaultValueDescription: false,
36003
36057
  description: Diagnostics.Disable_emitting_comments
36004
36058
  },
36059
+ {
36060
+ name: "noCheck",
36061
+ type: "boolean",
36062
+ showInSimplifiedHelpView: false,
36063
+ category: Diagnostics.Compiler_Diagnostics,
36064
+ description: Diagnostics.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported,
36065
+ transpileOptionValue: void 0,
36066
+ defaultValueDescription: false,
36067
+ affectsSemanticDiagnostics: true,
36068
+ affectsBuildInfo: true,
36069
+ extraValidation() {
36070
+ return [Diagnostics.Unknown_compiler_option_0, "noCheck"];
36071
+ }
36072
+ },
36005
36073
  {
36006
36074
  name: "noEmit",
36007
36075
  type: "boolean",
@@ -37849,11 +37917,11 @@ function parseJsonConfigFileContentWorker(json, sourceFile, host, basePath, exis
37849
37917
  const excludeOfRaw = getSpecsFromRaw("exclude");
37850
37918
  let isDefaultIncludeSpec = false;
37851
37919
  let excludeSpecs = toPropValue(excludeOfRaw);
37852
- if (excludeOfRaw === "no-prop" && raw.compilerOptions) {
37853
- const outDir = raw.compilerOptions.outDir;
37854
- const declarationDir = raw.compilerOptions.declarationDir;
37920
+ if (excludeOfRaw === "no-prop") {
37921
+ const outDir = options.outDir;
37922
+ const declarationDir = options.declarationDir;
37855
37923
  if (outDir || declarationDir) {
37856
- excludeSpecs = [outDir, declarationDir].filter((d) => !!d);
37924
+ excludeSpecs = filter([outDir, declarationDir], (d) => !!d);
37857
37925
  }
37858
37926
  }
37859
37927
  if (filesSpecs === void 0 && includeSpecs === void 0) {
@@ -52082,6 +52150,7 @@ function createTypeChecker(host) {
52082
52150
  }
52083
52151
  }
52084
52152
  function serializeSymbol(symbol, isPrivate, propertyAsAlias) {
52153
+ void getPropertiesOfType(getTypeOfSymbol(symbol));
52085
52154
  const visitedSym = getMergedSymbol(symbol);
52086
52155
  if (visitedSymbols.has(getSymbolId(visitedSym))) {
52087
52156
  return;
@@ -85328,6 +85397,7 @@ function createTypeChecker(host) {
85328
85397
  if (!sym) {
85329
85398
  return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker);
85330
85399
  }
85400
+ resolveExternalModuleSymbol(sym);
85331
85401
  return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker);
85332
85402
  },
85333
85403
  isImportRequiredByAugmentation
@@ -110462,12 +110532,13 @@ function createGetIsolatedDeclarationErrors(resolver) {
110462
110532
  // src/compiler/transformers/declarations.ts
110463
110533
  function getDeclarationDiagnostics(host, resolver, file) {
110464
110534
  const compilerOptions = host.getCompilerOptions();
110535
+ const files = filter(getSourceFilesToEmit(host, file), isSourceFileNotJson);
110465
110536
  const result = transformNodes(
110466
110537
  resolver,
110467
110538
  host,
110468
110539
  factory,
110469
110540
  compilerOptions,
110470
- file ? [file] : filter(host.getSourceFiles(), isSourceFileNotJson),
110541
+ file ? contains(files, file) ? [file] : emptyArray : files,
110471
110542
  [transformDeclarations],
110472
110543
  /*allowDtsFiles*/
110473
110544
  false
@@ -112894,7 +112965,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
112894
112965
  const sourceFiles = isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : sourceFileOrBundle.sourceFiles;
112895
112966
  const filesForEmit = forceDtsEmit ? sourceFiles : filter(sourceFiles, isSourceFileNotJson);
112896
112967
  const inputListOrBundle = compilerOptions.outFile ? [factory.createBundle(filesForEmit)] : filesForEmit;
112897
- if (emitOnly && !getEmitDeclarations(compilerOptions)) {
112968
+ if (emitOnly && !getEmitDeclarations(compilerOptions) || compilerOptions.noCheck) {
112898
112969
  filesForEmit.forEach(collectLinkedAliases);
112899
112970
  }
112900
112971
  const declarationTransform = transformNodes(
@@ -120988,7 +121059,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
120988
121059
  continue;
120989
121060
  }
120990
121061
  const isFromNodeModulesSearch = resolution.isExternalLibraryImport;
120991
- const isJsFile = !resolutionExtensionIsTSOrJson(resolution.extension);
121062
+ const isJsFile = !resolutionExtensionIsTSOrJson(resolution.extension) && !getProjectReferenceRedirectProject(resolution.resolvedFileName);
120992
121063
  const isJsFileFromNodeModules = isFromNodeModulesSearch && isJsFile && (!resolution.originalPath || pathContainsNodeModules(resolution.resolvedFileName));
120993
121064
  const resolvedFileName = resolution.resolvedFileName;
120994
121065
  if (isFromNodeModulesSearch) {
@@ -121283,6 +121354,14 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
121283
121354
  createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "emitDeclarationOnly", "noEmit");
121284
121355
  }
121285
121356
  }
121357
+ if (options.noCheck) {
121358
+ if (options.noEmit) {
121359
+ createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noCheck", "noEmit");
121360
+ }
121361
+ if (!options.emitDeclarationOnly) {
121362
+ createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "noCheck", "emitDeclarationOnly");
121363
+ }
121364
+ }
121286
121365
  if (options.emitDecoratorMetadata && !options.experimentalDecorators) {
121287
121366
  createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators");
121288
121367
  }
package/lib/typescript.js CHANGED
@@ -511,6 +511,7 @@ __export(typescript_exports, {
511
511
  defaultMaximumTruncationLength: () => defaultMaximumTruncationLength,
512
512
  diagnosticCategoryName: () => diagnosticCategoryName,
513
513
  diagnosticToString: () => diagnosticToString,
514
+ diagnosticsEqualityComparer: () => diagnosticsEqualityComparer,
514
515
  directoryProbablyExists: () => directoryProbablyExists,
515
516
  directorySeparator: () => directorySeparator,
516
517
  displayPart: () => displayPart,
@@ -2360,7 +2361,7 @@ module.exports = __toCommonJS(typescript_exports);
2360
2361
 
2361
2362
  // src/compiler/corePublic.ts
2362
2363
  var versionMajorMinor = "5.5";
2363
- var version = `${versionMajorMinor}.0-dev.20240426`;
2364
+ var version = `${versionMajorMinor}.0-dev.20240428`;
2364
2365
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2365
2366
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2366
2367
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -2880,13 +2881,23 @@ function deduplicateSorted(array, comparer) {
2880
2881
  function createSortedArray() {
2881
2882
  return [];
2882
2883
  }
2883
- function insertSorted(array, insert, compare, allowDuplicates) {
2884
+ function insertSorted(array, insert, compare, equalityComparer, allowDuplicates) {
2884
2885
  if (array.length === 0) {
2885
2886
  array.push(insert);
2886
2887
  return true;
2887
2888
  }
2888
2889
  const insertIndex = binarySearch(array, insert, identity, compare);
2889
2890
  if (insertIndex < 0) {
2891
+ if (equalityComparer && !allowDuplicates) {
2892
+ const idx = ~insertIndex;
2893
+ if (idx > 0 && equalityComparer(insert, array[idx - 1])) {
2894
+ return false;
2895
+ }
2896
+ if (idx < array.length && equalityComparer(insert, array[idx])) {
2897
+ array.splice(idx, 1, insert);
2898
+ return true;
2899
+ }
2900
+ }
2890
2901
  array.splice(~insertIndex, 0, insert);
2891
2902
  return true;
2892
2903
  }
@@ -11068,6 +11079,7 @@ var Diagnostics = {
11068
11079
  Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: diag(6719, 3 /* Message */, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."),
11069
11080
  Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
11070
11081
  Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
11082
+ Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported: diag(6805, 3 /* Message */, "Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported_6805", "Disable full type checking (only critical parse and emit errors will be reported)."),
11071
11083
  one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"),
11072
11084
  one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"),
11073
11085
  type_Colon: diag(6902, 3 /* Message */, "type_Colon_6902", "type:"),
@@ -14707,7 +14719,7 @@ function isExternalModuleNameRelative(moduleName) {
14707
14719
  return pathIsRelative(moduleName) || isRootedDiskPath(moduleName);
14708
14720
  }
14709
14721
  function sortAndDeduplicateDiagnostics(diagnostics) {
14710
- return sortAndDeduplicate(diagnostics, compareDiagnostics);
14722
+ return sortAndDeduplicate(diagnostics, compareDiagnostics, diagnosticsEqualityComparer);
14711
14723
  }
14712
14724
  function getDefaultLibFileName(options) {
14713
14725
  switch (getEmitScriptTarget(options)) {
@@ -19831,6 +19843,9 @@ function createDiagnosticCollection() {
19831
19843
  if (result >= 0) {
19832
19844
  return diagnostics[result];
19833
19845
  }
19846
+ if (~result > 0 && diagnosticsEqualityComparer(diagnostic, diagnostics[~result - 1])) {
19847
+ return diagnostics[~result - 1];
19848
+ }
19834
19849
  return void 0;
19835
19850
  }
19836
19851
  function add(diagnostic) {
@@ -19849,7 +19864,7 @@ function createDiagnosticCollection() {
19849
19864
  }
19850
19865
  diagnostics = nonFileDiagnostics;
19851
19866
  }
19852
- insertSorted(diagnostics, diagnostic, compareDiagnosticsSkipRelatedInformation);
19867
+ insertSorted(diagnostics, diagnostic, compareDiagnosticsSkipRelatedInformation, diagnosticsEqualityComparer);
19853
19868
  }
19854
19869
  function getGlobalDiagnostics() {
19855
19870
  hasReadNonFileDiagnostics = true;
@@ -21617,7 +21632,7 @@ function compareRelatedInformation(d1, d2) {
21617
21632
  return 0 /* EqualTo */;
21618
21633
  }
21619
21634
  if (d1.relatedInformation && d2.relatedInformation) {
21620
- return compareValues(d1.relatedInformation.length, d2.relatedInformation.length) || forEach(d1.relatedInformation, (d1i, index) => {
21635
+ return compareValues(d2.relatedInformation.length, d1.relatedInformation.length) || forEach(d1.relatedInformation, (d1i, index) => {
21621
21636
  const d2i = d2.relatedInformation[index];
21622
21637
  return compareDiagnostics(d1i, d2i);
21623
21638
  }) || 0 /* EqualTo */;
@@ -21627,38 +21642,78 @@ function compareRelatedInformation(d1, d2) {
21627
21642
  function compareMessageText(t1, t2) {
21628
21643
  if (typeof t1 === "string" && typeof t2 === "string") {
21629
21644
  return compareStringsCaseSensitive(t1, t2);
21630
- } else if (typeof t1 === "string") {
21631
- return -1 /* LessThan */;
21632
- } else if (typeof t2 === "string") {
21633
- return 1 /* GreaterThan */;
21634
21645
  }
21635
- let res = compareStringsCaseSensitive(t1.messageText, t2.messageText);
21646
+ if (typeof t1 === "string") {
21647
+ t1 = { messageText: t1 };
21648
+ }
21649
+ if (typeof t2 === "string") {
21650
+ t2 = { messageText: t2 };
21651
+ }
21652
+ const res = compareStringsCaseSensitive(t1.messageText, t2.messageText);
21636
21653
  if (res) {
21637
21654
  return res;
21638
21655
  }
21639
- if (!t1.next && !t2.next) {
21656
+ return compareMessageChain(t1.next, t2.next);
21657
+ }
21658
+ function compareMessageChain(c1, c2) {
21659
+ if (c1 === void 0 && c2 === void 0) {
21640
21660
  return 0 /* EqualTo */;
21641
21661
  }
21642
- if (!t1.next) {
21662
+ if (c1 === void 0) {
21663
+ return 1 /* GreaterThan */;
21664
+ }
21665
+ if (c2 === void 0) {
21643
21666
  return -1 /* LessThan */;
21644
21667
  }
21645
- if (!t2.next) {
21668
+ return compareMessageChainSize(c1, c2) || compareMessageChainContent(c1, c2);
21669
+ }
21670
+ function compareMessageChainSize(c1, c2) {
21671
+ if (c1 === void 0 && c2 === void 0) {
21672
+ return 0 /* EqualTo */;
21673
+ }
21674
+ if (c1 === void 0) {
21646
21675
  return 1 /* GreaterThan */;
21647
21676
  }
21648
- const len = Math.min(t1.next.length, t2.next.length);
21649
- for (let i = 0; i < len; i++) {
21650
- res = compareMessageText(t1.next[i], t2.next[i]);
21677
+ if (c2 === void 0) {
21678
+ return -1 /* LessThan */;
21679
+ }
21680
+ let res = compareValues(c2.length, c1.length);
21681
+ if (res) {
21682
+ return res;
21683
+ }
21684
+ for (let i = 0; i < c2.length; i++) {
21685
+ res = compareMessageChainSize(c1[i].next, c2[i].next);
21651
21686
  if (res) {
21652
21687
  return res;
21653
21688
  }
21654
21689
  }
21655
- if (t1.next.length < t2.next.length) {
21656
- return -1 /* LessThan */;
21657
- } else if (t1.next.length > t2.next.length) {
21658
- return 1 /* GreaterThan */;
21690
+ return 0 /* EqualTo */;
21691
+ }
21692
+ function compareMessageChainContent(c1, c2) {
21693
+ let res;
21694
+ for (let i = 0; i < c2.length; i++) {
21695
+ res = compareStringsCaseSensitive(c1[i].messageText, c2[i].messageText);
21696
+ if (res) {
21697
+ return res;
21698
+ }
21699
+ if (c1[i].next === void 0) {
21700
+ continue;
21701
+ }
21702
+ res = compareMessageChainContent(c1[i].next, c2[i].next);
21703
+ if (res) {
21704
+ return res;
21705
+ }
21659
21706
  }
21660
21707
  return 0 /* EqualTo */;
21661
21708
  }
21709
+ function diagnosticsEqualityComparer(d1, d2) {
21710
+ return compareStringsCaseSensitive(getDiagnosticFilePath(d1), getDiagnosticFilePath(d2)) === 0 /* EqualTo */ && compareValues(d1.start, d2.start) === 0 /* EqualTo */ && compareValues(d1.length, d2.length) === 0 /* EqualTo */ && compareValues(d1.code, d2.code) === 0 /* EqualTo */ && messageTextEqualityComparer(d1.messageText, d2.messageText);
21711
+ }
21712
+ function messageTextEqualityComparer(m1, m2) {
21713
+ const t1 = typeof m1 === "string" ? m1 : m1.messageText;
21714
+ const t2 = typeof m2 === "string" ? m2 : m2.messageText;
21715
+ return compareStringsCaseSensitive(t1, t2) === 0 /* EqualTo */;
21716
+ }
21662
21717
  function getLanguageVariant(scriptKind) {
21663
21718
  return scriptKind === 4 /* TSX */ || scriptKind === 2 /* JSX */ || scriptKind === 1 /* JS */ || scriptKind === 6 /* JSON */ ? 1 /* JSX */ : 0 /* Standard */;
21664
21719
  }
@@ -22549,7 +22604,7 @@ function rangeOfTypeParameters(sourceFile, typeParameters) {
22549
22604
  return { pos, end };
22550
22605
  }
22551
22606
  function skipTypeChecking(sourceFile, options, host) {
22552
- return options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName);
22607
+ return options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib || options.noCheck || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName);
22553
22608
  }
22554
22609
  function isJsonEqual(a, b) {
22555
22610
  return a === b || typeof a === "object" && a !== null && typeof b === "object" && b !== null && equalOwnProperties(a, b, isJsonEqual);
@@ -40475,6 +40530,20 @@ var commandOptionsWithoutBuild = [
40475
40530
  defaultValueDescription: false,
40476
40531
  description: Diagnostics.Disable_emitting_comments
40477
40532
  },
40533
+ {
40534
+ name: "noCheck",
40535
+ type: "boolean",
40536
+ showInSimplifiedHelpView: false,
40537
+ category: Diagnostics.Compiler_Diagnostics,
40538
+ description: Diagnostics.Disable_full_type_checking_only_critical_parse_and_emit_errors_will_be_reported,
40539
+ transpileOptionValue: void 0,
40540
+ defaultValueDescription: false,
40541
+ affectsSemanticDiagnostics: true,
40542
+ affectsBuildInfo: true,
40543
+ extraValidation() {
40544
+ return [Diagnostics.Unknown_compiler_option_0, "noCheck"];
40545
+ }
40546
+ },
40478
40547
  {
40479
40548
  name: "noEmit",
40480
40549
  type: "boolean",
@@ -42347,11 +42416,11 @@ function parseJsonConfigFileContentWorker(json, sourceFile, host, basePath, exis
42347
42416
  const excludeOfRaw = getSpecsFromRaw("exclude");
42348
42417
  let isDefaultIncludeSpec = false;
42349
42418
  let excludeSpecs = toPropValue(excludeOfRaw);
42350
- if (excludeOfRaw === "no-prop" && raw.compilerOptions) {
42351
- const outDir = raw.compilerOptions.outDir;
42352
- const declarationDir = raw.compilerOptions.declarationDir;
42419
+ if (excludeOfRaw === "no-prop") {
42420
+ const outDir = options.outDir;
42421
+ const declarationDir = options.declarationDir;
42353
42422
  if (outDir || declarationDir) {
42354
- excludeSpecs = [outDir, declarationDir].filter((d) => !!d);
42423
+ excludeSpecs = filter([outDir, declarationDir], (d) => !!d);
42355
42424
  }
42356
42425
  }
42357
42426
  if (filesSpecs === void 0 && includeSpecs === void 0) {
@@ -56911,6 +56980,7 @@ function createTypeChecker(host) {
56911
56980
  }
56912
56981
  }
56913
56982
  function serializeSymbol(symbol, isPrivate, propertyAsAlias) {
56983
+ void getPropertiesOfType(getTypeOfSymbol(symbol));
56914
56984
  const visitedSym = getMergedSymbol(symbol);
56915
56985
  if (visitedSymbols.has(getSymbolId(visitedSym))) {
56916
56986
  return;
@@ -90157,6 +90227,7 @@ function createTypeChecker(host) {
90157
90227
  if (!sym) {
90158
90228
  return !node.locals ? [] : nodeBuilder.symbolTableToDeclarationStatements(node.locals, node, flags, tracker);
90159
90229
  }
90230
+ resolveExternalModuleSymbol(sym);
90160
90231
  return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker);
90161
90232
  },
90162
90233
  isImportRequiredByAugmentation
@@ -115478,12 +115549,13 @@ function createGetIsolatedDeclarationErrors(resolver) {
115478
115549
  // src/compiler/transformers/declarations.ts
115479
115550
  function getDeclarationDiagnostics(host, resolver, file) {
115480
115551
  const compilerOptions = host.getCompilerOptions();
115552
+ const files = filter(getSourceFilesToEmit(host, file), isSourceFileNotJson);
115481
115553
  const result = transformNodes(
115482
115554
  resolver,
115483
115555
  host,
115484
115556
  factory,
115485
115557
  compilerOptions,
115486
- file ? [file] : filter(host.getSourceFiles(), isSourceFileNotJson),
115558
+ file ? contains(files, file) ? [file] : emptyArray : files,
115487
115559
  [transformDeclarations],
115488
115560
  /*allowDtsFiles*/
115489
115561
  false
@@ -117921,7 +117993,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
117921
117993
  const sourceFiles = isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : sourceFileOrBundle.sourceFiles;
117922
117994
  const filesForEmit = forceDtsEmit ? sourceFiles : filter(sourceFiles, isSourceFileNotJson);
117923
117995
  const inputListOrBundle = compilerOptions.outFile ? [factory.createBundle(filesForEmit)] : filesForEmit;
117924
- if (emitOnly && !getEmitDeclarations(compilerOptions)) {
117996
+ if (emitOnly && !getEmitDeclarations(compilerOptions) || compilerOptions.noCheck) {
117925
117997
  filesForEmit.forEach(collectLinkedAliases);
117926
117998
  }
117927
117999
  const declarationTransform = transformNodes(
@@ -126061,7 +126133,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
126061
126133
  continue;
126062
126134
  }
126063
126135
  const isFromNodeModulesSearch = resolution.isExternalLibraryImport;
126064
- const isJsFile = !resolutionExtensionIsTSOrJson(resolution.extension);
126136
+ const isJsFile = !resolutionExtensionIsTSOrJson(resolution.extension) && !getProjectReferenceRedirectProject(resolution.resolvedFileName);
126065
126137
  const isJsFileFromNodeModules = isFromNodeModulesSearch && isJsFile && (!resolution.originalPath || pathContainsNodeModules(resolution.resolvedFileName));
126066
126138
  const resolvedFileName = resolution.resolvedFileName;
126067
126139
  if (isFromNodeModulesSearch) {
@@ -126356,6 +126428,14 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
126356
126428
  createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "emitDeclarationOnly", "noEmit");
126357
126429
  }
126358
126430
  }
126431
+ if (options.noCheck) {
126432
+ if (options.noEmit) {
126433
+ createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noCheck", "noEmit");
126434
+ }
126435
+ if (!options.emitDeclarationOnly) {
126436
+ createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "noCheck", "emitDeclarationOnly");
126437
+ }
126438
+ }
126359
126439
  if (options.emitDecoratorMetadata && !options.experimentalDecorators) {
126360
126440
  createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDecoratorMetadata", "experimentalDecorators");
126361
126441
  }
@@ -141704,6 +141784,7 @@ function transpileWorker(input, transpileOptions, declaration) {
141704
141784
  options.declaration = true;
141705
141785
  options.emitDeclarationOnly = true;
141706
141786
  options.isolatedDeclarations = true;
141787
+ options.noCheck = true;
141707
141788
  } else {
141708
141789
  options.declaration = false;
141709
141790
  }
@@ -162657,6 +162738,8 @@ function completionInfoFromData(sourceFile, host, program, compilerOptions, log,
162657
162738
  entries,
162658
162739
  keywordEntry,
162659
162740
  compareCompletionEntries,
162741
+ /*equalityComparer*/
162742
+ void 0,
162660
162743
  /*allowDuplicates*/
162661
162744
  true
162662
162745
  );
@@ -162670,6 +162753,8 @@ function completionInfoFromData(sourceFile, host, program, compilerOptions, log,
162670
162753
  entries,
162671
162754
  keywordEntry,
162672
162755
  compareCompletionEntries,
162756
+ /*equalityComparer*/
162757
+ void 0,
162673
162758
  /*allowDuplicates*/
162674
162759
  true
162675
162760
  );
@@ -162682,6 +162767,8 @@ function completionInfoFromData(sourceFile, host, program, compilerOptions, log,
162682
162767
  entries,
162683
162768
  literalEntry,
162684
162769
  compareCompletionEntries,
162770
+ /*equalityComparer*/
162771
+ void 0,
162685
162772
  /*allowDuplicates*/
162686
162773
  true
162687
162774
  );
@@ -163604,6 +163691,8 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con
163604
163691
  entries,
163605
163692
  entry,
163606
163693
  compareCompletionEntries,
163694
+ /*equalityComparer*/
163695
+ void 0,
163607
163696
  /*allowDuplicates*/
163608
163697
  true
163609
163698
  );
@@ -178201,6 +178290,7 @@ __export(ts_exports2, {
178201
178290
  defaultMaximumTruncationLength: () => defaultMaximumTruncationLength,
178202
178291
  diagnosticCategoryName: () => diagnosticCategoryName,
178203
178292
  diagnosticToString: () => diagnosticToString,
178293
+ diagnosticsEqualityComparer: () => diagnosticsEqualityComparer,
178204
178294
  directoryProbablyExists: () => directoryProbablyExists,
178205
178295
  directorySeparator: () => directorySeparator,
178206
178296
  displayPart: () => displayPart,
@@ -192627,6 +192717,7 @@ if (typeof console !== "undefined") {
192627
192717
  defaultMaximumTruncationLength,
192628
192718
  diagnosticCategoryName,
192629
192719
  diagnosticToString,
192720
+ diagnosticsEqualityComparer,
192630
192721
  directoryProbablyExists,
192631
192722
  directorySeparator,
192632
192723
  displayPart,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.5.0-dev.20240426",
5
+ "version": "5.5.0-dev.20240428",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -110,5 +110,5 @@
110
110
  "node": "20.1.0",
111
111
  "npm": "8.19.4"
112
112
  },
113
- "gitHead": "04963ee796dc3716e5c18a28a5950f4ca8b900e1"
113
+ "gitHead": "ebcb09d71a0838b4b9be974f9ef1e80fce8888af"
114
114
  }