@typescript-deploys/pr-build 5.2.0-pr-54891-7 → 5.2.0-pr-55034-8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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.2";
21
- var version = `${versionMajorMinor}.0-insiders.20230710`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230718`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -6118,7 +6118,6 @@ var Diagnostics = {
6118
6118
  The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),
6119
6119
  The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
6120
6120
  _0_modifier_cannot_appear_on_an_await_using_declaration: diag(1495, 1 /* Error */, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."),
6121
- Unexpected_token_Did_you_mean_0: diag(1496, 1 /* Error */, "Unexpected_token_Did_you_mean_0_1496", "Unexpected token. Did you mean '{0}'?"),
6122
6121
  The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
6123
6122
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
6124
6123
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -9156,10 +9155,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9156
9155
  case 33 /* exclamation */:
9157
9156
  if (text.charCodeAt(pos + 1) === 61 /* equals */) {
9158
9157
  if (text.charCodeAt(pos + 2) === 61 /* equals */) {
9159
- if (text.charCodeAt(pos + 3) === 61 /* equals */) {
9160
- error(Diagnostics.Unexpected_token_Did_you_mean_0, pos, 4, "!==");
9161
- return pos += 4, token = 38 /* ExclamationEqualsEqualsToken */;
9162
- }
9163
9158
  return pos += 3, token = 38 /* ExclamationEqualsEqualsToken */;
9164
9159
  }
9165
9160
  return pos += 2, token = 36 /* ExclamationEqualsToken */;
@@ -15530,7 +15525,7 @@ function isPrototypeAccess(node) {
15530
15525
  return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype";
15531
15526
  }
15532
15527
  function isRightSideOfQualifiedNameOrPropertyAccess(node) {
15533
- return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node;
15528
+ return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node || node.parent.kind === 236 /* MetaProperty */ && node.parent.name === node;
15534
15529
  }
15535
15530
  function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(node) {
15536
15531
  return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node || isJSDocMemberName(node.parent) && node.parent.right === node;
@@ -23892,7 +23887,7 @@ var addDisposableResourceHelper = {
23892
23887
  text: `
23893
23888
  var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
23894
23889
  if (value !== null && value !== void 0) {
23895
- if (typeof value !== "object") throw new TypeError("Object expected.");
23890
+ if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
23896
23891
  var dispose;
23897
23892
  if (async) {
23898
23893
  if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
@@ -63017,7 +63012,12 @@ function createTypeChecker(host) {
63017
63012
  callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i));
63018
63013
  }
63019
63014
  if (targetRestType) {
63020
- callback(getRestTypeAtPosition(source, paramCount), targetRestType);
63015
+ callback(getRestTypeAtPosition(
63016
+ source,
63017
+ paramCount,
63018
+ /*readonly*/
63019
+ isConstTypeVariable(targetRestType)
63020
+ ), targetRestType);
63021
63021
  }
63022
63022
  }
63023
63023
  function applyToReturnTypes(source, target, callback) {
@@ -72122,7 +72122,7 @@ function createTypeChecker(host) {
72122
72122
  }
72123
72123
  return void 0;
72124
72124
  }
72125
- function getRestTypeAtPosition(source, pos) {
72125
+ function getRestTypeAtPosition(source, pos, readonly) {
72126
72126
  const parameterCount = getParameterCount(source);
72127
72127
  const minArgumentCount = getMinArgumentCount(source);
72128
72128
  const restType = getEffectiveRestType(source);
@@ -72145,13 +72145,7 @@ function createTypeChecker(host) {
72145
72145
  names.push(name);
72146
72146
  }
72147
72147
  }
72148
- return createTupleType(
72149
- types,
72150
- flags,
72151
- /*readonly*/
72152
- false,
72153
- length(names) === length(types) ? names : void 0
72154
- );
72148
+ return createTupleType(types, flags, readonly, length(names) === length(types) ? names : void 0);
72155
72149
  }
72156
72150
  function getParameterCount(signature) {
72157
72151
  const length2 = signature.parameters.length;
@@ -76358,6 +76352,7 @@ function createTypeChecker(host) {
76358
76352
  for (const parameter of containingSignature.parameters) {
76359
76353
  markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
76360
76354
  }
76355
+ markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(containingSignature));
76361
76356
  break;
76362
76357
  }
