]> git.proxmox.com Git - pve-eslint.git/blob - eslint/tests/fixtures/parsers/arrow-parens/identifier-type.js
import 8.23.1 source
[pve-eslint.git] / eslint / tests / fixtures / parsers / arrow-parens / identifier-type.js
1 "use strict";
2
3 // (a: T) => a
4
5 exports.parse = () => ({
6 type: "Program",
7 start: 0,
8 end: 11,
9 loc: {
10 start: {
11 line: 1,
12 column: 0
13 },
14 end: {
15 line: 1,
16 column: 11
17 }
18 },
19 sourceType: "module",
20 body: [
21 {
22 type: "ExpressionStatement",
23 start: 0,
24 end: 11,
25 loc: {
26 start: {
27 line: 1,
28 column: 0
29 },
30 end: {
31 line: 1,
32 column: 11
33 }
34 },
35 expression: {
36 type: "ArrowFunctionExpression",
37 start: 0,
38 end: 11,
39 loc: {
40 start: {
41 line: 1,
42 column: 0
43 },
44 end: {
45 line: 1,
46 column: 11
47 }
48 },
49 id: null,
50 generator: false,
51 expression: true,
52 async: false,
53 params: [
54 {
55 type: "Identifier",
56 start: 1,
57 end: 2,
58 loc: {
59 start: {
60 line: 1,
61 column: 1
62 },
63 end: {
64 line: 1,
65 column: 2
66 }
67 },
68 name: "a",
69 typeAnnotation: {
70 type: "TypeAnnotation",
71 start: 2,
72 end: 5,
73 loc: {
74 start: {
75 line: 1,
76 column: 2
77 },
78 end: {
79 line: 1,
80 column: 5
81 }
82 },
83 typeAnnotation: {
84 type: "GenericTypeAnnotation",
85 start: 4,
86 end: 5,
87 loc: {
88 start: {
89 line: 1,
90 column: 4
91 },
92 end: {
93 line: 1,
94 column: 5
95 }
96 },
97 typeParameters: null,
98 id: {
99 type: "Identifier",
100 start: 4,
101 end: 5,
102 loc: {
103 start: {
104 line: 1,
105 column: 4
106 },
107 end: {
108 line: 1,
109 column: 5
110 }
111 },
112 name: "T",
113 range: [
114 4,
115 5
116 ],
117 _babelType: "Identifier"
118 },
119 range: [
120 4,
121 5
122 ],
123 _babelType: "GenericTypeAnnotation"
124 },
125 range: [
126 2,
127 5
128 ],
129 _babelType: "TypeAnnotation"
130 },
131 range: [
132 1,
133 2
134 ],
135 _babelType: "Identifier"
136 }
137 ],
138 body: {
139 type: "Identifier",
140 start: 10,
141 end: 11,
142 loc: {
143 start: {
144 line: 1,
145 column: 10
146 },
147 end: {
148 line: 1,
149 column: 11
150 }
151 },
152 name: "a",
153 range: [
154 10,
155 11
156 ],
157 _babelType: "Identifier"
158 },
159 range: [
160 0,
161 11
162 ],
163 _babelType: "ArrowFunctionExpression"
164 },
165 range: [
166 0,
167 11
168 ],
169 _babelType: "ExpressionStatement"
170 }
171 ],
172 tokens: [
173 {
174 type: "Punctuator",
175 value: "(",
176 start: 0,
177 end: 1,
178 loc: {
179 start: {
180 line: 1,
181 column: 0
182 },
183 end: {
184 line: 1,
185 column: 1
186 }
187 },
188 range: [
189 0,
190 1
191 ]
192 },
193 {
194 type: "Identifier",
195 value: "a",
196 start: 1,
197 end: 2,
198 loc: {
199 start: {
200 line: 1,
201 column: 1
202 },
203 end: {
204 line: 1,
205 column: 2
206 }
207 },
208 range: [
209 1,
210 2
211 ]
212 },
213 {
214 type: "Punctuator",
215 value: ":",
216 start: 2,
217 end: 3,
218 loc: {
219 start: {
220 line: 1,
221 column: 2
222 },
223 end: {
224 line: 1,
225 column: 3
226 }
227 },
228 range: [
229 2,
230 3
231 ]
232 },
233 {
234 type: "Identifier",
235 value: "T",
236 start: 4,
237 end: 5,
238 loc: {
239 start: {
240 line: 1,
241 column: 4
242 },
243 end: {
244 line: 1,
245 column: 5
246 }
247 },
248 range: [
249 4,
250 5
251 ]
252 },
253 {
254 type: "Punctuator",
255 value: ")",
256 start: 5,
257 end: 6,
258 loc: {
259 start: {
260 line: 1,
261 column: 5
262 },
263 end: {
264 line: 1,
265 column: 6
266 }
267 },
268 range: [
269 5,
270 6
271 ]
272 },
273 {
274 type: "Punctuator",
275 value: "=>",
276 start: 7,
277 end: 9,
278 loc: {
279 start: {
280 line: 1,
281 column: 7
282 },
283 end: {
284 line: 1,
285 column: 9
286 }
287 },
288 range: [
289 7,
290 9
291 ]
292 },
293 {
294 type: "Identifier",
295 value: "a",
296 start: 10,
297 end: 11,
298 loc: {
299 start: {
300 line: 1,
301 column: 10
302 },
303 end: {
304 line: 1,
305 column: 11
306 }
307 },
308 range: [
309 10,
310 11
311 ]
312 },
313 {
314 type: {
315 label: "eof",
316 beforeExpr: false,
317 startsExpr: false,
318 rightAssociative: false,
319 isLoop: false,
320 isAssign: false,
321 prefix: false,
322 postfix: false,
323 binop: null,
324 updateContext: null
325 },
326 start: 11,
327 end: 11,
328 loc: {
329 start: {
330 line: 1,
331 column: 11
332 },
333 end: {
334 line: 1,
335 column: 11
336 }
337 },
338 range: [
339 11,
340 11
341 ]
342 }
343 ],
344 comments: [],
345 range: [
346 0,
347 11
348 ]
349 });