Skip to content

Commit 9babd6d

Browse files
authored
Prettier (#140)
* Added a note about debug mode * Update README.md Added image of debug mode * Ran prettier on the files
1 parent d430e1d commit 9babd6d

File tree

88 files changed

+483
-447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+483
-447
lines changed

__tests__/altNodes/altConversions.test.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe("AltConversions", () => {
1616
rectangle.resize(20, 20);
1717

1818
expect(tailwindMain(convertIntoAltNodes([rectangle]))).toEqual(
19-
'<div class="w-5 h-5"></div>'
19+
'<div class="w-5 h-5"></div>',
2020
);
2121
});
2222

@@ -42,7 +42,7 @@ describe("AltConversions", () => {
4242
expect(htmlMain(convertIntoAltNodes([frame]))).toEqual(
4343
`<div style="width: 20px; height: 20px;">
4444
<div style="width: 20px; height: 20px;"></div>
45-
</div>`
45+
</div>`,
4646
);
4747
});
4848

@@ -100,7 +100,7 @@ describe("AltConversions", () => {
100100
node.characters = "";
101101

102102
expect(
103-
tailwindMain(convertIntoAltNodes([node], new AltFrameNode()))
103+
tailwindMain(convertIntoAltNodes([node], new AltFrameNode())),
104104
).toEqual(`<p></p>`);
105105
});
106106

@@ -125,7 +125,7 @@ describe("AltConversions", () => {
125125
Object.defineProperty(node, "height", { value: 20 });
126126

127127
expect(
128-
tailwindMain(convertIntoAltNodes([node], new AltFrameNode()))
128+
tailwindMain(convertIntoAltNodes([node], new AltFrameNode())),
129129
).toEqual(`<div class="w-5 h-5 rounded-full"></div>`);
130130
});
131131

@@ -145,7 +145,7 @@ describe("AltConversions", () => {
145145
Object.defineProperty(node, "width", { value: 20 });
146146

147147
expect(
148-
tailwindMain(convertIntoAltNodes([node], new AltFrameNode()))
148+
tailwindMain(convertIntoAltNodes([node], new AltFrameNode())),
149149
).toEqual(`<div class="w-5 h-0.5"></div>`);
150150
});
151151

@@ -172,9 +172,7 @@ describe("AltConversions", () => {
172172
Object.defineProperty(node, "height", { value: 20 });
173173

174174
expect(
175-
tailwindMain(convertIntoAltNodes([node], new AltFrameNode()))
176-
).toEqual(
177-
`<div class="w-5 h-5 bg-pink-900/50 rounded-lg"></div>`
178-
);
175+
tailwindMain(convertIntoAltNodes([node], new AltFrameNode())),
176+
).toEqual(`<div class="w-5 h-5 bg-pink-900/50 rounded-lg"></div>`);
179177
});
180178
});

__tests__/altNodes/convertNodesOnRectangle.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe("convert node if child is big rect", () => {
4747
expect(tailwindMain([converted])).toEqual(
4848
`<div class="w-24 h-24">
4949
<div class="w-full h-full bg-black"></div>
50-
</div>`
50+
</div>`,
5151
);
5252
});
5353

@@ -105,7 +105,7 @@ describe("convert node if child is big rect", () => {
105105
<div class="inline-flex items-start justify-start w-full h-full pr-12 pb-12">
106106
<div class="flex-1 h-full bg-white"></div>
107107
</div>
108-
</div>`
108+
</div>`,
109109
);
110110
});
111111

@@ -163,7 +163,7 @@ describe("convert node if child is big rect", () => {
163163
<div class="inline-flex items-center justify-center w-full h-full p-1 bg-black">
164164
<div class="flex-1 h-full bg-white"></div>
165165
</div>
166-
</div>`
166+
</div>`,
167167
);
168168
});
169169

