|
1 | 1 |
|
2 | 2 | [TestRestrictTemplateExpressionsRule/invalid-0 - 1] |
3 | 3 | Diagnostic 1: invalidType (2:30 - 2:32) |
4 | | -Message: Invalid type "123" of template literal expression. |
| 4 | +Message: Invalid type used in template literal expression. |
5 | 5 | 1 | |
6 | 6 | 2 | const msg = `arg = ${123}`; |
7 | 7 | | ~~~ |
8 | 8 | 3 | |
| 9 | + Label: Type: 123 (2:30 - 2:32) |
| 10 | + 1 | |
| 11 | + 2 | const msg = `arg = ${123}`; |
| 12 | + | ^^^ Type: 123 |
| 13 | + 3 | |
9 | 14 | --- |
10 | 15 |
|
11 | 16 | [TestRestrictTemplateExpressionsRule/invalid-1 - 1] |
12 | 17 | Diagnostic 1: invalidType (2:30 - 2:34) |
13 | | -Message: Invalid type "false" of template literal expression. |
| 18 | +Message: Invalid type used in template literal expression. |
14 | 19 | 1 | |
15 | 20 | 2 | const msg = `arg = ${false}`; |
16 | 21 | | ~~~~~ |
17 | 22 | 3 | |
| 23 | + Label: Type: false (2:30 - 2:34) |
| 24 | + 1 | |
| 25 | + 2 | const msg = `arg = ${false}`; |
| 26 | + | ^^^^^ Type: false |
| 27 | + 3 | |
18 | 28 | --- |
19 | 29 |
|
20 | 30 | [TestRestrictTemplateExpressionsRule/invalid-10 - 1] |
21 | 31 | Diagnostic 1: invalidType (3:30 - 3:32) |
22 | | -Message: Invalid type "{}" of template literal expression. |
| 32 | +Message: Invalid type used in template literal expression. |
23 | 33 | 2 | const arg = {}; |
24 | 34 | 3 | const msg = `arg = ${arg}`; |
25 | 35 | | ~~~ |
26 | 36 | 4 | |
| 37 | + Label: Type: {} (3:30 - 3:32) |
| 38 | + 2 | const arg = {}; |
| 39 | + 3 | const msg = `arg = ${arg}`; |
| 40 | + | ^^^ Type: {} |
| 41 | + 4 | |
27 | 42 | --- |
28 | 43 |
|
29 | 44 | [TestRestrictTemplateExpressionsRule/invalid-11 - 1] |
30 | 45 | Diagnostic 1: invalidType (3:30 - 3:32) |
31 | | -Message: Invalid type "{ a: string; } & { b: string; }" of template literal expression. |
| 46 | +Message: Invalid type used in template literal expression. |
32 | 47 | 2 | declare const arg: { a: string } & { b: string }; |
33 | 48 | 3 | const msg = `arg = ${arg}`; |
34 | 49 | | ~~~ |
35 | 50 | 4 | |
| 51 | + Label: Type: { a: string; } & { b: string; } (3:30 - 3:32) |
| 52 | + 2 | declare const arg: { a: string } & { b: string }; |
| 53 | + 3 | const msg = `arg = ${arg}`; |
| 54 | + | ^^^ Type: { a: string; } & { b: string; } |
| 55 | + 4 | |
36 | 56 | --- |
37 | 57 |
|
38 | 58 | [TestRestrictTemplateExpressionsRule/invalid-12 - 1] |
39 | 59 | Diagnostic 1: invalidType (3:27 - 3:29) |
40 | | -Message: Invalid type "{}" of template literal expression. |
| 60 | +Message: Invalid type used in template literal expression. |
41 | 61 | 2 | function test<T extends {}>(arg: T) { |
42 | 62 | 3 | return `arg = ${arg}`; |
43 | 63 | | ~~~ |
44 | 64 | 4 | } |
| 65 | + Label: Type: {} (3:27 - 3:29) |
| 66 | + 2 | function test<T extends {}>(arg: T) { |
| 67 | + 3 | return `arg = ${arg}`; |
| 68 | + | ^^^ Type: {} |
| 69 | + 4 | } |
45 | 70 | --- |
46 | 71 |
|
47 | 72 | [TestRestrictTemplateExpressionsRule/invalid-13 - 1] |
48 | 73 | Diagnostic 1: invalidType (3:27 - 3:29) |
49 | | -Message: Invalid type "T" of template literal expression. |
| 74 | +Message: Invalid type used in template literal expression. |
50 | 75 | 2 | function test<TWithNoConstraint>(arg: T) { |
51 | 76 | 3 | return `arg = ${arg}`; |
52 | 77 | | ~~~ |
53 | 78 | 4 | } |
| 79 | + Label: Type: T (3:27 - 3:29) |
| 80 | + 2 | function test<TWithNoConstraint>(arg: T) { |
| 81 | + 3 | return `arg = ${arg}`; |
| 82 | + | ^^^ Type: T |
| 83 | + 4 | } |
54 | 84 | --- |
55 | 85 |
|
56 | 86 | [TestRestrictTemplateExpressionsRule/invalid-14 - 1] |
57 | 87 | Diagnostic 1: invalidType (3:27 - 3:29) |
58 | | -Message: Invalid type "any" of template literal expression. |
| 88 | +Message: Invalid type used in template literal expression. |
59 | 89 | 2 | function test(arg: any) { |
60 | 90 | 3 | return `arg = ${arg}`; |
61 | 91 | | ~~~ |
62 | 92 | 4 | } |
| 93 | + Label: Type: any (3:27 - 3:29) |
| 94 | + 2 | function test(arg: any) { |
| 95 | + 3 | return `arg = ${arg}`; |
| 96 | + | ^^^ Type: any |
| 97 | + 4 | } |
63 | 98 | --- |
64 | 99 |
|
65 | 100 | [TestRestrictTemplateExpressionsRule/invalid-15 - 1] |
66 | 101 | Diagnostic 1: invalidType (3:30 - 3:32) |
67 | | -Message: Invalid type "RegExp" of template literal expression. |
| 102 | +Message: Invalid type used in template literal expression. |
68 | 103 | 2 | const arg = new RegExp('foo'); |
69 | 104 | 3 | const msg = `arg = ${arg}`; |
70 | 105 | | ~~~ |
71 | 106 | 4 | |
| 107 | + Label: Type: RegExp (3:30 - 3:32) |
| 108 | + 2 | const arg = new RegExp('foo'); |
| 109 | + 3 | const msg = `arg = ${arg}`; |
| 110 | + | ^^^ Type: RegExp |
| 111 | + 4 | |
72 | 112 | --- |
73 | 113 |
|
74 | 114 | [TestRestrictTemplateExpressionsRule/invalid-16 - 1] |
75 | 115 | Diagnostic 1: invalidType (3:30 - 3:32) |
76 | | -Message: Invalid type "RegExp" of template literal expression. |
| 116 | +Message: Invalid type used in template literal expression. |
77 | 117 | 2 | const arg = /foo/; |
78 | 118 | 3 | const msg = `arg = ${arg}`; |
79 | 119 | | ~~~ |
80 | 120 | 4 | |
| 121 | + Label: Type: RegExp (3:30 - 3:32) |
| 122 | + 2 | const arg = /foo/; |
| 123 | + 3 | const msg = `arg = ${arg}`; |
| 124 | + | ^^^ Type: RegExp |
| 125 | + 4 | |
81 | 126 | --- |
82 | 127 |
|
83 | 128 | [TestRestrictTemplateExpressionsRule/invalid-17 - 1] |
84 | 129 | Diagnostic 1: invalidType (3:28 - 3:32) |
85 | | -Message: Invalid type "never" of template literal expression. |
| 130 | +Message: Invalid type used in template literal expression. |
86 | 131 | 2 | declare const value: never; |
87 | 132 | 3 | const stringy = `${value}`; |
88 | 133 | | ~~~~~ |
89 | 134 | 4 | |
| 135 | + Label: Type: never (3:28 - 3:32) |
| 136 | + 2 | declare const value: never; |
| 137 | + 3 | const stringy = `${value}`; |
| 138 | + | ^^^^^ Type: never |
| 139 | + 4 | |
90 | 140 | --- |
91 | 141 |
|
92 | 142 | [TestRestrictTemplateExpressionsRule/invalid-18 - 1] |
93 | 143 | Diagnostic 1: invalidType (3:27 - 3:29) |
94 | | -Message: Invalid type "unknown" of template literal expression. |
| 144 | +Message: Invalid type used in template literal expression. |
95 | 145 | 2 | function test<T extends any>(arg: T) { |
96 | 146 | 3 | return `arg = ${arg}`; |
97 | 147 | | ~~~ |
98 | 148 | 4 | } |
| 149 | + Label: Type: unknown (3:27 - 3:29) |
| 150 | + 2 | function test<T extends any>(arg: T) { |
| 151 | + 3 | return `arg = ${arg}`; |
| 152 | + | ^^^ Type: unknown |
| 153 | + 4 | } |
99 | 154 | --- |
100 | 155 |
|
101 | 156 | [TestRestrictTemplateExpressionsRule/invalid-2 - 1] |
102 | 157 | Diagnostic 1: invalidType (2:30 - 2:33) |
103 | | -Message: Invalid type "null" of template literal expression. |
| 158 | +Message: Invalid type used in template literal expression. |
104 | 159 | 1 | |
105 | 160 | 2 | const msg = `arg = ${null}`; |
106 | 161 | | ~~~~ |
107 | 162 | 3 | |
| 163 | + Label: Type: null (2:30 - 2:33) |
| 164 | + 1 | |
| 165 | + 2 | const msg = `arg = ${null}`; |
| 166 | + | ^^^^ Type: null |
| 167 | + 3 | |
108 | 168 | --- |
109 | 169 |
|
110 | 170 | [TestRestrictTemplateExpressionsRule/invalid-3 - 1] |
111 | 171 | Diagnostic 1: invalidType (3:30 - 3:32) |
112 | | -Message: Invalid type "number[]" of template literal expression. |
| 172 | +Message: Invalid type used in template literal expression. |
113 | 173 | 2 | declare const arg: number[]; |
114 | 174 | 3 | const msg = `arg = ${arg}`; |
115 | 175 | | ~~~ |
116 | 176 | 4 | |
| 177 | + Label: Type: number[] (3:30 - 3:32) |
| 178 | + 2 | declare const arg: number[]; |
| 179 | + 3 | const msg = `arg = ${arg}`; |
| 180 | + | ^^^ Type: number[] |
| 181 | + 4 | |
117 | 182 | --- |
118 | 183 |
|
119 | 184 | [TestRestrictTemplateExpressionsRule/invalid-4 - 1] |
120 | 185 | Diagnostic 1: invalidType (2:30 - 2:34) |
121 | | -Message: Invalid type "(number | undefined)[]" of template literal expression. |
| 186 | +Message: Invalid type used in template literal expression. |
122 | 187 | 1 | |
123 | 188 | 2 | const msg = `arg = ${[, 2]}`; |
124 | 189 | | ~~~~~ |
125 | 190 | 3 | |
| 191 | + Label: Type: (number | undefined)[] (2:30 - 2:34) |
| 192 | + 1 | |
| 193 | + 2 | const msg = `arg = ${[, 2]}`; |
| 194 | + | ^^^^^ Type: (number | undefined)[] |
| 195 | + 3 | |
126 | 196 | --- |
127 | 197 |
|
128 | 198 | [TestRestrictTemplateExpressionsRule/invalid-5 - 1] |
129 | 199 | Diagnostic 1: invalidType (1:22 - 1:38) |
130 | | -Message: Invalid type "Promise<void>" of template literal expression. |
| 200 | +Message: Invalid type used in template literal expression. |
131 | 201 | 1 | const msg = `arg = ${Promise.resolve()}`; |
132 | 202 | | ~~~~~~~~~~~~~~~~~ |
| 203 | + Label: Type: Promise<void> (1:22 - 1:38) |
| 204 | + 1 | const msg = `arg = ${Promise.resolve()}`; |
| 205 | + | ^^^^^^^^^^^^^^^^^ Type: Promise<void> |
133 | 206 | --- |
134 | 207 |
|
135 | 208 | [TestRestrictTemplateExpressionsRule/invalid-6 - 1] |
136 | 209 | Diagnostic 1: invalidType (1:22 - 1:32) |
137 | | -Message: Invalid type "Error" of template literal expression. |
| 210 | +Message: Invalid type used in template literal expression. |
138 | 211 | 1 | const msg = `arg = ${new Error()}`; |
139 | 212 | | ~~~~~~~~~~~ |
| 213 | + Label: Type: Error (1:22 - 1:32) |
| 214 | + 1 | const msg = `arg = ${new Error()}`; |
| 215 | + | ^^^^^^^^^^^ Type: Error |
140 | 216 | --- |
141 | 217 |
|
142 | 218 | [TestRestrictTemplateExpressionsRule/invalid-7 - 1] |
143 | 219 | Diagnostic 1: invalidType (3:30 - 3:32) |
144 | | -Message: Invalid type "[number | undefined, string]" of template literal expression. |
| 220 | +Message: Invalid type used in template literal expression. |
145 | 221 | 2 | declare const arg: [number | undefined, string]; |
146 | 222 | 3 | const msg = `arg = ${arg}`; |
147 | 223 | | ~~~ |
148 | 224 | 4 | |
| 225 | + Label: Type: [number | undefined, string] (3:30 - 3:32) |
| 226 | + 2 | declare const arg: [number | undefined, string]; |
| 227 | + 3 | const msg = `arg = ${arg}`; |
| 228 | + | ^^^ Type: [number | undefined, string] |
| 229 | + 4 | |
149 | 230 | --- |
150 | 231 |
|
151 | 232 | [TestRestrictTemplateExpressionsRule/invalid-8 - 1] |
152 | 233 | Diagnostic 1: invalidType (3:30 - 3:32) |
153 | | -Message: Invalid type "number" of template literal expression. |
| 234 | +Message: Invalid type used in template literal expression. |
154 | 235 | 2 | declare const arg: number; |
155 | 236 | 3 | const msg = `arg = ${arg}`; |
156 | 237 | | ~~~ |
157 | 238 | 4 | |
| 239 | + Label: Type: number (3:30 - 3:32) |
| 240 | + 2 | declare const arg: number; |
| 241 | + 3 | const msg = `arg = ${arg}`; |
| 242 | + | ^^^ Type: number |
| 243 | + 4 | |
158 | 244 | --- |
159 | 245 |
|
160 | 246 | [TestRestrictTemplateExpressionsRule/invalid-9 - 1] |
161 | 247 | Diagnostic 1: invalidType (3:30 - 3:32) |
162 | | -Message: Invalid type "boolean" of template literal expression. |
| 248 | +Message: Invalid type used in template literal expression. |
163 | 249 | 2 | declare const arg: boolean; |
164 | 250 | 3 | const msg = `arg = ${arg}`; |
165 | 251 | | ~~~ |
166 | 252 | 4 | |
| 253 | + Label: Type: boolean (3:30 - 3:32) |
| 254 | + 2 | declare const arg: boolean; |
| 255 | + 3 | const msg = `arg = ${arg}`; |
| 256 | + | ^^^ Type: boolean |
| 257 | + 4 | |
167 | 258 | --- |
0 commit comments