You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add type-only support for export declarations
* Use a synthetic type alias instead of binding type-only exports as a type alias
* Works for re-exports!
* isolatedModules works fine
* Diagnostic for type-only exporting a value
* Start isolated modules codefix
* Update for LKG control flow changes
* Type-only import clause parsing
* Type-only default import checking
* Type-only named imports
* Fix isolated modules error
* Filter namespaces down to type-only
* Fix class references
* Test nested namespaces
* Test circular type-only imports/exports
* Fix getTypeAtLocation for type-only import/export specifiers
* Fix type-only generic imports
* Update public APIs
* Remove unused WIP comment
* Type-only namespace imports
* Fix factory update calls
* Add grammar errors for JS usage and mixing default and named bindings
* Update updateExportDeclaration API baseline
* Fix grammar checking import clauses
* Enums, sort of
* Dedicated error for type-only enum
* Skip past type-only alias symbols in quick info
* Update error code in baseline
* WIP: convertToTypeOnlyExport
* isolatedModules codefix (single export declaration)
* isolatedModules code fix (all)
* Stop eliding non-type-only imports by default, add compiler flag
* Update to match updated diagnostic messages
* Update more baselines
* Update more tests
* Auto-import as type-only
* Add codefix for splitting type-only import with default and named bindings
* Add more services tests
* Add targeted error message for "export type T;" when T exists
* Add targeted error for "import type T = require(...)"
* Flip emit flag
* Add test for preserveUnusedImports option
* Fix flag flip on import =
* Make compiler option string-valued
* Fix merge conflicts
* Add --importsNotUsedAsValue=error
* Phrasing of messages.
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
// export type T; - may have meant export type { T }?
523
+
relatedInformation.push(createDiagnosticForNode(node,Diagnostics.Did_you_mean_0,`export type { ${unescapeLeadingUnderscores(node.name.escapedText)} }`));
Copy file name to clipboardExpand all lines: src/compiler/diagnosticMessages.json
+58-2Lines changed: 58 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -639,7 +639,7 @@
639
639
"category": "Error",
640
640
"code": 1203
641
641
},
642
-
"Cannot re-export a type when the '--isolatedModules' flag is provided.": {
642
+
"Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.": {
643
643
"category": "Error",
644
644
"code": 1205
645
645
},
@@ -1059,10 +1059,66 @@
1059
1059
"category": "Error",
1060
1060
"code": 1360
1061
1061
},
1062
-
"'await' outside of an async function is only allowed at the top level of a module when '--module' is 'esnext' or 'system' and '--target' is 'es2017' or higher.": {
1062
+
"Type-only {0} must reference a type, but '{1}' is a value.": {
1063
1063
"category": "Error",
1064
1064
"code": 1361
1065
1065
},
1066
+
"Enum '{0}' cannot be used as a value because only its type has been imported.": {
1067
+
"category": "Error",
1068
+
"code": 1362
1069
+
},
1070
+
"A type-only import can specify a default import or named bindings, but not both.": {
1071
+
"category": "Error",
1072
+
"code": 1363
1073
+
},
1074
+
"Convert to type-only export": {
1075
+
"category": "Message",
1076
+
"code": 1364
1077
+
},
1078
+
"Convert all re-exported types to type-only exports": {
1079
+
"category": "Message",
1080
+
"code": 1365
1081
+
},
1082
+
"Split into two separate import declarations": {
1083
+
"category": "Message",
1084
+
"code": 1366
1085
+
},
1086
+
"Split all invalid type-only imports": {
1087
+
"category": "Message",
1088
+
"code": 1377
1089
+
},
1090
+
"Specify emit/checking behavior for imports that are only used for types": {
1091
+
"category": "Message",
1092
+
"code": 1368
1093
+
},
1094
+
"Did you mean '{0}'?": {
1095
+
"category": "Message",
1096
+
"code": 1369
1097
+
},
1098
+
"Only ECMAScript imports may use 'import type'.": {
1099
+
"category": "Error",
1100
+
"code": 1370
1101
+
},
1102
+
"This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValue' is set to 'error'.": {
1103
+
"category": "Error",
1104
+
"code": 1371
1105
+
},
1106
+
"This import may be converted to a type-only import.": {
1107
+
"category": "Suggestion",
1108
+
"code": 1372
1109
+
},
1110
+
"Convert to type-only import": {
1111
+
"category": "Message",
1112
+
"code": 1373
1113
+
},
1114
+
"Convert all imports not used as a value to type-only imports": {
1115
+
"category": "Message",
1116
+
"code": 1374
1117
+
},
1118
+
"'await' outside of an async function is only allowed at the top level of a module when '--module' is 'esnext' or 'system' and '--target' is 'es2017' or higher.": {
1119
+
"category": "Error",
1120
+
"code": 1375
1121
+
},
1066
1122
1067
1123
"The types of '{0}' are incompatible between these types.": {
0 commit comments