@@ -256,7 +256,7 @@ describe("convert node if child is big rect", () => {
256256
expect(tailwindMain([conv])).toEqual(
257257
`<div class="inline-flex items-start justify-start w-5 h-5 pr-3 pb-3 bg-black">
258258
<div class="flex-1 h-full bg-white"></div>
259-
</div>`
259+
</div>`,
260260
);
261261
});
262262

__tests__/altNodes/convertToAutoLayout.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe("Convert to AutoLayout", () => {
6060
`<div class="inline-flex items-start justify-end w-12 h-12 pr-2.5 pb-8">
6161
<div class="w-1/2 h-full bg-white"></div>
6262
<div class="w-1/2 h-full bg-black"></div>
63-
</div>`
63+
</div>`,
6464
);
6565

6666
// output should be VERTICAL
@@ -73,7 +73,7 @@ describe("Convert to AutoLayout", () => {
7373
`<div class="inline-flex flex-col items-start justify-end w-12 h-12 pr-8 pb-2.5">
7474
<div class="w-full h-1/2 bg-white"></div>
7575
<div class="w-full h-1/2 bg-black"></div>
76-
</div>`
76+
</div>`,
7777
);
7878

7979
// horizontally align while vertical
@@ -88,7 +88,7 @@ describe("Convert to AutoLayout", () => {
8888
`<div class="inline-flex flex-col space-y-1 items-end justify-end w-12 h-12 pb-1">
8989
<div class="w-full h-5 bg-white"></div>
9090
<div class="w-5 h-5 bg-black"></div>
91-
</div>`
91+
</div>`,
9292
);
9393

9494
// vertically align while horizontal
@@ -104,7 +104,7 @@ describe("Convert to AutoLayout", () => {
104104
`<div class="inline-flex items-end justify-end w-12 h-12 pr-2.5">
105105
<div class="w-1/2 h-full bg-white"></div>
106106
<div class="w-1/2 h-5 bg-black"></div>
107-
</div>`
107+
</div>`,
108108
);
109109

110110
node1.height = 20;
@@ -119,7 +119,7 @@ describe("Convert to AutoLayout", () => {
119119
`<div class="relative" style="width: 50px; height: 50px;">
120120
<div class="w-5 h-5 absolute bg-black" style="left: 10px; top: 10px;"></div>
121121
<div class="w-5 h-5 absolute left-0 top-0 bg-white"></div>
122-
</div>`
122+
</div>`,
123123
);
124124
});
125125

__tests__/flutter/builderImpl/flutterBlend.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("Flutter Blend", () => {
1717
`Opacity(
1818
opacity: 0.50,
1919
child: test
20-
),`
20+
),`,
2121
);
2222

2323
node.opacity = 1.0;
@@ -33,7 +33,7 @@ describe("Flutter Blend", () => {
3333
`Visibility(
3434
visible: false,
3535
child: test
36-
),`
36+
),`,
3737
);
3838

3939
node.visible = true;
@@ -53,23 +53,23 @@ describe("Flutter Blend", () => {
5353
`Transform.rotate(
5454
angle: -0.79,
5555
child: test
56-
),`
56+
),`,
5757
);
5858

5959
node.rotation = -45;
6060
expect(flutterRotation(node, "test")).toEqual(
6161
`Transform.rotate(
6262
angle: 0.79,
6363
child: test
64-
),`
64+
),`,
6565
);
6666

6767
node.rotation = 90;
6868
expect(flutterRotation(node, "test")).toEqual(
6969
`Transform.rotate(
7070
angle: -1.57,
7171
child: test
72-
),`
72+
),`,
7373
);
7474
});
7575
});

__tests__/flutter/builderImpl/flutterBorder.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe("Flutter Border", () => {
2121

2222
node.cornerRadius = 2;
2323
expect(flutterBorderRadius(node)).toEqual(
24-
"\nborderRadius: BorderRadius.circular(2),"
24+
"\nborderRadius: BorderRadius.circular(2),",
2525
);
2626

2727
node.cornerRadius = figma.mixed;
@@ -30,7 +30,7 @@ describe("Flutter Border", () => {
3030
node.bottomLeftRadius = 0;
3131
node.bottomRightRadius = 0;
3232
expect(flutterBorderRadius(node)).toEqual(
33-
"\nborderRadius: BorderRadius.only(topLeft: Radius.circular(2), topRight: Radius.circular(0), bottomLeft: Radius.circular(0), bottomRight: Radius.circular(0), ),"
33+
"\nborderRadius: BorderRadius.only(topLeft: Radius.circular(2), topRight: Radius.circular(0), bottomLeft: Radius.circular(0), bottomRight: Radius.circular(0), ),",
3434
);
3535

3636
const ellipseNode = new AltEllipseNode();
@@ -47,7 +47,7 @@ describe("Flutter Border", () => {
4747
},
4848
];
4949
expect(flutterBorder(node)).toEqual(
50-
"\nborder: Border.all(color: Colors.black, width: 2, ),"
50+
"\nborder: Border.all(color: Colors.black, width: 2, ),",
5151
);
5252

5353
node.strokeWeight = 0;
@@ -67,7 +67,7 @@ describe("Flutter Border", () => {
6767
expect(flutterShape(node)).toEqual(
6868
`\nshape: RoundedRectangleBorder(
6969
borderRadius: BorderRadius.only(topLeft: Radius.circular(4), topRight: Radius.circular(0), bottomLeft: Radius.circular(0), bottomRight: Radius.circular(0), ),
70-
),`
70+
),`,
7171
);
7272

7373
const ellipseNode = new AltEllipseNode();
@@ -81,7 +81,7 @@ describe("Flutter Border", () => {
8181
expect(flutterShape(ellipseNode)).toEqual(
8282
`\nshape: CircleBorder(
8383
side: BorderSide(width: 4, color: Color(0xff3f3f3f), ),
84-
),`
84+
),`,
8585
);
8686
});
8787
});

__tests__/flutter/builderImpl/flutterColor.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe("Flutter Color", () => {
2525
];
2626

2727
expect(flutterBoxDecorationColor(node.fills)).toEqual(
28-
"\ncolor: Color(0xffef5138),"
28+
"\ncolor: Color(0xffef5138),",
2929
);
3030
});
3131

@@ -107,7 +107,7 @@ describe("Flutter Color", () => {
107107
},
108108
];
109109
expect(flutterBoxDecorationColor(node.fills)).toEqual(
110-
"\ncolor: Color(0x00000000),"
110+
"\ncolor: Color(0x00000000),",
111111
);
112112
});
113113

@@ -135,7 +135,7 @@ describe("Flutter Color", () => {
135135
node.fills = [gradientFill];
136136

137137
expect(flutterBoxDecorationColor(node.fills)).toEqual(
138-
"\ngradient: LinearGradient(begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [Colors.black], ),"
138+
"\ngradient: LinearGradient(begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [Colors.black], ),",
139139
);
140140

141141
// topLeft to bottomRight (135)
@@ -144,7 +144,7 @@ describe("Flutter Color", () => {
144144
[1.3402682542800903, -1.4652644395828247, 0.5407097935676575],
145145
]);
146146
expect(flutterBoxDecorationColor(node.fills)).toEqual(
147-
"\ngradient: LinearGradient(begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [Colors.black], ),"
147+
"\ngradient: LinearGradient(begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [Colors.black], ),",
148148
);
149149

150150
// bottom to top (-90)
@@ -153,7 +153,7 @@ describe("Flutter Color", () => {
153153
[-2.3507132530212402, -1.0997783306265774e-7, 1.6796307563781738],
154154
]);
155155
expect(flutterBoxDecorationColor(node.fills)).toEqual(
156-
"\ngradient: LinearGradient(begin: Alignment.bottomCenter, end: Alignment.topCenter, colors: [Colors.black], ),"
156+
"\ngradient: LinearGradient(begin: Alignment.bottomCenter, end: Alignment.topCenter, colors: [Colors.black], ),",
157157
);
158158

159159
// top to bottom (90)
@@ -162,7 +162,7 @@ describe("Flutter Color", () => {
162162
[3.9725232124328613, -1.4210854715202004e-14, -0.8289895057678223],
163163
]);
164164
expect(flutterBoxDecorationColor(node.fills)).toEqual(
165-
"\ngradient: LinearGradient(begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [Colors.black], ),"
165+
"\ngradient: LinearGradient(begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [Colors.black], ),",
166166
);
167167

168168
// left to right (0)
@@ -171,7 +171,7 @@ describe("Flutter Color", () => {
171171
[6.030897026221282e-8, -3.364259719848633, 2.188383102416992],
172172
]);
173173
expect(flutterBoxDecorationColor(node.fills)).toEqual(
174-
"\ngradient: LinearGradient(begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [Colors.black], ),"
174+
"\ngradient: LinearGradient(begin: Alignment.centerLeft, end: Alignment.centerRight, colors: [Colors.black], ),",
175175
);
176176

177177
// right to left (180)
@@ -180,7 +180,7 @@ describe("Flutter Color", () => {
180180
[0.07747448235750198, 4.357592582702637, -1.0299113988876343],
181181
]);
182182
expect(flutterBoxDecorationColor(node.fills)).toEqual(
183-
"\ngradient: LinearGradient(begin: Alignment.centerRight, end: Alignment.centerLeft, colors: [Colors.black], ),"
183+
"\ngradient: LinearGradient(begin: Alignment.centerRight, end: Alignment.centerLeft, colors: [Colors.black], ),",
184184
);
185185

186186
// bottom left to top right (-135)
@@ -189,7 +189,7 @@ describe("Flutter Color", () => {
189189
[-3.7344324588775635, 2.3110527992248535, 0.4661891460418701],
190190
]);
191191
expect(flutterBoxDecorationColor(node.fills)).toEqual(
192-
"\ngradient: LinearGradient(begin: Alignment.bottomRight, end: Alignment.topLeft, colors: [Colors.black], ),"
192+
"\ngradient: LinearGradient(begin: Alignment.bottomRight, end: Alignment.topLeft, colors: [Colors.black], ),",
193193
);
194194

195195
// bottom left to top right (-45)
@@ -198,7 +198,7 @@ describe("Flutter Color", () => {
198198
[-1.3051068782806396, -1.3525396585464478, 1.8345310688018799],
199199
]);
200200
expect(flutterBoxDecorationColor(node.fills)).toEqual(
201-
"\ngradient: LinearGradient(begin: Alignment.bottomLeft, end: Alignment.topRight, colors: [Colors.black], ),"
201+
"\ngradient: LinearGradient(begin: Alignment.bottomLeft, end: Alignment.topRight, colors: [Colors.black], ),",
202202
);
203203

204204
// top right to bottom left (-45)
@@ -207,7 +207,7 @@ describe("Flutter Color", () => {
207207
[1.5028705596923828, 1.2872726917266846, -1.0877336263656616],
208208
]);
209209
expect(flutterBoxDecorationColor(node.fills)).toEqual(
210-
"\ngradient: LinearGradient(begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [Colors.black], ),"
210+
"\ngradient: LinearGradient(begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [Colors.black], ),",
211211
);
212212
});
213213

@@ -264,7 +264,7 @@ describe("Flutter Color", () => {
264264
border: Border.all(color: Color(0xff3f3f3f), width: 4, ),
265265
gradient: LinearGradient(begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [Colors.black, Color(0xffff0000)], ),
266266
),
267-
)`
267+
)`,
268268
);
269269
});
270270

__tests__/flutter/builderImpl/flutterPadding.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,39 @@ describe("Flutter Padding", () => {
1919
frameNode.paddingTop = 2;
2020
frameNode.paddingBottom = 2;
2121
expect(flutterPadding(frameNode)).toEqual(
22-
"\npadding: const EdgeInsets.all(2),"
22+
"\npadding: const EdgeInsets.all(2),",
2323
);
2424

2525
frameNode.paddingLeft = 1;
2626
frameNode.paddingRight = 2;
2727
frameNode.paddingTop = 3;
2828
frameNode.paddingBottom = 4;
2929
expect(flutterPadding(frameNode)).toEqual(
30-
"\npadding: const EdgeInsets.only(left: 1, right: 2, top: 3, bottom: 4, ),"
30+
"\npadding: const EdgeInsets.only(left: 1, right: 2, top: 3, bottom: 4, ),",
3131
);
3232

3333
frameNode.paddingLeft = 2;
3434
frameNode.paddingRight = 2;
3535
frameNode.paddingTop = 4;
3636
frameNode.paddingBottom = 4;
3737
expect(flutterPadding(frameNode)).toEqual(
38-
"\npadding: const EdgeInsets.symmetric(horizontal: 2, vertical: 4, ),"
38+
"\npadding: const EdgeInsets.symmetric(horizontal: 2, vertical: 4, ),",
3939
);
4040

4141
frameNode.paddingLeft = 2;
4242
frameNode.paddingRight = 2;
4343
frameNode.paddingTop = 0;
4444
frameNode.paddingBottom = 0;
4545
expect(flutterPadding(frameNode)).toEqual(
46-
"\npadding: const EdgeInsets.symmetric(horizontal: 2, ),"
46+
"\npadding: const EdgeInsets.symmetric(horizontal: 2, ),",
4747
);
4848

4949
frameNode.paddingLeft = 0;
5050
frameNode.paddingRight = 0;
5151
frameNode.paddingTop = 2;
5252
frameNode.paddingBottom = 2;
5353
expect(flutterPadding(frameNode)).toEqual(
54-
"\npadding: const EdgeInsets.symmetric(vertical: 2, ),"
54+
"\npadding: const EdgeInsets.symmetric(vertical: 2, ),",
5555
);
5656

5757
frameNode.paddingLeft = 0;

0 commit comments

Comments
 (0)