76363
76358
  }
@@ -96786,10 +96781,10 @@ function transformJsx(context) {
96786
96781
  for (const prop of attr.expression.properties) {
96787
96782
  if (isSpreadAssignment(prop)) {
96788
96783
  finishObjectLiteralIfNeeded();
96789
- expressions.push(prop.expression);
96784
+ expressions.push(Debug.checkDefined(visitNode(prop.expression, visitor, isExpression)));
96790
96785
  continue;
96791
96786
  }
96792
- properties.push(prop);
96787
+ properties.push(Debug.checkDefined(visitNode(prop, visitor)));
96793
96788
  }
96794
96789
  continue;
96795
96790
  }
package/lib/tsserver.js CHANGED
@@ -2327,7 +2327,7 @@ module.exports = __toCommonJS(server_exports);
2327
2327
 
2328
2328
  // src/compiler/corePublic.ts
2329
2329
  var versionMajorMinor = "5.2";
2330
- var version = `${versionMajorMinor}.0-insiders.20230710`;
2330
+ var version = `${versionMajorMinor}.0-insiders.20230718`;
2331
2331
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2332
2332
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2333
2333
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -9639,7 +9639,6 @@ var Diagnostics = {
9639
9639
  The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),
9640
9640
  The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
9641
9641
  _0_modifier_cannot_appear_on_an_await_using_declaration: diag(1495, 1 /* Error */, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."),
9642
- Unexpected_token_Did_you_mean_0: diag(1496, 1 /* Error */, "Unexpected_token_Did_you_mean_0_1496", "Unexpected token. Did you mean '{0}'?"),
9643
9642
  The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
9644
9643
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
9645
9644
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -12698,10 +12697,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
12698
12697
  case 33 /* exclamation */:
12699
12698
  if (text.charCodeAt(pos + 1) === 61 /* equals */) {
12700
12699
  if (text.charCodeAt(pos + 2) === 61 /* equals */) {
12701
- if (text.charCodeAt(pos + 3) === 61 /* equals */) {
12702
- error2(Diagnostics.Unexpected_token_Did_you_mean_0, pos, 4, "!==");
12703
- return pos += 4, token = 38 /* ExclamationEqualsEqualsToken */;
12704
- }
12705
12700
  return pos += 3, token = 38 /* ExclamationEqualsEqualsToken */;
12706
12701
  }
12707
12702
  return pos += 2, token = 36 /* ExclamationEqualsToken */;
@@ -19518,7 +19513,7 @@ function isPrototypeAccess(node) {
19518
19513
  return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype";
19519
19514
  }
19520
19515
  function isRightSideOfQualifiedNameOrPropertyAccess(node) {
19521
- return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node;
19516
+ return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node || node.parent.kind === 236 /* MetaProperty */ && node.parent.name === node;
19522
19517
  }
19523
19518
  function isRightSideOfAccessExpression(node) {
19524
19519
  return isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node;
@@ -28156,7 +28151,7 @@ var addDisposableResourceHelper = {
28156
28151
  text: `
28157
28152
  var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
28158
28153
  if (value !== null && value !== void 0) {
28159
- if (typeof value !== "object") throw new TypeError("Object expected.");
28154
+ if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
28160
28155
  var dispose;
28161
28156
  if (async) {
28162
28157
  if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
@@ -67724,7 +67719,12 @@ function createTypeChecker(host) {
67724
67719
  callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i));
67725
67720
  }
67726
67721
  if (targetRestType) {
67727
- callback(getRestTypeAtPosition(source, paramCount), targetRestType);
67722
+ callback(getRestTypeAtPosition(
67723
+ source,
67724
+ paramCount,
67725
+ /*readonly*/
67726
+ isConstTypeVariable(targetRestType)
67727
+ ), targetRestType);
67728
67728
  }
67729
67729
  }
67730
67730
  function applyToReturnTypes(source, target, callback) {
@@ -76829,7 +76829,7 @@ function createTypeChecker(host) {
76829
76829
  }
76830
76830
  return void 0;
76831
76831
  }
76832
- function getRestTypeAtPosition(source, pos) {
76832
+ function getRestTypeAtPosition(source, pos, readonly) {
76833
76833
  const parameterCount = getParameterCount(source);
76834
76834
  const minArgumentCount = getMinArgumentCount(source);
76835
76835
  const restType = getEffectiveRestType(source);
@@ -76852,13 +76852,7 @@ function createTypeChecker(host) {
76852
76852
  names.push(name);
76853
76853
  }
76854
76854
  }
76855
- return createTupleType(
76856
- types,
76857
- flags,
76858
- /*readonly*/
76859
- false,
76860
- length(names) === length(types) ? names : void 0
76861
- );
76855
+ return createTupleType(types, flags, readonly, length(names) === length(types) ? names : void 0);
76862
76856
  }
76863
76857
  function getParameterCount(signature) {
76864
76858
  const length2 = signature.parameters.length;
@@ -81065,6 +81059,7 @@ function createTypeChecker(host) {
81065
81059
  for (const parameter of containingSignature.parameters) {
81066
81060
  markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
81067
81061
  }
81062
+ markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(containingSignature));
81068
81063
  break;
81069
81064
  }
81070
81065
  }
@@ -101664,10 +101659,10 @@ function transformJsx(context) {
101664
101659
  for (const prop of attr.expression.properties) {
101665
101660
  if (isSpreadAssignment(prop)) {
101666
101661
  finishObjectLiteralIfNeeded();
101667
- expressions.push(prop.expression);
101662
+ expressions.push(Debug.checkDefined(visitNode(prop.expression, visitor, isExpression)));
101668
101663
  continue;
101669
101664
  }
101670
- properties.push(prop);
101665
+ properties.push(Debug.checkDefined(visitNode(prop, visitor)));
101671
101666
  }
101672
101667
  continue;
101673
101668
  }
@@ -138066,7 +138061,7 @@ function getInliningInfo(file, startPosition, tryWithReferenceToken, program) {
138066
138061
  if (!isIdentifier(token)) {
138067
138062
  return void 0;
138068
138063
  }
138069
- if (isInitializedVariable(parent2) && isVariableDeclarationInVariableStatement(parent2)) {
138064
+ if (isInitializedVariable(parent2) && isVariableDeclarationInVariableStatement(parent2) && isIdentifier(parent2.name)) {
138070
138065
  if (((_a = checker.getMergedSymbol(parent2.symbol).declarations) == null ? void 0 : _a.length) !== 1) {
138071
138066
  return { error: getLocaleSpecificMessage(Diagnostics.Variables_with_multiple_declarations_cannot_be_inlined) };
138072
138067
  }
@@ -138357,7 +138352,7 @@ function getNewStatementsAndRemoveFromOldFile2(oldFile, targetFile, usage, chang
138357
138352
  }
138358
138353
  }
138359
138354
  if (importAdder) {
138360
- importAdder.writeFixes(changes);
138355
+ importAdder.writeFixes(changes, quotePreference);
138361
138356
  }
138362
138357
  if (imports.length && body.length) {
138363
138358
  return [
@@ -150050,8 +150045,13 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre
150050
150045
  return `${topLevelTypeOnly ? 1 : 0}|${moduleSpecifier}`;
150051
150046
  }
150052
150047
  }
150053
- function writeFixes(changeTracker) {
150054
- const quotePreference = getQuotePreference(sourceFile, preferences);
150048
+ function writeFixes(changeTracker, oldFileQuotePreference) {
150049
+ let quotePreference;
150050
+ if (sourceFile.imports.length === 0 && oldFileQuotePreference !== void 0) {
150051
+ quotePreference = oldFileQuotePreference;
150052
+ } else {
150053
+ quotePreference = getQuotePreference(sourceFile, preferences);
150054
+ }
150055
150055
  for (const fix of addToNamespace) {
150056
150056
  addNamespaceQualifier(changeTracker, sourceFile, fix);
150057
150057
  }
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-insiders.20230710`;
38
+ version = `${versionMajorMinor}.0-insiders.20230718`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -7422,7 +7422,6 @@ ${lanes.join("\n")}
7422
7422
  The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),
7423
7423
  The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
7424
7424
  _0_modifier_cannot_appear_on_an_await_using_declaration: diag(1495, 1 /* Error */, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."),
7425
- Unexpected_token_Did_you_mean_0: diag(1496, 1 /* Error */, "Unexpected_token_Did_you_mean_0_1496", "Unexpected token. Did you mean '{0}'?"),
7426
7425
  The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
7427
7426
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
7428
7427
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -10322,10 +10321,6 @@ ${lanes.join("\n")}
10322
10321
  case 33 /* exclamation */:
10323
10322
  if (text.charCodeAt(pos + 1) === 61 /* equals */) {
10324
10323
  if (text.charCodeAt(pos + 2) === 61 /* equals */) {
10325
- if (text.charCodeAt(pos + 3) === 61 /* equals */) {
10326
- error2(Diagnostics.Unexpected_token_Did_you_mean_0, pos, 4, "!==");
10327
- return pos += 4, token = 38 /* ExclamationEqualsEqualsToken */;
10328
- }
10329
10324
  return pos += 3, token = 38 /* ExclamationEqualsEqualsToken */;
10330
10325
  }
10331
10326
  return pos += 2, token = 36 /* ExclamationEqualsToken */;
@@ -17219,7 +17214,7 @@ ${lanes.join("\n")}
17219
17214
  return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype";
17220
17215
  }
17221
17216
  function isRightSideOfQualifiedNameOrPropertyAccess(node) {
17222
- return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node;
17217
+ return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node || node.parent.kind === 236 /* MetaProperty */ && node.parent.name === node;
17223
17218
  }
17224
17219
  function isRightSideOfAccessExpression(node) {
17225
17220
  return isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node;
@@ -26034,7 +26029,7 @@ ${lanes.join("\n")}
26034
26029
  text: `
26035
26030
  var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
26036
26031
  if (value !== null && value !== void 0) {
26037
- if (typeof value !== "object") throw new TypeError("Object expected.");
26032
+ if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
26038
26033
  var dispose;
26039
26034
  if (async) {
26040
26035
  if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
@@ -65491,7 +65486,12 @@ ${lanes.join("\n")}
65491
65486
  callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i));
65492
65487
  }
65493
65488
  if (targetRestType) {
65494
- callback(getRestTypeAtPosition(source, paramCount), targetRestType);
65489
+ callback(getRestTypeAtPosition(
65490
+ source,
65491
+ paramCount,
65492
+ /*readonly*/
65493
+ isConstTypeVariable(targetRestType)
65494
+ ), targetRestType);
65495
65495
  }
65496
65496
  }
65497
65497
  function applyToReturnTypes(source, target, callback) {
@@ -74596,7 +74596,7 @@ ${lanes.join("\n")}
74596
74596
  }
74597
74597
  return void 0;
74598
74598
  }
74599
- function getRestTypeAtPosition(source, pos) {
74599
+ function getRestTypeAtPosition(source, pos, readonly) {
74600
74600
  const parameterCount = getParameterCount(source);
74601
74601
  const minArgumentCount = getMinArgumentCount(source);
74602
74602
  const restType = getEffectiveRestType(source);
@@ -74619,13 +74619,7 @@ ${lanes.join("\n")}
74619
74619
  names.push(name);
74620
74620
  }
74621
74621
  }
74622
- return createTupleType(
74623
- types,
74624
- flags,
74625
- /*readonly*/
74626
- false,
74627
- length(names) === length(types) ? names : void 0
74628
- );
74622
+ return createTupleType(types, flags, readonly, length(names) === length(types) ? names : void 0);
74629
74623
  }
74630
74624
  function getParameterCount(signature) {
74631
74625
  const length2 = signature.parameters.length;
@@ -78832,6 +78826,7 @@ ${lanes.join("\n")}
78832
78826
  for (const parameter of containingSignature.parameters) {
78833
78827
  markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
78834
78828
  }
78829
+ markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(containingSignature));
78835
78830
  break;
78836
78831
  }
78837
78832
  }
@@ -99680,10 +99675,10 @@ ${lanes.join("\n")}
99680
99675
  for (const prop of attr.expression.properties) {
99681
99676
  if (isSpreadAssignment(prop)) {
99682
99677
  finishObjectLiteralIfNeeded();
99683
- expressions.push(prop.expression);
99678
+ expressions.push(Debug.checkDefined(visitNode(prop.expression, visitor, isExpression)));
99684
99679
  continue;
99685
99680
  }
99686
- properties.push(prop);
99681
+ properties.push(Debug.checkDefined(visitNode(prop, visitor)));
99687
99682
  }
99688
99683
  continue;
99689
99684
  }
@@ -136404,7 +136399,7 @@ ${lanes.join("\n")}
136404
136399
  if (!isIdentifier(token)) {
136405
136400
  return void 0;
136406
136401
  }
136407
- if (isInitializedVariable(parent2) && isVariableDeclarationInVariableStatement(parent2)) {
136402
+ if (isInitializedVariable(parent2) && isVariableDeclarationInVariableStatement(parent2) && isIdentifier(parent2.name)) {
136408
136403
  if (((_a = checker.getMergedSymbol(parent2.symbol).declarations) == null ? void 0 : _a.length) !== 1) {
136409
136404
  return { error: getLocaleSpecificMessage(Diagnostics.Variables_with_multiple_declarations_cannot_be_inlined) };
136410
136405
  }
@@ -136732,7 +136727,7 @@ ${lanes.join("\n")}
136732
136727
  }
136733
136728
  }
136734
136729
  if (importAdder) {
136735
- importAdder.writeFixes(changes);
136730
+ importAdder.writeFixes(changes, quotePreference);
136736
136731
  }
136737
136732
  if (imports.length && body.length) {
136738
136733
  return [
@@ -148780,8 +148775,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
148780
148775
  return `${topLevelTypeOnly ? 1 : 0}|${moduleSpecifier}`;
148781
148776
  }
148782
148777
  }
148783
- function writeFixes(changeTracker) {
148784
- const quotePreference = getQuotePreference(sourceFile, preferences);
148778
+ function writeFixes(changeTracker, oldFileQuotePreference) {
148779
+ let quotePreference;
148780
+ if (sourceFile.imports.length === 0 && oldFileQuotePreference !== void 0) {
148781
+ quotePreference = oldFileQuotePreference;
148782
+ } else {
148783
+ quotePreference = getQuotePreference(sourceFile, preferences);
148784
+ }
148785
148785
  for (const fix of addToNamespace) {
148786
148786
  addNamespaceQualifier(changeTracker, sourceFile, fix);
148787
148787
  }
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-insiders.20230710`;
38
+ version = `${versionMajorMinor}.0-insiders.20230718`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -7422,7 +7422,6 @@ ${lanes.join("\n")}
7422
7422
  The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),
7423
7423
  The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
7424
7424
  _0_modifier_cannot_appear_on_an_await_using_declaration: diag(1495, 1 /* Error */, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."),
7425
- Unexpected_token_Did_you_mean_0: diag(1496, 1 /* Error */, "Unexpected_token_Did_you_mean_0_1496", "Unexpected token. Did you mean '{0}'?"),
7426
7425
  The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
7427
7426
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
7428
7427
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -10322,10 +10321,6 @@ ${lanes.join("\n")}
10322
10321
  case 33 /* exclamation */:
10323
10322
  if (text.charCodeAt(pos + 1) === 61 /* equals */) {
10324
10323
  if (text.charCodeAt(pos + 2) === 61 /* equals */) {
10325
- if (text.charCodeAt(pos + 3) === 61 /* equals */) {
10326
- error2(Diagnostics.Unexpected_token_Did_you_mean_0, pos, 4, "!==");
10327
- return pos += 4, token = 38 /* ExclamationEqualsEqualsToken */;
10328
- }
10329
10324
  return pos += 3, token = 38 /* ExclamationEqualsEqualsToken */;
10330
10325
  }
10331
10326
  return pos += 2, token = 36 /* ExclamationEqualsToken */;
@@ -17219,7 +17214,7 @@ ${lanes.join("\n")}
17219
17214
  return isBindableStaticAccessExpression(node) && getElementOrPropertyAccessName(node) === "prototype";
17220
17215
  }
17221
17216
  function isRightSideOfQualifiedNameOrPropertyAccess(node) {
17222
- return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node;
17217
+ return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node || node.parent.kind === 236 /* MetaProperty */ && node.parent.name === node;
17223
17218
  }
17224
17219
  function isRightSideOfAccessExpression(node) {
17225
17220
  return isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node;
@@ -26034,7 +26029,7 @@ ${lanes.join("\n")}
26034
26029
  text: `
26035
26030
  var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
26036
26031
  if (value !== null && value !== void 0) {
26037
- if (typeof value !== "object") throw new TypeError("Object expected.");
26032
+ if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
26038
26033
  var dispose;
26039
26034
  if (async) {
26040
26035
  if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
@@ -65491,7 +65486,12 @@ ${lanes.join("\n")}
65491
65486
  callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i));
65492
65487
  }
65493
65488
  if (targetRestType) {
65494
- callback(getRestTypeAtPosition(source, paramCount), targetRestType);
65489
+ callback(getRestTypeAtPosition(
65490
+ source,
65491
+ paramCount,
65492
+ /*readonly*/
65493
+ isConstTypeVariable(targetRestType)
65494
+ ), targetRestType);
65495
65495
  }
65496
65496
  }
65497
65497
  function applyToReturnTypes(source, target, callback) {
@@ -74596,7 +74596,7 @@ ${lanes.join("\n")}
74596
74596
  }
74597
74597
  return void 0;
74598
74598
  }
74599
- function getRestTypeAtPosition(source, pos) {
74599
+ function getRestTypeAtPosition(source, pos, readonly) {
74600
74600
  const parameterCount = getParameterCount(source);
74601
74601
  const minArgumentCount = getMinArgumentCount(source);
74602
74602
  const restType = getEffectiveRestType(source);
@@ -74619,13 +74619,7 @@ ${lanes.join("\n")}
74619
74619
  names.push(name);
74620
74620
  }
74621
74621
  }
74622
- return createTupleType(
74623
- types,
74624
- flags,
74625
- /*readonly*/
74626
- false,
74627
- length(names) === length(types) ? names : void 0
74628
- );
74622
+ return createTupleType(types, flags, readonly, length(names) === length(types) ? names : void 0);
74629
74623
  }
74630
74624
  function getParameterCount(signature) {
74631
74625
  const length2 = signature.parameters.length;
@@ -78832,6 +78826,7 @@ ${lanes.join("\n")}
78832
78826
  for (const parameter of containingSignature.parameters) {
78833
78827
  markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter));
78834
78828
  }
78829
+ markDecoratorMedataDataTypeNodeAsReferenced(getEffectiveReturnTypeNode(containingSignature));
78835
78830
  break;
78836
78831
  }
78837
78832
  }
@@ -99680,10 +99675,10 @@ ${lanes.join("\n")}
99680
99675
  for (const prop of attr.expression.properties) {
99681
99676
  if (isSpreadAssignment(prop)) {
99682
99677
  finishObjectLiteralIfNeeded();
99683
- expressions.push(prop.expression);
99678
+ expressions.push(Debug.checkDefined(visitNode(prop.expression, visitor, isExpression)));
99684
99679
  continue;
99685
99680
  }
99686
- properties.push(prop);
99681
+ properties.push(Debug.checkDefined(visitNode(prop, visitor)));
99687
99682
  }
99688
99683
  continue;
99689
99684
  }
@@ -136419,7 +136414,7 @@ ${lanes.join("\n")}
136419
136414
  if (!isIdentifier(token)) {
136420
136415
  return void 0;
136421
136416
  }
136422
- if (isInitializedVariable(parent2) && isVariableDeclarationInVariableStatement(parent2)) {
136417
+ if (isInitializedVariable(parent2) && isVariableDeclarationInVariableStatement(parent2) && isIdentifier(parent2.name)) {
136423
136418
  if (((_a = checker.getMergedSymbol(parent2.symbol).declarations) == null ? void 0 : _a.length) !== 1) {
136424
136419
  return { error: getLocaleSpecificMessage(Diagnostics.Variables_with_multiple_declarations_cannot_be_inlined) };
136425
136420
  }
@@ -136747,7 +136742,7 @@ ${lanes.join("\n")}
136747
136742
  }
136748
136743
  }
136749
136744
  if (importAdder) {
136750
- importAdder.writeFixes(changes);
136745
+ importAdder.writeFixes(changes, quotePreference);
136751
136746
  }
136752
136747
  if (imports.length && body.length) {
136753
136748
  return [
@@ -148795,8 +148790,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
148795
148790
  return `${topLevelTypeOnly ? 1 : 0}|${moduleSpecifier}`;
148796
148791
  }
148797
148792
  }
148798
- function writeFixes(changeTracker) {
148799
- const quotePreference = getQuotePreference(sourceFile, preferences);
148793
+ function writeFixes(changeTracker, oldFileQuotePreference) {
148794
+ let quotePreference;
148795
+ if (sourceFile.imports.length === 0 && oldFileQuotePreference !== void 0) {
148796
+ quotePreference = oldFileQuotePreference;
148797
+ } else {
148798
+ quotePreference = getQuotePreference(sourceFile, preferences);
148799
+ }
148800
148800
  for (const fix of addToNamespace) {
148801
148801
  addNamespaceQualifier(changeTracker, sourceFile, fix);
148802
148802
  }
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.2";
57
- var version = `${versionMajorMinor}.0-insiders.20230710`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230718`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -5492,7 +5492,6 @@ var Diagnostics = {
5492
5492
  The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),
5493
5493
  The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
5494
5494
  _0_modifier_cannot_appear_on_an_await_using_declaration: diag(1495, 1 /* Error */, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."),
5495
- Unexpected_token_Did_you_mean_0: diag(1496, 1 /* Error */, "Unexpected_token_Did_you_mean_0_1496", "Unexpected token. Did you mean '{0}'?"),
5496
5495
  The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
5497
5496
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
5498
5497
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -8473,10 +8472,6 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8473
8472
  case 33 /* exclamation */:
8474
8473
  if (text.charCodeAt(pos + 1) === 61 /* equals */) {
8475
8474
  if (text.charCodeAt(pos + 2) === 61 /* equals */) {
8476
- if (text.charCodeAt(pos + 3) === 61 /* equals */) {
8477
- error(Diagnostics.Unexpected_token_Did_you_mean_0, pos, 4, "!==");
8478
- return pos += 4, token = 38 /* ExclamationEqualsEqualsToken */;
8479
- }
8480
8475
  return pos += 3, token = 38 /* ExclamationEqualsEqualsToken */;
8481
8476
  }
8482
8477
  return pos += 2, token = 36 /* ExclamationEqualsToken */;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.2.0-pr-54891-7",
5
+ "version": "5.2.0-pr-55034-8",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -40,7 +40,7 @@
40
40
  ],
41
41
  "devDependencies": {
42
42
  "@esfx/canceltoken": "^1.0.0",
43
- "@octokit/rest": "latest",
43
+ "@octokit/rest": "^19.0.13",
44
44
  "@types/chai": "^4.3.4",
45
45
  "@types/fs-extra": "^9.0.13",
46
46
  "@types/glob": "^8.1.0",
@@ -51,9 +51,9 @@
51
51
  "@types/node": "latest",
52
52
  "@types/source-map-support": "^0.5.6",
53
53
  "@types/which": "^2.0.1",
54
- "@typescript-eslint/eslint-plugin": "^5.33.1",
55
- "@typescript-eslint/parser": "^5.33.1",
56
- "@typescript-eslint/utils": "^5.33.1",
54
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
55
+ "@typescript-eslint/parser": "^6.0.0",
56
+ "@typescript-eslint/utils": "^6.0.0",
57
57
  "azure-devops-node-api": "^12.0.0",
58
58
  "c8": "^7.14.0",
59
59
  "chai": "^4.3.7",
@@ -64,7 +64,6 @@
64
64
  "esbuild": "^0.18.1",
65
65
  "eslint": "^8.22.0",
66
66
  "eslint-formatter-autolinkable-stylish": "^1.2.0",
67
- "eslint-plugin-import": "^2.26.0",
68
67
  "eslint-plugin-local": "^1.0.0",
69
68
  "eslint-plugin-no-null": "^1.0.2",
70
69
  "eslint-plugin-simple-import-sort": "^10.0.0",
@@ -115,5 +114,5 @@
115
114
  "node": "20.1.0",
116
115
  "npm": "8.19.4"
117
116
  },
118
- "gitHead": "10d90775d78339c5ac584cfad4943b07e0f2c868"
117
+ "gitHead": "2842e44bf3f80d0459b1687e4d236d03aa9a3b17"
119
118
  }