File tree 22 files changed +95
-173
lines changed
define-model05-with-modifiers
multiple-scripts-with-export01
multiple-scripts-with-export02
multiple-scripts-with-export04
v-bind-same-name-shorthand02-options
v-bind-same-name-shorthand04-with-v-for
v-for-directives-with-destructuring
22 files changed +95
-173
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,8 @@ export function extractGeneric(element: VElement): GenericProcessInfo | null {
94
94
typeDefScope : Scope ,
95
95
isRemoveTarget : ( nodeOrToken : HasLocation ) => boolean ,
96
96
) {
97
- for ( const variable of typeDefScope . variables ) {
97
+ // eslint-disable-next-line unicorn/no-useless-spread -- The original array is mutated
98
+ for ( const variable of [ ...typeDefScope . variables ] ) {
98
99
let def = variable . defs . find ( ( d ) =>
99
100
isRemoveTarget ( d . name as HasLocation ) ,
100
101
)
@@ -105,13 +106,15 @@ export function extractGeneric(element: VElement): GenericProcessInfo | null {
105
106
)
106
107
}
107
108
}
108
- for ( const reference of typeDefScope . references ) {
109
+ // eslint-disable-next-line unicorn/no-useless-spread -- The original array is mutated
110
+ for ( const reference of [ ...typeDefScope . references ] ) {
109
111
if ( isRemoveTarget ( reference . identifier as HasLocation ) ) {
110
112
removeReference ( reference , typeDefScope )
111
113
}
112
114
}
113
115
114
- for ( const scope of scopeManager . scopes ) {
116
+ // eslint-disable-next-line unicorn/no-useless-spread -- The original array is mutated
117
+ for ( const scope of [ ...scopeManager . scopes ] ) {
115
118
if ( isRemoveTarget ( scope . block as HasLocation ) ) {
116
119
removeScope ( scopeManager , scope )
117
120
}
Original file line number Diff line number Diff line change 214
214
],
215
215
"name" : " set"
216
216
},
217
- "kind" : " init" ,
218
217
"value" : {
219
218
"type" : " FunctionExpression" ,
220
219
"start" : 71 ,
522
521
}
523
522
]
524
523
}
525
- }
524
+ },
525
+ "kind" : " init"
526
526
}
527
527
]
528
528
}
Original file line number Diff line number Diff line change 118
118
"kind" : " let"
119
119
},
120
120
"specifiers" : [],
121
- "source" : null
121
+ "source" : null ,
122
+ "attributes" : []
122
123
},
123
124
{
124
125
"type" : " ImportDeclaration" ,
Original file line number Diff line number Diff line change 260
260
"kind" : " const"
261
261
},
262
262
"specifiers" : [],
263
- "source" : null
263
+ "source" : null ,
264
+ "attributes" : []
264
265
}
265
266
],
266
267
"sourceType" : " module" ,
Original file line number Diff line number Diff line change 118
118
"kind" : " let"
119
119
},
120
120
"specifiers" : [],
121
- "source" : null
121
+ "source" : null ,
122
+ "attributes" : []
122
123
},
123
124
{
124
125
"type" : " ImportDeclaration" ,
Original file line number Diff line number Diff line change 118
118
"kind" : " let"
119
119
},
120
120
"specifiers" : [],
121
- "source" : null
121
+ "source" : null ,
122
+ "attributes" : []
122
123
},
123
124
{
124
125
"type" : " VariableDeclaration" ,
Original file line number Diff line number Diff line change 200
200
"kind" : " let"
201
201
},
202
202
"specifiers" : [],
203
- "source" : null
203
+ "source" : null ,
204
+ "attributes" : []
204
205
}
205
206
],
206
207
"sourceType" : " module" ,
Original file line number Diff line number Diff line change 364
364
"kind" : " let"
365
365
},
366
366
"specifiers" : [],
367
- "source" : null
367
+ "source" : null ,
368
+ "attributes" : []
368
369
},
369
370
{
370
371
"type" : " ImportDeclaration" ,
914
915
}
915
916
}
916
917
],
917
- "source" : null
918
+ "source" : null ,
919
+ "attributes" : []
918
920
},
919
921
{
920
922
"type" : " ExportNamedDeclaration" ,
1055
1057
}
1056
1058
}
1057
1059
],
1058
- "source" : null
1060
+ "source" : null ,
1061
+ "attributes" : []
1059
1062
},
1060
1063
{
1061
1064
"type" : " ExportNamedDeclaration" ,
1077
1080
],
1078
1081
"declaration" : null ,
1079
1082
"specifiers" : [],
1080
- "source" : null
1083
+ "source" : null ,
1084
+ "attributes" : []
1081
1085
},
1082
1086
{
1083
1087
"type" : " VariableDeclaration" ,
Original file line number Diff line number Diff line change 118
118
"kind" : " let"
119
119
},
120
120
"specifiers" : [],
121
- "source" : null
121
+ "source" : null ,
122
+ "attributes" : []
122
123
},
123
124
{
124
125
"type" : " ExportNamedDeclaration" ,
221
222
"kind" : " let"
222
223
},
223
224
"specifiers" : [],
224
- "source" : null
225
+ "source" : null ,
226
+ "attributes" : []
225
227
},
226
228
{
227
229
"type" : " ImportDeclaration" ,
467
469
}
468
470
}
469
471
],
470
- "source" : null
472
+ "source" : null ,
473
+ "attributes" : []
471
474
},
472
475
{
473
476
"type" : " ExportNamedDeclaration" ,
570
573
"kind" : " let"
571
574
},
572
575
"specifiers" : [],
573
- "source" : null
576
+ "source" : null ,
577
+ "attributes" : []
574
578
}
575
579
],
576
580
"sourceType" : " module" ,
Original file line number Diff line number Diff line change 178
178
"kind" : " const"
179
179
},
180
180
"specifiers" : [],
181
- "source" : null
181
+ "source" : null ,
182
+ "attributes" : []
182
183
},
183
184
{
184
185
"type" : " VariableDeclaration" ,
Original file line number Diff line number Diff line change 340
340
],
341
341
"name" : " a"
342
342
},
343
- "kind" : " init" ,
344
343
"value" : {
345
344
"type" : " Identifier" ,
346
345
"start" : 62 ,
360
359
63
361
360
],
362
361
"name" : " a"
363
- }
362
+ },
363
+ "kind" : " init"
364
364
},
365
365
{
366
366
"type" : " Property" ,
403
403
],
404
404
"name" : " b"
405
405
},
406
- "kind" : " init" ,
407
406
"value" : {
408
407
"type" : " Identifier" ,
409
408
"start" : 67 ,
423
422
68
424
423
],
425
424
"name" : " b"
426
- }
425
+ },
426
+ "kind" : " init"
427
427
}
428
428
]
429
429
}
Original file line number Diff line number Diff line change 178
178
"kind" : " const"
179
179
},
180
180
"specifiers" : [],
181
- "source" : null
181
+ "source" : null ,
182
+ "attributes" : []
182
183
},
183
184
{
184
185
"type" : " VariableDeclaration" ,
Original file line number Diff line number Diff line change 118
118
"kind" : " let"
119
119
},
120
120
"specifiers" : [],
121
- "source" : null
121
+ "source" : null ,
122
+ "attributes" : []
122
123
}
123
124
],
124
125
"sourceType" : " module" ,
Original file line number Diff line number Diff line change 319
319
],
320
320
"name" : " a"
321
321
},
322
- "kind" : " init" ,
323
322
"value" : {
324
323
"type" : " Identifier" ,
325
324
"start" : 58 ,
339
338
59
340
339
],
341
340
"name" : " a"
342
- }
341
+ },
342
+ "kind" : " init"
343
343
},
344
344
{
345
345
"type" : " Property" ,
382
382
],
383
383
"name" : " b"
384
384
},
385
- "kind" : " init" ,
386
385
"value" : {
387
386
"type" : " Identifier" ,
388
387
"start" : 61 ,
402
401
62
403
402
],
404
403
"name" : " b"
405
- }
404
+ },
405
+ "kind" : " init"
406
406
},
407
407
{
408
408
"type" : " RestElement" ,
Original file line number Diff line number Diff line change 95
95
],
96
96
"name" : " data"
97
97
},
98
- "kind" : " init" ,
99
98
"value" : {
100
99
"type" : " FunctionExpression" ,
101
100
"start" : 33 ,
244
243
}
245
244
]
246
245
}
247
- }
246
+ },
247
+ "kind" : " init"
248
248
}
249
249
]
250
250
}
Original file line number Diff line number Diff line change 95
95
],
96
96
"name" : " data"
97
97
},
98
- "kind" : " init" ,
99
98
"value" : {
100
99
"type" : " FunctionExpression" ,
101
100
"start" : 33 ,
286
285
}
287
286
]
288
287
}
289
- }
288
+ },
289
+ "kind" : " init"
290
290
}
291
291
]
292
292
}
Original file line number Diff line number Diff line change 262
262
],
263
263
"name" : " key"
264
264
},
265
- "kind" : " init" ,
266
265
"value" : {
267
266
"type" : " Identifier" ,
268
267
"start" : 28 ,
282
281
31
283
282
],
284
283
"name" : " key"
285
- }
284
+ },
285
+ "kind" : " init"
286
286
},
287
287
{
288
288
"type" : " Property" ,
325
325
],
326
326
"name" : " name"
327
327
},
328
- "kind" : " init" ,
329
328
"value" : {
330
329
"type" : " Identifier" ,
331
330
"start" : 32 ,
345
344
36
346
345
],
347
346
"name" : " name"
348
- }
347
+ },
348
+ "kind" : " init"
349
349
}
350
350
]
351
351
}
1460
1460
],
1461
1461
"name" : " name"
1462
1462
},
1463
- "kind" : " init" ,
1464
1463
"value" : {
1465
1464
"type" : " Identifier" ,
1466
1465
"start" : 163 ,
1480
1479
167
1481
1480
],
1482
1481
"name" : " name"
1483
- }
1482
+ },
1483
+ "kind" : " init"
1484
1484
}
1485
1485
]
1486
1486
}
Original file line number Diff line number Diff line change 280
280
],
281
281
"name" : " foo"
282
282
},
283
- "kind" : " init" ,
284
283
"value" : {
285
284
"type" : " Identifier" ,
286
285
"start" : 43 ,
300
299
46
301
300
],
302
301
"name" : " foo"
303
- }
302
+ },
303
+ "kind" : " init"
304
304
}
305
305
]
306
306
}
Original file line number Diff line number Diff line change 262
262
],
263
263
"name" : " foo"
264
264
},
265
- "kind" : " init" ,
266
265
"value" : {
267
266
"type" : " Identifier" ,
268
267
"start" : 41 ,
282
281
44
283
282
],
284
283
"name" : " foo"
285
- }
284
+ },
285
+ "kind" : " init"
286
286
}
287
287
]
288
288
}
Original file line number Diff line number Diff line change 337
337
],
338
338
"name" : " foo"
339
339
},
340
- "kind" : " init" ,
341
340
"value" : {
342
341
"type" : " Identifier" ,
343
342
"start" : 61 ,
357
356
64
358
357
],
359
358
"name" : " foo"
360
- }
359
+ },
360
+ "kind" : " init"
361
361
}
362
362
]
363
363
}
Original file line number Diff line number Diff line change 337
337
],
338
338
"name" : " foo"
339
339
},
340
- "kind" : " init" ,
341
340
"value" : {
342
341
"type" : " Identifier" ,
343
342
"start" : 67 ,
357
356
70
358
357
],
359
358
"name" : " foo"
360
- }
359
+ },
360
+ "kind" : " init"
361
361
}
362
362
]
363
363
}
Original file line number Diff line number Diff line change 1160
1160
"references" : []
1161
1161
},
1162
1162
{
1163
- "name" : " T " ,
1163
+ "name" : " defineProps " ,
1164
1164
"identifiers" : [],
1165
1165
"defs" : [],
1166
1166
"references" : [
1167
1167
{
1168
1168
"identifier" : {
1169
1169
"type" : " Identifier" ,
1170
- "name" : " T " ,
1170
+ "name" : " defineProps " ,
1171
1171
"loc" : {
1172
1172
"end" : {
1173
- "column " : 11 ,
1174
- "line " : 8
1173
+ "line " : 5 ,
1174
+ "column " : 21
1175
1175
},
1176
1176
"start" : {
1177
- "column " : 10 ,
1178
- "line " : 8
1177
+ "line " : 5 ,
1178
+ "column " : 10
1179
1179
}
1180
1180
}
1181
1181
},
1182
1182
"from" : " module" ,
1183
1183
"init" : null
1184
- },
1184
+ }
1185
+ ]
1186
+ },
1187
+ {
1188
+ "name" : " T" ,
1189
+ "identifiers" : [],
1190
+ "defs" : [],
1191
+ "references" : [
1185
1192
{
1186
1193
"identifier" : {
1187
1194
"type" : " Identifier" ,
1203
1210
]
1204
1211
},
1205
1212
{
1206
- "name" : " defineProps " ,
1213
+ "name" : " U " ,
1207
1214
"identifiers" : [],
1208
1215
"defs" : [],
1209
1216
"references" : [
1210
1217
{
1211
1218
"identifier" : {
1212
1219
"type" : " Identifier" ,
1213
- "name" : " defineProps " ,
1220
+ "name" : " U " ,
1214
1221
"loc" : {
1215
1222
"end" : {
1216
1223
"line" : 5 ,
1217
- "column" : 21
1224
+ "column" : 36
1218
1225
},
1219
1226
"start" : {
1220
1227
"line" : 5 ,
1221
- "column" : 10
1228
+ "column" : 35
1222
1229
}
1223
1230
}
1224
1231
},
1306
1313
}
1307
1314
]
1308
1315
},
1309
- {
1310
- "name" : " U" ,
1311
- "identifiers" : [
1312
- {
1313
- "type" : " Identifier" ,
1314
- "name" : " U" ,
1315
- "loc" : {
1316
- "end" : {
1317
- "column" : 6 ,
1318
- "line" : 8
1319
- },
1320
- "start" : {
1321
- "column" : 5 ,
1322
- "line" : 8
1323
- }
1324
- }
1325
- }
1326
- ],
1327
- "defs" : [
1328
- {
1329
- "type" : " Type" ,
1330
- "node" : {
1331
- "type" : " TSTypeAliasDeclaration" ,
1332
- "loc" : {
1333
- "end" : {
1334
- "column" : 1 ,
1335
- "line" : 9
1336
- },
1337
- "start" : {
1338
- "column" : 0 ,
1339
- "line" : 8
1340
- }
1341
- }
1342
- },
1343
- "name" : " U"
1344
- }
1345
- ],
1346
- "references" : [
1347
- {
1348
- "identifier" : {
1349
- "type" : " Identifier" ,
1350
- "name" : " U" ,
1351
- "loc" : {
1352
- "end" : {
1353
- "line" : 5 ,
1354
- "column" : 36
1355
- },
1356
- "start" : {
1357
- "line" : 5 ,
1358
- "column" : 35
1359
- }
1360
- }
1361
- },
1362
- "from" : " module" ,
1363
- "resolved" : {
1364
- "type" : " Identifier" ,
1365
- "name" : " U" ,
1366
- "loc" : {
1367
- "end" : {
1368
- "column" : 6 ,
1369
- "line" : 8
1370
- },
1371
- "start" : {
1372
- "column" : 5 ,
1373
- "line" : 8
1374
- }
1375
- }
1376
- },
1377
- "init" : null
1378
- }
1379
- ]
1380
- },
1381
1316
{
1382
1317
"name" : " p" ,
1383
1318
"identifiers" : [
1621
1556
}
1622
1557
],
1623
1558
"references" : [
1624
- {
1625
- "identifier" : {
1626
- "type" : " Identifier" ,
1627
- "name" : " T" ,
1628
- "loc" : {
1629
- "end" : {
1630
- "column" : 11 ,
1631
- "line" : 8
1632
- },
1633
- "start" : {
1634
- "column" : 10 ,
1635
- "line" : 8
1636
- }
1637
- }
1638
- },
1639
- "from" : " module" ,
1640
- "init" : null
1641
- },
1642
1559
{
1643
1560
"identifier" : {
1644
1561
"type" : " Identifier" ,
1723
1640
}
1724
1641
},
1725
1642
"from" : " module" ,
1726
- "resolved" : {
1727
- "type" : " Identifier" ,
1728
- "name" : " U" ,
1729
- "loc" : {
1730
- "end" : {
1731
- "column" : 6 ,
1732
- "line" : 8
1733
- },
1734
- "start" : {
1735
- "column" : 5 ,
1736
- "line" : 8
1737
- }
1738
- }
1739
- },
1740
1643
"init" : null
1741
1644
},
1742
1645
{
1860
1763
{
1861
1764
"identifier" : {
1862
1765
"type" : " Identifier" ,
1863
- "name" : " T " ,
1766
+ "name" : " defineProps " ,
1864
1767
"loc" : {
1865
1768
"end" : {
1866
- "column " : 11 ,
1867
- "line " : 8
1769
+ "line " : 5 ,
1770
+ "column " : 21
1868
1771
},
1869
1772
"start" : {
1870
- "column " : 10 ,
1871
- "line " : 8
1773
+ "line " : 5 ,
1774
+ "column " : 10
1872
1775
}
1873
1776
}
1874
1777
},
1878
1781
{
1879
1782
"identifier" : {
1880
1783
"type" : " Identifier" ,
1881
- "name" : " defineProps " ,
1784
+ "name" : " T " ,
1882
1785
"loc" : {
1883
1786
"end" : {
1884
1787
"line" : 5 ,
1885
- "column" : 21
1788
+ "column" : 28
1886
1789
},
1887
1790
"start" : {
1888
1791
"line" : 5 ,
1889
- "column" : 10
1792
+ "column" : 27
1890
1793
}
1891
1794
}
1892
1795
},
1896
1799
{
1897
1800
"identifier" : {
1898
1801
"type" : " Identifier" ,
1899
- "name" : " T " ,
1802
+ "name" : " U " ,
1900
1803
"loc" : {
1901
1804
"end" : {
1902
1805
"line" : 5 ,
1903
- "column" : 28
1806
+ "column" : 36
1904
1807
},
1905
1808
"start" : {
1906
1809
"line" : 5 ,
1907
- "column" : 27
1810
+ "column" : 35
1908
1811
}
1909
1812
}
1910
1813
},
You can’t perform that action at this time.
0 commit comments