File tree 2 files changed +42
-0
lines changed
2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,25 @@ export default util.createRule<Options, MessageIds>({
78
78
} ) ;
79
79
}
80
80
81
+ if (
82
+ node . arguments . length === 1 &&
83
+ node . typeParameters ?. params . some (
84
+ param =>
85
+ param . type === AST_NODE_TYPES . TSParenthesizedType ||
86
+ param . type === AST_NODE_TYPES . TSImportType ,
87
+ )
88
+ ) {
89
+ return rule ( {
90
+ ...node ,
91
+ arguments : [
92
+ {
93
+ ...node . arguments [ 0 ] ,
94
+ type : AST_NODE_TYPES . SequenceExpression as any ,
95
+ } ,
96
+ ] ,
97
+ } ) ;
98
+ }
99
+
81
100
return rule ( node ) ;
82
101
}
83
102
function unaryUpdateExpression (
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ for (a of (b, c));
26
26
for (a of b);
27
27
for (a in b, c);
28
28
for (a in b);
29
+ a<import('')>(1);
30
+ new a<import('')>(1);
31
+ a<(A)>(1);
29
32
` ,
30
33
} ) ,
31
34
...batchedSingleLineTests ( {
@@ -233,6 +236,8 @@ for (a in (b, c));
233
236
for (a in (b));
234
237
for (a of (b));
235
238
typeof (a);
239
+ a<import('')>((1));
240
+ new a<import('')>((1));
236
241
` ,
237
242
output : `
238
243
a = b * c;
@@ -241,6 +246,9 @@ for (a in b, c);
241
246
for (a in b);
242
247
for (a of b);
243
248
typeof a;
249
+ a<import('')>(1);
250
+ new a<import('')>(1);
251
+ a<(A)>((1));
244
252
` ,
245
253
errors : [
246
254
{
@@ -273,6 +281,21 @@ typeof a;
273
281
line : 7 ,
274
282
column : 8 ,
275
283
} ,
284
+ {
285
+ messageId : 'unexpected' ,
286
+ line : 8 ,
287
+ column : 15 ,
288
+ } ,
289
+ {
290
+ messageId : 'unexpected' ,
291
+ line : 9 ,
292
+ column : 19 ,
293
+ } ,
294
+ {
295
+ messageId : 'unexpected' ,
296
+ line : 10 ,
297
+ column : 8 ,
298
+ } ,
276
299
] ,
277
300
} ) ,
278
301
...batchedSingleLineTests ( {
You can’t perform that action at this time.
0 commit comments