]> git.proxmox.com Git - pve-eslint.git/blob - eslint/tests/fixtures/parsers/comma-dangle/return-type-1.js
first commit
[pve-eslint.git] / eslint / tests / fixtures / parsers / comma-dangle / return-type-1.js
1 "use strict";
2
3 // The AST of the following code:
4 //
5 // function foo(a): {b: boolean,} {}
6 //
7
8 module.exports.parse = () => ({
9 type: "Program",
10 start: 0,
11 end: 33,
12 loc: {
13 start: {
14 line: 1,
15 column: 0
16 },
17 end: {
18 line: 1,
19 column: 33
20 }
21 },
22 sourceType: "module",
23 body: [
24 {
25 type: "FunctionDeclaration",
26 start: 0,
27 end: 33,
28 loc: {
29 start: {
30 line: 1,
31 column: 0
32 },
33 end: {
34 line: 1,
35 column: 33
36 }
37 },
38 id: {
39 type: "Identifier",
40 start: 9,
41 end: 12,
42 loc: {
43 start: {
44 line: 1,
45 column: 9
46 },
47 end: {
48 line: 1,
49 column: 12
50 }
51 },
52 name: "foo",
53 range: [
54 9,
55 12
56 ],
57 _babelType: "Identifier"
58 },
59 generator: false,
60 expression: false,
61 async: false,
62 params: [
63 {
64 type: "Identifier",
65 start: 13,
66 end: 14,
67 loc: {
68 start: {
69 line: 1,
70 column: 13
71 },
72 end: {
73 line: 1,
74 column: 14
75 }
76 },
77 name: "a",
78 range: [
79 13,
80 14
81 ],
82 _babelType: "Identifier"
83 }
84 ],
85 returnType: {
86 type: "TypeAnnotation",
87 start: 15,
88 end: 30,
89 loc: {
90 start: {
91 line: 1,
92 column: 15
93 },
94 end: {
95 line: 1,
96 column: 30
97 }
98 },
99 typeAnnotation: {
100 type: "ObjectTypeAnnotation",
101 start: 17,
102 end: 30,
103 loc: {
104 start: {
105 line: 1,
106 column: 17
107 },
108 end: {
109 line: 1,
110 column: 30
111 }
112 },
113 callProperties: [],
114 properties: [
115 {
116 type: "ObjectTypeProperty",
117 start: 18,
118 end: 29,
119 loc: {
120 start: {
121 line: 1,
122 column: 18
123 },
124 end: {
125 line: 1,
126 column: 29
127 }
128 },
129 value: {
130 type: "BooleanTypeAnnotation",
131 start: 21,
132 end: 28,
133 loc: {
134 start: {
135 line: 1,
136 column: 21
137 },
138 end: {
139 line: 1,
140 column: 28
141 }
142 },
143 range: [
144 21,
145 28
146 ],
147 _babelType: "BooleanTypeAnnotation"
148 },
149 optional: false,
150 range: [
151 18,
152 29
153 ],
154 _babelType: "ObjectTypeProperty"
155 }
156 ],
157 indexers: [],
158 range: [
159 17,
160 30
161 ],
162 _babelType: "ObjectTypeAnnotation"
163 },
164 range: [
165 15,
166 30
167 ],
168 _babelType: "TypeAnnotation"
169 },
170 body: {
171 type: "BlockStatement",
172 start: 31,
173 end: 33,
174 loc: {
175 start: {
176 line: 1,
177 column: 31
178 },
179 end: {
180 line: 1,
181 column: 33
182 }
183 },
184 body: [],
185 range: [
186 31,
187 33
188 ],
189 _babelType: "BlockStatement"
190 },
191 range: [
192 0,
193 33
194 ],
195 _babelType: "FunctionDeclaration"
196 }
197 ],
198 tokens: [
199 {
200 type: "Keyword",
201 value: "function",
202 start: 0,
203 end: 8,
204 loc: {
205 start: {
206 line: 1,
207 column: 0
208 },
209 end: {
210 line: 1,
211 column: 8
212 }
213 },
214 range: [
215 0,
216 8
217 ]
218 },
219 {
220 type: "Identifier",
221 value: "foo",
222 start: 9,
223 end: 12,
224 loc: {
225 start: {
226 line: 1,
227 column: 9
228 },
229 end: {
230 line: 1,
231 column: 12
232 }
233 },
234 range: [
235 9,
236 12
237 ]
238 },
239 {
240 type: "Punctuator",
241 value: "(",
242 start: 12,
243 end: 13,
244 loc: {
245 start: {
246 line: 1,
247 column: 12
248 },
249 end: {
250 line: 1,
251 column: 13
252 }
253 },
254 range: [
255 12,
256 13
257 ]
258 },
259 {
260 type: "Identifier",
261 value: "a",
262 start: 13,
263 end: 14,
264 loc: {
265 start: {
266 line: 1,
267 column: 13
268 },
269 end: {
270 line: 1,
271 column: 14
272 }
273 },
274 range: [
275 13,
276 14
277 ]
278 },
279 {
280 type: "Punctuator",
281 value: ")",
282 start: 14,
283 end: 15,
284 loc: {
285 start: {
286 line: 1,
287 column: 14
288 },
289 end: {
290 line: 1,
291 column: 15
292 }
293 },
294 range: [
295 14,
296 15
297 ]
298 },
299 {
300 type: "Punctuator",
301 value: ":",
302 start: 15,
303 end: 16,
304 loc: {
305 start: {
306 line: 1,
307 column: 15
308 },
309 end: {
310 line: 1,
311 column: 16
312 }
313 },
314 range: [
315 15,
316 16
317 ]
318 },
319 {
320 type: "Punctuator",
321 value: "{",
322 start: 17,
323 end: 18,
324 loc: {
325 start: {
326 line: 1,
327 column: 17
328 },
329 end: {
330 line: 1,
331 column: 18
332 }
333 },
334 range: [
335 17,
336 18
337 ]
338 },
339 {
340 type: "Identifier",
341 value: "b",
342 start: 18,
343 end: 19,
344 loc: {
345 start: {
346 line: 1,
347 column: 18
348 },
349 end: {
350 line: 1,
351 column: 19
352 }
353 },
354 range: [
355 18,
356 19
357 ]
358 },
359 {
360 type: "Punctuator",
361 value: ":",
362 start: 19,
363 end: 20,
364 loc: {
365 start: {
366 line: 1,
367 column: 19
368 },
369 end: {
370 line: 1,
371 column: 20
372 }
373 },
374 range: [
375 19,
376 20
377 ]
378 },
379 {
380 type: "Identifier",
381 value: "boolean",
382 start: 21,
383 end: 28,
384 loc: {
385 start: {
386 line: 1,
387 column: 21
388 },
389 end: {
390 line: 1,
391 column: 28
392 }
393 },
394 range: [
395 21,
396 28
397 ]
398 },
399 {
400 type: "Punctuator",
401 value: ",",
402 start: 28,
403 end: 29,
404 loc: {
405 start: {
406 line: 1,
407 column: 28
408 },
409 end: {
410 line: 1,
411 column: 29
412 }
413 },
414 range: [
415 28,
416 29
417 ]
418 },
419 {
420 type: "Punctuator",
421 value: "}",
422 start: 29,
423 end: 30,
424 loc: {
425 start: {
426 line: 1,
427 column: 29
428 },
429 end: {
430 line: 1,
431 column: 30
432 }
433 },
434 range: [
435 29,
436 30
437 ]
438 },
439 {
440 type: "Punctuator",
441 value: "{",
442 start: 31,
443 end: 32,
444 loc: {
445 start: {
446 line: 1,
447 column: 31
448 },
449 end: {
450 line: 1,
451 column: 32
452 }
453 },
454 range: [
455 31,
456 32
457 ]
458 },
459 {
460 type: "Punctuator",
461 value: "}",
462 start: 32,
463 end: 33,
464 loc: {
465 start: {
466 line: 1,
467 column: 32
468 },
469 end: {
470 line: 1,
471 column: 33
472 }
473 },
474 range: [
475 32,
476 33
477 ]
478 },
479 {
480 type: {
481 label: "eof",
482 beforeExpr: false,
483 startsExpr: false,
484 rightAssociative: false,
485 isLoop: false,
486 isAssign: false,
487 prefix: false,
488 postfix: false,
489 binop: null,
490 updateContext: null
491 },
492 start: 33,
493 end: 33,
494 loc: {
495 start: {
496 line: 1,
497 column: 33
498 },
499 end: {
500 line: 1,
501 column: 33
502 }
503 },
504 range: [
505 33,
506 33
507 ]
508 }
509 ],
510 comments: [],
511 range: [
512 0,
513 33
514 ],
515 _paths: [
516 {
517 contexts: [],
518 parent: "[Circular ~]",
519 data: {},
520 shouldSkip: false,
521 shouldStop: false,
522 removed: false,
523 opts: {
524 noScope: true,
525 enter: [
526 null
527 ],
528 exit: [
529 null
530 ],
531 _exploded: true,
532 _verified: true
533 },
534 skipKeys: {},
535 parentPath: null,
536 context: {
537 queue: null,
538 opts: {
539 noScope: true,
540 enter: [
541 null
542 ],
543 exit: [
544 null
545 ],
546 _exploded: true,
547 _verified: true
548 }
549 },
550 container: [
551 {
552 type: "FunctionDeclaration",
553 start: 0,
554 end: 33,
555 loc: {
556 start: {
557 line: 1,
558 column: 0
559 },
560 end: {
561 line: 1,
562 column: 33
563 }
564 },
565 id: {
566 type: "Identifier",
567 start: 9,
568 end: 12,
569 loc: {
570 start: {
571 line: 1,
572 column: 9
573 },
574 end: {
575 line: 1,
576 column: 12
577 }
578 },
579 name: "foo",
580 range: [
581 9,
582 12
583 ],
584 _babelType: "Identifier"
585 },
586 generator: false,
587 expression: false,
588 async: false,
589 params: [
590 {
591 type: "Identifier",
592 start: 13,
593 end: 14,
594 loc: {
595 start: {
596 line: 1,
597 column: 13
598 },
599 end: {
600 line: 1,
601 column: 14
602 }
603 },
604 name: "a",
605 range: [
606 13,
607 14
608 ],
609 _babelType: "Identifier"
610 }
611 ],
612 returnType: {
613 type: "TypeAnnotation",
614 start: 15,
615 end: 30,
616 loc: {
617 start: {
618 line: 1,
619 column: 15
620 },
621 end: {
622 line: 1,
623 column: 30
624 }
625 },
626 typeAnnotation: {
627 type: "ObjectTypeAnnotation",
628 start: 17,
629 end: 30,
630 loc: {
631 start: {
632 line: 1,
633 column: 17
634 },
635 end: {
636 line: 1,
637 column: 30
638 }
639 },
640 callProperties: [],
641 properties: [
642 {
643 type: "ObjectTypeProperty",
644 start: 18,
645 end: 29,
646 loc: {
647 start: {
648 line: 1,
649 column: 18
650 },
651 end: {
652 line: 1,
653 column: 29
654 }
655 },
656 value: {
657 type: "BooleanTypeAnnotation",
658 start: 21,
659 end: 28,
660 loc: {
661 start: {
662 line: 1,
663 column: 21
664 },
665 end: {
666 line: 1,
667 column: 28
668 }
669 },
670 range: [
671 21,
672 28
673 ],
674 _babelType: "BooleanTypeAnnotation"
675 },
676 optional: false,
677 range: [
678 18,
679 29
680 ],
681 _babelType: "ObjectTypeProperty"
682 }
683 ],
684 indexers: [],
685 range: [
686 17,
687 30
688 ],
689 _babelType: "ObjectTypeAnnotation"
690 },
691 range: [
692 15,
693 30
694 ],
695 _babelType: "TypeAnnotation"
696 },
697 body: {
698 type: "BlockStatement",
699 start: 31,
700 end: 33,
701 loc: {
702 start: {
703 line: 1,
704 column: 31
705 },
706 end: {
707 line: 1,
708 column: 33
709 }
710 },
711 body: [],
712 range: [
713 31,
714 33
715 ],
716 _babelType: "BlockStatement"
717 },
718 range: [
719 0,
720 33
721 ],
722 _babelType: "FunctionDeclaration"
723 }
724 ],
725 listKey: "body",
726 inList: true,
727 parentKey: "body",
728 key: 0,
729 node: {
730 type: "FunctionDeclaration",
731 start: 0,
732 end: 33,
733 loc: {
734 start: {
735 line: 1,
736 column: 0
737 },
738 end: {
739 line: 1,
740 column: 33
741 }
742 },
743 id: {
744 type: "Identifier",
745 start: 9,
746 end: 12,
747 loc: {
748 start: {
749 line: 1,
750 column: 9
751 },
752 end: {
753 line: 1,
754 column: 12
755 }
756 },
757 name: "foo",
758 range: [
759 9,
760 12
761 ],
762 _babelType: "Identifier"
763 },
764 generator: false,
765 expression: false,
766 async: false,
767 params: [
768 {
769 type: "Identifier",
770 start: 13,
771 end: 14,
772 loc: {
773 start: {
774 line: 1,
775 column: 13
776 },
777 end: {
778 line: 1,
779 column: 14
780 }
781 },
782 name: "a",
783 range: [
784 13,
785 14
786 ],
787 _babelType: "Identifier"
788 }
789 ],
790 returnType: {
791 type: "TypeAnnotation",
792 start: 15,
793 end: 30,
794 loc: {
795 start: {
796 line: 1,
797 column: 15
798 },
799 end: {
800 line: 1,
801 column: 30
802 }
803 },
804 typeAnnotation: {
805 type: "ObjectTypeAnnotation",
806 start: 17,
807 end: 30,
808 loc: {
809 start: {
810 line: 1,
811 column: 17
812 },
813 end: {
814 line: 1,
815 column: 30
816 }
817 },
818 callProperties: [],
819 properties: [
820 {
821 type: "ObjectTypeProperty",
822 start: 18,
823 end: 29,
824 loc: {
825 start: {
826 line: 1,
827 column: 18
828 },
829 end: {
830 line: 1,
831 column: 29
832 }
833 },
834 value: {
835 type: "BooleanTypeAnnotation",
836 start: 21,
837 end: 28,
838 loc: {
839 start: {
840 line: 1,
841 column: 21
842 },
843 end: {
844 line: 1,
845 column: 28
846 }
847 },
848 range: [
849 21,
850 28
851 ],
852 _babelType: "BooleanTypeAnnotation"
853 },
854 optional: false,
855 range: [
856 18,
857 29
858 ],
859 _babelType: "ObjectTypeProperty"
860 }
861 ],
862 indexers: [],
863 range: [
864 17,
865 30
866 ],
867 _babelType: "ObjectTypeAnnotation"
868 },
869 range: [
870 15,
871 30
872 ],
873 _babelType: "TypeAnnotation"
874 },
875 body: {
876 type: "BlockStatement",
877 start: 31,
878 end: 33,
879 loc: {
880 start: {
881 line: 1,
882 column: 31
883 },
884 end: {
885 line: 1,
886 column: 33
887 }
888 },
889 body: [],
890 range: [
891 31,
892 33
893 ],
894 _babelType: "BlockStatement"
895 },
896 range: [
897 0,
898 33
899 ],
900 _babelType: "FunctionDeclaration"
901 },
902 scope: null,
903 type: "FunctionDeclaration",
904 typeAnnotation: null
905 }
906 ]
907 });