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
Copy file name to clipboardExpand all lines: src/compiler/diagnosticMessages.json
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -951,6 +951,22 @@
951
951
"category": "Error",
952
952
"code": 1288
953
953
},
954
+
"'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported.": {
955
+
"category": "Error",
956
+
"code": 1289
957
+
},
958
+
"'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'.": {
959
+
"category": "Error",
960
+
"code": 1290
961
+
},
962
+
"'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported.": {
963
+
"category": "Error",
964
+
"code": 1291
965
+
},
966
+
"'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'.": {
967
+
"category": "Error",
968
+
"code": 1292
969
+
},
954
970
955
971
"'with' statements are not allowed in an async function block.": {
/b.ts(3,5): error TS1362: 'A' cannot be used as a value because it was exported using 'export type'.
2
+
/d.ts(2,10): error TS1291: 'A' resolves to a type and must be marked type-only in this file before re-exporting when 'isolatedModules' is enabled. Consider using 'import type' where 'A' is imported.
3
+
4
+
5
+
==== /a.ts (0 errors) ====
6
+
class A {}
7
+
export type { A };
8
+
9
+
==== /b.ts (1 errors) ====
10
+
import { A } from './a';
11
+
declare const a: A;
12
+
new A();
13
+
~
14
+
!!! error TS1362: 'A' cannot be used as a value because it was exported using 'export type'.
15
+
!!! related TS1377 /a.ts:2:15: 'A' was exported here.
16
+
17
+
==== /c.ts (0 errors) ====
18
+
import type { A } from './a';
19
+
export = A;
20
+
21
+
==== /d.ts (1 errors) ====
22
+
import { A } from './a';
23
+
export = A;
24
+
~
25
+
!!! error TS1291: 'A' resolves to a type and must be marked type-only in this file before re-exporting when 'isolatedModules' is enabled. Consider using 'import type' where 'A' is imported.
0 commit comments