This repository was archived by the owner on Jun 15, 2023. It is now read-only.
Commit 2074447
authored
Put each jsx tag on own line (#574)
* Put each JSX tag on its own line
* Put each JSX tag nested in fragment on its own line
* Refactor code to be more DRY
* Avoid list allocations while looking for nested JSX exprs
* Simplify “has nested jsx” check, do not recurse in non-list child exprs
* Bring back recursion while looking for nested JSX, add more tests
* Minor code styling
* Put JSX children on own lines when more than two found
* Simplify and more precise name for nested jsx search function1 parent b1b9b5e commit 2074447
File tree
7 files changed
+93
-15
lines changed- src
- tests/printer
- expr
- expected
- other/expected
- pattern/expected
7 files changed
+93
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
102 | 114 | | |
103 | 115 | | |
104 | 116 | | |
| |||
3694 | 3706 | | |
3695 | 3707 | | |
3696 | 3708 | | |
| 3709 | + | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
3697 | 3715 | | |
3698 | 3716 | | |
3699 | 3717 | | |
| |||
3728 | 3746 | | |
3729 | 3747 | | |
3730 | 3748 | | |
3731 | | - | |
| 3749 | + | |
3732 | 3750 | | |
3733 | 3751 | | |
3734 | | - | |
| 3752 | + | |
3735 | 3753 | | |
3736 | 3754 | | |
3737 | 3755 | | |
| |||
3741 | 3759 | | |
3742 | 3760 | | |
3743 | 3761 | | |
3744 | | - | |
| 3762 | + | |
| 3763 | + | |
| 3764 | + | |
3745 | 3765 | | |
3746 | 3766 | | |
3747 | 3767 | | |
3748 | 3768 | | |
3749 | 3769 | | |
3750 | 3770 | | |
3751 | | - | |
3752 | | - | |
| 3771 | + | |
| 3772 | + | |
| 3773 | + | |
| 3774 | + | |
3753 | 3775 | | |
3754 | 3776 | | |
3755 | 3777 | | |
3756 | | - | |
| 3778 | + | |
3757 | 3779 | | |
3758 | 3780 | | |
3759 | 3781 | | |
3760 | 3782 | | |
3761 | | - | |
| 3783 | + | |
3762 | 3784 | | |
3763 | 3785 | | |
3764 | 3786 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
234 | 236 | | |
235 | 237 | | |
236 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
8 | 39 | | |
9 | 40 | | |
10 | 41 | | |
| |||
58 | 89 | | |
59 | 90 | | |
60 | 91 | | |
61 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
62 | 95 | | |
63 | 96 | | |
64 | 97 | | |
| |||
258 | 291 | | |
259 | 292 | | |
260 | 293 | | |
261 | | - | |
262 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
263 | 302 | | |
264 | 303 | | |
265 | 304 | | |
| |||
271 | 310 | | |
272 | 311 | | |
273 | 312 | | |
274 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
275 | 316 | | |
276 | 317 | | |
277 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
0 commit comments