Skip to content

Commit 124dcd6

Browse files
committed
Update baselines
1 parent 0547a3d commit 124dcd6

4 files changed

+165
-1
lines changed

tests/baselines/reference/importsNotUsedAsValues_error.errors.txt

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
/b.ts(1,1): error TS1371: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
22
/c.ts(1,1): error TS1371: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
33
/e.ts(1,1): error TS6192: All imports in import declaration are unused.
4+
/g.ts(1,1): error TS1371: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
45

56

67
==== /a.ts (0 errors) ====
78
export default class {}
89
export class A {}
910
export type B = {};
11+
export const enum C { One, Two }
1012

1113
==== /b.ts (1 errors) ====
1214
import { A, B } from './a'; // Error
@@ -34,4 +36,19 @@
3436
import { A, B } from './a'; // noUnusedLocals error only
3537
~~~~~~~~~~~~~~~~~~~~~~~~~~~
3638
!!! error TS6192: All imports in import declaration are unused.
37-
39+
40+
==== /f.ts (0 errors) ====
41+
import { C } from './a';
42+
import type { C as D } from './a';
43+
C.One;
44+
let c: D = C.Two;
45+
let d: D.Two = C.Two;
46+
console.log(c, d);
47+
48+
==== /g.ts (1 errors) ====
49+
import { C } from './a';
50+
~~~~~~~~~~~~~~~~~~~~~~~~
51+
!!! error TS1371: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'.
52+
let c: C;
53+
let d: C.Two;
54+
console.log(c, d);

tests/baselines/reference/importsNotUsedAsValues_error.js

+29
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
export default class {}
55
export class A {}
66
export type B = {};
7+
export const enum C { One, Two }
78

89
//// [b.ts]
910
import { A, B } from './a'; // Error
@@ -26,6 +27,19 @@ console.log(a, b);
2627
//// [e.ts]
2728
import { A, B } from './a'; // noUnusedLocals error only
2829

30+
//// [f.ts]
31+
import { C } from './a';
32+
import type { C as D } from './a';
33+
C.One;
34+
let c: D = C.Two;
35+
let d: D.Two = C.Two;
36+
console.log(c, d);
37+
38+
//// [g.ts]
39+
import { C } from './a';
40+
let c: C;
41+
let d: C.Two;
42+
console.log(c, d);
2943

3044
//// [a.js]
3145
"use strict";
@@ -67,3 +81,18 @@ console.log(a, b);
6781
"use strict";
6882
exports.__esModule = true;
6983
require("./a"); // noUnusedLocals error only
84+
//// [f.js]
85+
"use strict";
86+
exports.__esModule = true;
87+
require("./a");
88+
0 /* One */;
89+
var c = 1 /* Two */;
90+
var d = 1 /* Two */;
91+
console.log(c, d);
92+
//// [g.js]
93+
"use strict";
94+
exports.__esModule = true;
95+
require("./a");
96+
var c;
97+
var d;
98+
console.log(c, d);

tests/baselines/reference/importsNotUsedAsValues_error.symbols

+60
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ export class A {}
66
export type B = {};
77
>B : Symbol(B, Decl(a.ts, 1, 17))
88

9+
export const enum C { One, Two }
10+
>C : Symbol(C, Decl(a.ts, 2, 19))
11+
>One : Symbol(C.One, Decl(a.ts, 3, 21))
12+
>Two : Symbol(C.Two, Decl(a.ts, 3, 26))
13+
914
=== /b.ts ===
1015
import { A, B } from './a'; // Error
1116
>A : Symbol(A, Decl(b.ts, 0, 8))
@@ -72,3 +77,58 @@ import { A, B } from './a'; // noUnusedLocals error only
7277
>A : Symbol(A, Decl(e.ts, 0, 8))
7378
>B : Symbol(B, Decl(e.ts, 0, 11))
7479

