Skip to content

Commit d4dfa3b

Browse files
armano2JamesHenry
authored andcommitted
fix(ts-estree): fix issues with typeParams in FunctionExpression (#208)
1 parent f513a14 commit d4dfa3b

File tree

5 files changed

+292
-280
lines changed

5 files changed

+292
-280
lines changed

Diff for: packages/parser/tests/lib/__snapshots__/typescript.ts.snap

+126-126
Original file line numberDiff line numberDiff line change
@@ -11047,13 +11047,13 @@ Object {
1104711047
"line": 2,
1104811048
},
1104911049
"start": Object {
11050-
"column": 16,
11050+
"column": 13,
1105111051
"line": 2,
1105211052
},
1105311053
},
1105411054
"params": Array [],
1105511055
"range": Array [
11056-
26,
11056+
23,
1105711057
32,
1105811058
],
1105911059
"type": "FunctionExpression",
@@ -11180,13 +11180,13 @@ Object {
1118011180
"line": 4,
1118111181
},
1118211182
"start": Object {
11183-
"column": 20,
11183+
"column": 17,
1118411184
"line": 4,
1118511185
},
1118611186
},
1118711187
"params": Array [],
1118811188
"range": Array [
11189-
54,
11189+
51,
1119011190
60,
1119111191
],
1119211192
"type": "FunctionExpression",
@@ -13831,13 +13831,13 @@ Object {
1383113831
"line": 2,
1383213832
},
1383313833
"start": Object {
13834-
"column": 11,
13834+
"column": 8,
1383513835
"line": 2,
1383613836
},
1383713837
},
1383813838
"params": Array [],
1383913839
"range": Array [
13840-
23,
13840+
20,
1384113841
28,
1384213842
],
1384313843
"type": "FunctionExpression",
@@ -14260,13 +14260,13 @@ Object {
1426014260
"line": 2,
1426114261
},
1426214262
"start": Object {
14263-
"column": 17,
14263+
"column": 8,
1426414264
"line": 2,
1426514265
},
1426614266
},
1426714267
"params": Array [],
1426814268
"range": Array [
14269-
29,
14269+
20,
1427014270
34,
1427114271
],
1427214272
"type": "FunctionExpression",
@@ -16112,13 +16112,13 @@ Object {
1611216112
"line": 3,
1611316113
},
1611416114
"start": Object {
16115-
"column": 8,
16115+
"column": 5,
1611616116
"line": 3,
1611716117
},
1611816118
},
1611916119
"params": Array [],
1612016120
"range": Array [
16121-
38,
16121+
35,
1612216122
44,
1612316123
],
1612416124
"type": "FunctionExpression",
@@ -28360,13 +28360,13 @@ Object {
2836028360
"line": 3,
2836128361
},
2836228362
"start": Object {
28363-
"column": 18,
28363+
"column": 15,
2836428364
"line": 2,
2836528365
},
2836628366
},
2836728367
"params": Array [],
2836828368
"range": Array [
28369-
28,
28369+
25,
2837028370
44,
2837128371
],
2837228372
"returnType": Object {
@@ -28527,13 +28527,13 @@ Object {
2852728527
"line": 6,
2852828528
},
2852928529
"start": Object {
28530-
"column": 20,
28530+
"column": 17,
2853128531
"line": 5,
2853228532
},
2853328533
},
2853428534
"params": Array [],
2853528535
"range": Array [
28536-
66,
28536+
63,
2853728537
82,
2853828538
],
2853928539
"returnType": Object {
@@ -58372,60 +58372,6 @@ Object {
5837258372
],
5837358373
"shorthand": false,
5837458374
"type": "Property",
58375-
"typeParameters": Object {
58376-
"loc": Object {
58377-
"end": Object {
58378-
"column": 18,
58379-
"line": 2,
58380-
},
58381-
"start": Object {
58382-
"column": 15,
58383-
"line": 2,
58384-
},
58385-
},
58386-
"params": Array [
58387-
Object {
58388-
"loc": Object {
58389-
"end": Object {
58390-
"column": 17,
58391-
"line": 2,
58392-
},
58393-
"start": Object {
58394-
"column": 16,
58395-
"line": 2,
58396-
},
58397-
},
58398-
"name": Object {
58399-
"loc": Object {
58400-
"end": Object {
58401-
"column": 17,
58402-
"line": 2,
58403-
},
58404-
"start": Object {
58405-
"column": 16,
58406-
"line": 2,
58407-
},
58408-
},
58409-
"name": "T",
58410-
"range": Array [
58411-
30,
58412-
31,
58413-
],
58414-
"type": "Identifier",
58415-
},
58416-
"range": Array [
58417-
30,
58418-
31,
58419-
],
58420-
"type": "TSTypeParameter",
58421-
},
58422-
],
58423-
"range": Array [
58424-
29,
58425-
32,
58426-
],
58427-
"type": "TSTypeParameterDeclaration",
58428-
},
5842958375
"value": Object {
5843058376
"async": false,
5843158377
"body": Object {
@@ -58492,13 +58438,13 @@ Object {
5849258438
"line": 4,
5849358439
},
5849458440
"start": Object {
58495-
"column": 18,
58441+
"column": 15,
5849658442
"line": 2,
5849758443
},
5849858444
},
5849958445
"params": Array [],
5850058446
"range": Array [
58501-
32,
58447+
29,
5850258448
61,
5850358449
],
5850458450
"returnType": Object {
@@ -58536,6 +58482,60 @@ Object {
5853658482
},
5853758483
},
5853858484
"type": "FunctionExpression",
58485+
"typeParameters": Object {
58486+
"loc": Object {
58487+
"end": Object {
58488+
"column": 18,
58489+
"line": 2,
58490+
},
58491+
"start": Object {
58492+
"column": 15,
58493+
"line": 2,
58494+
},
58495+
},
58496+
"params": Array [
58497+
Object {
58498+
"loc": Object {
58499+
"end": Object {
58500+
"column": 17,
58501+
"line": 2,
58502+
},
58503+
"start": Object {
58504+
"column": 16,
58505+
"line": 2,
58506+
},
58507+
},
58508+
"name": Object {
58509+
"loc": Object {
58510+
"end": Object {
58511+
"column": 17,
58512+
"line": 2,
58513+
},
58514+
"start": Object {
58515+
"column": 16,
58516+
"line": 2,
58517+
},
58518+
},
58519+
"name": "T",
58520+
"range": Array [
58521+
30,
58522+
31,
58523+
],
58524+
"type": "Identifier",
58525+
},
58526+
"range": Array [
58527+
30,
58528+
31,
58529+
],
58530+
"type": "TSTypeParameter",
58531+
},
58532+
],
58533+
"range": Array [
58534+
29,
58535+
32,
58536+
],
58537+
"type": "TSTypeParameterDeclaration",
58538+
},
5853958539
},
5854058540
},
5854158541
Object {
@@ -58576,60 +58576,6 @@ Object {
5857658576
],
5857758577
"shorthand": false,
5857858578
"type": "Property",
58579-
"typeParameters": Object {
58580-
"loc": Object {
58581-
"end": Object {
58582-
"column": 8,
58583-
"line": 5,
58584-
},
58585-
"start": Object {
58586-
"column": 5,
58587-
"line": 5,
58588-
},
58589-
},
58590-
"params": Array [
58591-
Object {
58592-
"loc": Object {
58593-
"end": Object {
58594-
"column": 7,
58595-
"line": 5,
58596-
},
58597-
"start": Object {
58598-
"column": 6,
58599-
"line": 5,
58600-
},
58601-
},
58602-
"name": Object {
58603-
"loc": Object {
58604-
"end": Object {
58605-
"column": 7,
58606-
"line": 5,
58607-
},
58608-
"start": Object {
58609-
"column": 6,
58610-
"line": 5,
58611-
},
58612-
},
58613-
"name": "T",
58614-
"range": Array [
58615-
69,
58616-
70,
58617-
],
58618-
"type": "Identifier",
58619-
},
58620-
"range": Array [
58621-
69,
58622-
70,
58623-
],
58624-
"type": "TSTypeParameter",
58625-
},
58626-
],
58627-
"range": Array [
58628-
68,
58629-
71,
58630-
],
58631-
"type": "TSTypeParameterDeclaration",
58632-
},
5863358579
"value": Object {
5863458580
"async": false,
5863558581
"body": Object {
@@ -58696,13 +58642,13 @@ Object {
5869658642
"line": 7,
5869758643
},
5869858644
"start": Object {
58699-
"column": 8,
58645+
"column": 5,
5870058646
"line": 5,
5870158647
},
5870258648
},
5870358649
"params": Array [],
5870458650
"range": Array [
58705-
71,
58651+
68,
5870658652
100,
5870758653
],
5870858654
"returnType": Object {
@@ -58740,6 +58686,60 @@ Object {
5874058686
},
5874158687
},
5874258688
"type": "FunctionExpression",
58689+
"typeParameters": Object {
58690+
"loc": Object {
58691+
"end": Object {
58692+
"column": 8,
58693+
"line": 5,
58694+
},
58695+
"start": Object {
58696+
"column": 5,
58697+
"line": 5,
58698+
},
58699+
},
58700+
"params": Array [
58701+
Object {
58702+
"loc": Object {
58703+
"end": Object {
58704+
"column": 7,
58705+
"line": 5,
58706+
},
58707+
"start": Object {
58708+
"column": 6,
58709+
"line": 5,
58710+
},
58711+
},
58712+
"name": Object {
58713+
"loc": Object {
58714+
"end": Object {
58715+
"column": 7,
58716+
"line": 5,
58717+
},
58718+
"start": Object {
58719+
"column": 6,
58720+
"line": 5,
58721+
},
58722+
},
58723+
"name": "T",
58724+
"range": Array [
58725+
69,
58726+
70,
58727+
],
58728+
"type": "Identifier",
58729+
},
58730+
"range": Array [
58731+
69,
58732+
70,
58733+
],
58734+
"type": "TSTypeParameter",
58735+
},
58736+
],
58737+
"range": Array [
58738+
68,
58739+
71,
58740+
],
58741+
"type": "TSTypeParameterDeclaration",
58742+
},
5874358743
},
5874458744
},
5874558745
Object {

0 commit comments

Comments
 (0)