diff --git a/package-lock.json b/package-lock.json
index 7eaf992be67..46831288f2d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -638,9 +638,9 @@
"dev": true
},
"@types/node": {
- "version": "17.0.29",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.29.tgz",
- "integrity": "sha512-tx5jMmMFwx7wBwq/V7OohKDVb/JwJU5qCVkeLMh1//xycAJ/ESuw9aJ9SEtlCZDYi2pBfe4JkisSoAtbOsBNAA==",
+ "version": "17.0.31",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.31.tgz",
+ "integrity": "sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==",
"dev": true
},
"@types/node-fetch": {
@@ -3334,12 +3334,6 @@
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
"dev": true
},
- "growl": {
- "version": "1.10.5",
- "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
- "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
- "dev": true
- },
"gulp": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz",
@@ -4328,32 +4322,30 @@
"dev": true
},
"mocha": {
- "version": "9.2.2",
- "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz",
- "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==",
+ "version": "10.0.0",
+ "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.0.0.tgz",
+ "integrity": "sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==",
"dev": true,
"requires": {
"@ungap/promise-all-settled": "1.1.2",
"ansi-colors": "4.1.1",
"browser-stdout": "1.3.1",
"chokidar": "3.5.3",
- "debug": "4.3.3",
+ "debug": "4.3.4",
"diff": "5.0.0",
"escape-string-regexp": "4.0.0",
"find-up": "5.0.0",
"glob": "7.2.0",
- "growl": "1.10.5",
"he": "1.2.0",
"js-yaml": "4.1.0",
"log-symbols": "4.1.0",
- "minimatch": "4.2.1",
+ "minimatch": "5.0.1",
"ms": "2.1.3",
- "nanoid": "3.3.1",
+ "nanoid": "3.3.3",
"serialize-javascript": "6.0.0",
"strip-json-comments": "3.1.1",
"supports-color": "8.1.1",
- "which": "2.0.2",
- "workerpool": "6.2.0",
+ "workerpool": "6.2.1",
"yargs": "16.2.0",
"yargs-parser": "20.2.4",
"yargs-unparser": "2.0.0"
@@ -4430,9 +4422,9 @@
}
},
"debug": {
- "version": "4.3.3",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
- "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
+ "version": "4.3.4",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
+ "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
"dev": true,
"requires": {
"ms": "2.1.2"
@@ -4570,12 +4562,23 @@
}
},
"minimatch": {
- "version": "4.2.1",
- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz",
- "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==",
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz",
+ "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==",
"dev": true,
"requires": {
- "brace-expansion": "^1.1.7"
+ "brace-expansion": "^2.0.1"
+ },
+ "dependencies": {
+ "brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "dev": true,
+ "requires": {
+ "balanced-match": "^1.0.0"
+ }
+ }
}
},
"p-limit": {
@@ -4651,15 +4654,6 @@
"is-number": "^7.0.0"
}
},
- "which": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
- "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
- "dev": true,
- "requires": {
- "isexe": "^2.0.0"
- }
- },
"wrap-ansi": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
@@ -4726,9 +4720,9 @@
"optional": true
},
"nanoid": {
- "version": "3.3.1",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz",
- "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==",
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz",
+ "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==",
"dev": true
},
"nanomatch": {
@@ -6685,9 +6679,9 @@
"dev": true
},
"workerpool": {
- "version": "6.2.0",
- "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz",
- "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==",
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz",
+ "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==",
"dev": true
},
"wrap-ansi": {
diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index 1506c4809ef..5efefc51d24 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -38250,7 +38250,7 @@ namespace ts {
return (use & IterationUse.PossiblyOutOfBounds) ? includeUndefinedInIndexSignature(arrayElementType) : arrayElementType;
- function getIterationDiagnosticDetails(allowsStrings: boolean, downlevelIteration: boolean | undefined): [DiagnosticMessage, boolean] {
+ function getIterationDiagnosticDetails(allowsStrings: boolean, downlevelIteration: boolean | undefined): [error: DiagnosticMessage, maybeMissingAwait: boolean] {
if (downlevelIteration) {
return allowsStrings
? [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true]
@@ -38260,7 +38260,7 @@ namespace ts {
const yieldType = getIterationTypeOfIterable(use, IterationTypeKind.Yield, inputType, /*errorNode*/ undefined);
if (yieldType) {
- return [Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, false];
+ return [Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, false];
}
if (isES2015OrLaterIterable(inputType.symbol?.escapedName)) {
@@ -41898,7 +41898,7 @@ namespace ts {
const symbol = getIntrinsicTagSymbol(name.parent as JsxOpeningLikeElement);
return symbol === unknownSymbol ? undefined : symbol;
}
- const result = resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ !isJSDoc, getHostSignatureFromJSDoc(name));
+ const result = resolveEntityName(name, meaning, /*ignoreErrors*/ false, /* dontResolveAlias */ true, getHostSignatureFromJSDoc(name));
if (!result && isJSDoc) {
const container = findAncestor(name, or(isClassLike, isInterfaceDeclaration));
if (container) {
@@ -43901,6 +43901,9 @@ namespace ts {
}
function checkGrammarExpressionWithTypeArguments(node: ExpressionWithTypeArguments | TypeQueryNode) {
+ if (isExpressionWithTypeArguments(node) && isImportKeyword(node.expression) && node.typeArguments) {
+ return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
+ }
return checkGrammarTypeArguments(node, node.typeArguments);
}
@@ -44951,7 +44954,7 @@ namespace ts {
}
if (node.typeArguments) {
- return grammarErrorOnNode(node, Diagnostics.Dynamic_import_cannot_have_type_arguments);
+ return grammarErrorOnNode(node, Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
}
const nodeArguments = node.arguments;
diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json
index 44fed63932d..22c923012aa 100644
--- a/src/compiler/diagnosticMessages.json
+++ b/src/compiler/diagnosticMessages.json
@@ -956,7 +956,7 @@
"category": "Error",
"code": 1325
},
- "Dynamic import cannot have type arguments.": {
+ "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.": {
"category": "Error",
"code": 1326
},
@@ -2511,10 +2511,7 @@
"category": "Error",
"code": 2568
},
- "Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.": {
- "category": "Error",
- "code": 2569
- },
+
"Could not find name '{0}'. Did you mean '{1}'?": {
"category": "Error",
"code": 2570
diff --git a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 61a90c1c4d7..b20a7942045 100644
--- a/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -5349,18 +5349,6 @@
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -5997,6 +5985,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13740,6 +13737,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13977,15 +13983,6 @@
- -
-
-
-
-
-
-
-
-
-
diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 22eb8d6477c..f6b570fc6ff 100644
--- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -5349,18 +5349,6 @@
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -5997,6 +5985,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13740,6 +13737,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13977,15 +13983,6 @@
- -
-
-
-
-
-
-
-
-
-
diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 1647e0bb4d6..f614e8f1932 100644
--- a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -5358,18 +5358,6 @@
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -6006,6 +5994,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13749,6 +13746,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13986,15 +13992,6 @@
- -
-
-
-
-
-
-
-
-
-
diff --git a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl
index c64af472bcb..33b4db6a78c 100644
--- a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -5346,18 +5346,6 @@
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -5994,6 +5982,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13734,6 +13731,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13971,15 +13977,6 @@
- -
-
-
-
-
-
-
-
-
-
diff --git a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl
index b6c18f4a981..0892782e82d 100644
--- a/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -5361,18 +5361,6 @@
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -6009,6 +5997,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13752,6 +13749,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13989,15 +13995,6 @@
- -
-
-
-
-
-
-
-
-
-
diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl
index bd874578a99..e2263e2549d 100644
--- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -5361,18 +5361,6 @@
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -6009,6 +5997,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13752,6 +13749,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13989,15 +13995,6 @@
- -
-
-
-
-
-
-
-
-
-
diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl
index c626ecc1200..372de213b24 100644
--- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -5349,18 +5349,6 @@
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -5997,6 +5985,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13740,6 +13737,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13977,15 +13983,6 @@
- -
-
-
-
-
-
-
-
-
-
diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl
index beb4187452a..e222b1f13d7 100644
--- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -5349,18 +5349,6 @@
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -5997,6 +5985,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13740,6 +13737,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13977,15 +13983,6 @@
- -
-
-
-
-
-
-
-
-
-
diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 76e9e04018e..fb0bd7b0c44 100644
--- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -5349,18 +5349,6 @@
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -5997,6 +5985,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13740,6 +13737,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13977,15 +13983,6 @@
- -
-
-
-
-
-
-
-
-
-
diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 1e9219f3e25..102654a92b6 100644
--- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -5339,18 +5339,6 @@
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -5987,6 +5975,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13727,6 +13724,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13964,15 +13970,6 @@
- -
-
-
-
-
-
-
-
-
-
diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 1508ab03620..303d5413039 100644
--- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -5342,18 +5342,6 @@
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -5990,6 +5978,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13730,6 +13727,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13967,15 +13973,6 @@
- -
-
-
-
-
-
-
-
-
-
diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 5dfe3d58385..2e8bc37a128 100644
--- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -5348,18 +5348,6 @@
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -5996,6 +5984,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13739,6 +13736,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13976,15 +13982,6 @@
- -
-
-
-
-
-
-
-
-
-
diff --git a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 280067f85e8..9ae2836efbf 100644
--- a/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/trk/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -5342,18 +5342,6 @@
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -5990,6 +5978,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13733,6 +13730,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -13970,15 +13976,6 @@
- -
-
-
-
-
-
-
-
-
-
diff --git a/src/services/codefixes/addMissingAwait.ts b/src/services/codefixes/addMissingAwait.ts
index 1a9110227e5..d8b16cd4e54 100644
--- a/src/services/codefixes/addMissingAwait.ts
+++ b/src/services/codefixes/addMissingAwait.ts
@@ -17,7 +17,7 @@ namespace ts.codefix {
Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined.code,
Diagnostics.Type_0_is_not_an_array_type.code,
Diagnostics.Type_0_is_not_an_array_type_or_a_string_type.code,
- Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators.code,
+ Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher.code,
Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,
Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,
Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code,
diff --git a/tests/baselines/reference/ES5For-ofTypeCheck13.errors.txt b/tests/baselines/reference/ES5For-ofTypeCheck13.errors.txt
index b64781a4873..4d680b362ac 100644
--- a/tests/baselines/reference/ES5For-ofTypeCheck13.errors.txt
+++ b/tests/baselines/reference/ES5For-ofTypeCheck13.errors.txt
@@ -1,4 +1,4 @@
-tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck13.ts(4,19): error TS2569: Type 'Set' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.
+tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck13.ts(4,19): error TS2802: Type 'Set' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck13.ts (1 errors) ====
@@ -7,4 +7,4 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck13.ts(4,19
strSet.add('World')
for (const str of strSet) { }
~~~~~~
-!!! error TS2569: Type 'Set' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.
\ No newline at end of file
+!!! error TS2802: Type 'Set' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
\ No newline at end of file
diff --git a/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt b/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt
index 1fde67722db..e815c53e2f3 100644
--- a/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt
+++ b/tests/baselines/reference/ES5For-ofTypeCheck14.errors.txt
@@ -1,8 +1,8 @@
-tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts(2,17): error TS2569: Type 'Set' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.
+tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts(2,17): error TS2802: Type 'Set' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck14.ts (1 errors) ====
var union: string | Set
for (const e of union) { }
~~~~~
-!!! error TS2569: Type 'Set' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators.
\ No newline at end of file
+!!! error TS2802: Type 'Set' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
\ No newline at end of file
diff --git a/tests/baselines/reference/importCallExpressionWithTypeArgument.errors.txt b/tests/baselines/reference/importCallExpressionWithTypeArgument.errors.txt
index 65b8a2d631e..53920e46540 100644
--- a/tests/baselines/reference/importCallExpressionWithTypeArgument.errors.txt
+++ b/tests/baselines/reference/importCallExpressionWithTypeArgument.errors.txt
@@ -1,5 +1,5 @@
-tests/cases/conformance/dynamicImport/1.ts(2,10): error TS1326: Dynamic import cannot have type arguments.
-tests/cases/conformance/dynamicImport/1.ts(3,10): error TS1326: Dynamic import cannot have type arguments.
+tests/cases/conformance/dynamicImport/1.ts(2,10): error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.
+tests/cases/conformance/dynamicImport/1.ts(3,10): error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.
==== tests/cases/conformance/dynamicImport/0.ts (0 errors) ====
@@ -9,7 +9,7 @@ tests/cases/conformance/dynamicImport/1.ts(3,10): error TS1326: Dynamic import c
"use strict"
var p1 = import>("./0"); // error
~~~~~~~~~~~~~~~~~~~~~~~~~~~
-!!! error TS1326: Dynamic import cannot have type arguments.
+!!! error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.
var p2 = import<>("./0"); // error
~~~~~~~~~~~~~~~
-!!! error TS1326: Dynamic import cannot have type arguments.
\ No newline at end of file
+!!! error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.
\ No newline at end of file
diff --git a/tests/baselines/reference/importWithTypeArguments.errors.txt b/tests/baselines/reference/importWithTypeArguments.errors.txt
new file mode 100644
index 00000000000..2981a63bec7
--- /dev/null
+++ b/tests/baselines/reference/importWithTypeArguments.errors.txt
@@ -0,0 +1,12 @@
+tests/cases/conformance/types/import/importWithTypeArguments.ts(1,1): error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.
+tests/cases/conformance/types/import/importWithTypeArguments.ts(2,11): error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.
+
+
+==== tests/cases/conformance/types/import/importWithTypeArguments.ts (2 errors) ====
+ import
+ ~~~~~~~~~
+!!! error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.
+ const a = import
+ ~~~~~~~~~~~~~~~~~~~~~~
+!!! error TS1326: This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments.
+
\ No newline at end of file
diff --git a/tests/baselines/reference/importWithTypeArguments.js b/tests/baselines/reference/importWithTypeArguments.js
new file mode 100644
index 00000000000..9a54a823050
--- /dev/null
+++ b/tests/baselines/reference/importWithTypeArguments.js
@@ -0,0 +1,8 @@
+//// [importWithTypeArguments.ts]
+import
+const a = import
+
+
+//// [importWithTypeArguments.js]
+import;
+var a = (import);
diff --git a/tests/baselines/reference/importWithTypeArguments.symbols b/tests/baselines/reference/importWithTypeArguments.symbols
new file mode 100644
index 00000000000..5f769bb1978
--- /dev/null
+++ b/tests/baselines/reference/importWithTypeArguments.symbols
@@ -0,0 +1,7 @@
+=== tests/cases/conformance/types/import/importWithTypeArguments.ts ===
+import
+>T : Symbol(T)
+
+const a = import
+>a : Symbol(a, Decl(importWithTypeArguments.ts, 1, 5))
+
diff --git a/tests/baselines/reference/importWithTypeArguments.types b/tests/baselines/reference/importWithTypeArguments.types
new file mode 100644
index 00000000000..442b3cc9ed9
--- /dev/null
+++ b/tests/baselines/reference/importWithTypeArguments.types
@@ -0,0 +1,5 @@
+=== tests/cases/conformance/types/import/importWithTypeArguments.ts ===
+import
+const a = import
+>a : any
+
diff --git a/tests/baselines/reference/jsdocLink3.baseline b/tests/baselines/reference/jsdocLink3.baseline
index da1a6fa0cfb..039d48a13af 100644
--- a/tests/baselines/reference/jsdocLink3.baseline
+++ b/tests/baselines/reference/jsdocLink3.baseline
@@ -59,10 +59,10 @@
"text": "C",
"kind": "linkName",
"target": {
- "fileName": "/jsdocLink3.ts",
+ "fileName": "/module1.ts",
"textSpan": {
- "start": 0,
- "length": 18
+ "start": 9,
+ "length": 1
}
}
},
@@ -87,10 +87,10 @@
"text": "C",
"kind": "linkName",
"target": {
- "fileName": "/jsdocLink3.ts",
+ "fileName": "/module1.ts",
"textSpan": {
- "start": 0,
- "length": 18
+ "start": 9,
+ "length": 1
}
}
},
@@ -110,10 +110,10 @@
"text": "C()",
"kind": "linkName",
"target": {
- "fileName": "/jsdocLink3.ts",
+ "fileName": "/module1.ts",
"textSpan": {
- "start": 0,
- "length": 18
+ "start": 9,
+ "length": 1
}
}
},
@@ -133,10 +133,10 @@
"text": "C",
"kind": "linkName",
"target": {
- "fileName": "/jsdocLink3.ts",
+ "fileName": "/module1.ts",
"textSpan": {
- "start": 0,
- "length": 18
+ "start": 9,
+ "length": 1
}
}
},
@@ -181,10 +181,10 @@
"text": "C",
"kind": "linkName",
"target": {
- "fileName": "/jsdocLink3.ts",
+ "fileName": "/module1.ts",
"textSpan": {
- "start": 0,
- "length": 18
+ "start": 9,
+ "length": 1
}
}
},
diff --git a/tests/cases/conformance/types/import/importWithTypeArguments.ts b/tests/cases/conformance/types/import/importWithTypeArguments.ts
new file mode 100644
index 00000000000..684260429c2
--- /dev/null
+++ b/tests/cases/conformance/types/import/importWithTypeArguments.ts
@@ -0,0 +1,2 @@
+import
+const a = import
diff --git a/tests/cases/fourslash/organizeImports10.ts b/tests/cases/fourslash/organizeImports10.ts
new file mode 100644
index 00000000000..de1acf551ee
--- /dev/null
+++ b/tests/cases/fourslash/organizeImports10.ts
@@ -0,0 +1,18 @@
+///
+
+// @Filename: /module.ts
+////import type { ZodType } from './declaration';
+////
+/////** Intended to be used in combination with {@link ZodType} */
+////export function fun() { /* ... */ }
+
+// @Filename: /declaration.ts
+//// type ZodType = {};
+//// export type { ZodType }
+
+
+verify.organizeImports(`import type { ZodType } from './declaration';
+
+/** Intended to be used in combination with {@link ZodType} */
+export function fun() { /* ... */ }`
+);
diff --git a/tests/cases/fourslash/organizeImports11.ts b/tests/cases/fourslash/organizeImports11.ts
new file mode 100644
index 00000000000..d2ba946ef82
--- /dev/null
+++ b/tests/cases/fourslash/organizeImports11.ts
@@ -0,0 +1,62 @@
+///
+
+// @Filename: /test.ts
+////import { TypeA, TypeB, TypeC, UnreferencedType } from './my-types';
+////
+/////**
+//// * MyClass {@link TypeA}
+//// */
+////export class MyClass {
+////
+//// /**
+//// * Some Property {@link TypeB}
+//// */
+//// public something;
+////
+//// /**
+//// * Some function {@link TypeC}
+//// */
+//// public myMethod() {
+////
+//// /**
+//// * Some lambda function {@link TypeC}
+//// */
+//// const someFunction = () => {
+//// return '';
+//// }
+//// someFunction();
+//// }
+////}
+
+// @Filename: /my-types.ts
+//// export type TypeA = string;
+//// export class TypeB { }
+//// export type TypeC = () => string;
+
+verify.organizeImports(`import { TypeA, TypeB, TypeC } from './my-types';
+
+/**
+ * MyClass {@link TypeA}
+ */
+export class MyClass {
+
+ /**
+ * Some Property {@link TypeB}
+ */
+ public something;
+
+ /**
+ * Some function {@link TypeC}
+ */
+ public myMethod() {
+
+ /**
+ * Some lambda function {@link TypeC}
+ */
+ const someFunction = () => {
+ return '';
+ }
+ someFunction();
+ }
+}`
+);
\ No newline at end of file