80+
=== /f.ts ===
81+
import { C } from './a';
82+
>C : Symbol(C, Decl(f.ts, 0, 8))
83+
84+
import type { C as D } from './a';
85+
>C : Symbol(C, Decl(a.ts, 2, 19))
86+
>D : Symbol(D, Decl(f.ts, 1, 13))
87+
88+
C.One;
89+
>C.One : Symbol(C.One, Decl(a.ts, 3, 21))
90+
>C : Symbol(C, Decl(f.ts, 0, 8))
91+
>One : Symbol(C.One, Decl(a.ts, 3, 21))
92+
93+
let c: D = C.Two;
94+
>c : Symbol(c, Decl(f.ts, 3, 3))
95+
>D : Symbol(D, Decl(f.ts, 1, 13))
96+
>C.Two : Symbol(C.Two, Decl(a.ts, 3, 26))
97+
>C : Symbol(C, Decl(f.ts, 0, 8))
98+
>Two : Symbol(C.Two, Decl(a.ts, 3, 26))
99+
100+
let d: D.Two = C.Two;
101+
>d : Symbol(d, Decl(f.ts, 4, 3))
102+
>D : Symbol(D, Decl(f.ts, 1, 13))
103+
>Two : Symbol(C.Two, Decl(a.ts, 3, 26))
104+
>C.Two : Symbol(C.Two, Decl(a.ts, 3, 26))
105+
>C : Symbol(C, Decl(f.ts, 0, 8))
106+
>Two : Symbol(C.Two, Decl(a.ts, 3, 26))
107+
108+
console.log(c, d);
109+
>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --))
110+
>console : Symbol(console, Decl(lib.dom.d.ts, --, --))
111+
>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --))
112+
>c : Symbol(c, Decl(f.ts, 3, 3))
113+
>d : Symbol(d, Decl(f.ts, 4, 3))
114+
115+
=== /g.ts ===
116+
import { C } from './a';
117+
>C : Symbol(C, Decl(g.ts, 0, 8))
118+
119+
let c: C;
120+
>c : Symbol(c, Decl(g.ts, 1, 3))
121+
>C : Symbol(C, Decl(g.ts, 0, 8))
122+
123+
let d: C.Two;
124+
>d : Symbol(d, Decl(g.ts, 2, 3))
125+
>C : Symbol(C, Decl(g.ts, 0, 8))
126+
>Two : Symbol(C.Two, Decl(a.ts, 3, 26))
127+
128+
console.log(c, d);
129+
>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --))
130+
>console : Symbol(console, Decl(lib.dom.d.ts, --, --))
131+
>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --))
132+
>c : Symbol(c, Decl(g.ts, 1, 3))
133+
>d : Symbol(d, Decl(g.ts, 2, 3))
134+

tests/baselines/reference/importsNotUsedAsValues_error.types

+58
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ export class A {}
66
export type B = {};
77
>B : B
88

9+
export const enum C { One, Two }
10+
>C : C
11+
>One : C.One
12+
>Two : C.Two
13+
914
=== /b.ts ===
1015
import { A, B } from './a'; // Error
1116
>A : typeof A
@@ -70,3 +75,56 @@ import { A, B } from './a'; // noUnusedLocals error only
7075
>A : typeof A
7176
>B : any
7277

78+
=== /f.ts ===
79+
import { C } from './a';
80+
>C : typeof C
81+
82+
import type { C as D } from './a';
83+
>C : typeof C
84+
>D : C
85+
86+
C.One;
87+
>C.One : C.One
88+
>C : typeof C
89+
>One : C.One
90+
91+
let c: D = C.Two;
92+
>c : C
93+
>C.Two : C.Two
94+
>C : typeof C
95+
>Two : C.Two
96+
97+
let d: D.Two = C.Two;
98+
>d : C.Two
99+
>D : any
100+
>C.Two : C.Two
101+
>C : typeof C
102+
>Two : C.Two
103+
104+
console.log(c, d);
105+
>console.log(c, d) : void
106+
>console.log : (message?: any, ...optionalParams: any[]) => void
107+
>console : Console
108+
>log : (message?: any, ...optionalParams: any[]) => void
109+
>c : C.Two
110+
>d : C.Two
111+
112+
=== /g.ts ===
113+
import { C } from './a';
114+
>C : typeof C
115+
116+
let c: C;
117+
>c : C
118+
119+
let d: C.Two;
120+
>d : C.Two
121+
>C : any
122+
123+
console.log(c, d);
124+
>console.log(c, d) : void
125+
>console.log : (message?: any, ...optionalParams: any[]) => void
126+
>console : Console
127+
>log : (message?: any, ...optionalParams: any[]) => void
128+
>c : C
129+
>d : C.Two
130+

0 commit comments

Comments
 (0)