Skip to content

Commit daeb4c1

Browse files
committed
nit: formatting
1 parent 8d74c21 commit daeb4c1

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

packages/compiler/src/shared/types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ export interface TransformOptions {
6767
renderScript?: boolean;
6868
}
6969

70-
export type ConvertToTSXOptions = Pick<TransformOptions, 'filename' | 'normalizedFilename' | 'sourcemap'> & {
70+
export type ConvertToTSXOptions = Pick<
71+
TransformOptions,
72+
'filename' | 'normalizedFilename' | 'sourcemap'
73+
> & {
7174
/** If set to true, script tags content will be included in the generated TSX
7275
* Scripts will be wrapped in an arrow function to be compatible with JSX's spec
7376
*/

packages/compiler/test/tsx/escape.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,40 +44,40 @@ export default function __AstroComponent_(_props: Record<string, any>): any {}\n
4444
});
4545

4646
test('does not escape tag opening unnecessarily', async () => {
47-
const input = `<div></div>
47+
const input = `<div></div>
4848
<div`;
49-
const output = `${TSXPrefix}<Fragment>
49+
const output = `${TSXPrefix}<Fragment>
5050
<div></div>
5151
<div
5252
</Fragment>
5353
export default function __AstroComponent_(_props: Record<string, any>): any {}\n`;
54-
const { code } = await convertToTSX(input, { sourcemap: 'external' });
55-
assert.snapshot(code, output, 'expected code to match snapshot');
54+
const { code } = await convertToTSX(input, { sourcemap: 'external' });
55+
assert.snapshot(code, output, 'expected code to match snapshot');
5656
});
5757

5858
test('does not escape tag opening unnecessarily II', async () => {
59-
const input = `<div>
59+
const input = `<div>
6060
<div
6161
</div>
6262
`;
63-
const output = `${TSXPrefix}<Fragment>
63+
const output = `${TSXPrefix}<Fragment>
6464
<div>
6565
<div div {...{"<":true}}>
6666
</div></div>
6767
</Fragment>
6868
export default function __AstroComponent_(_props: Record<string, any>): any {}\n`;
69-
const { code } = await convertToTSX(input, { sourcemap: 'external' });
70-
assert.snapshot(code, output, 'expected code to match snapshot');
69+
const { code } = await convertToTSX(input, { sourcemap: 'external' });
70+
assert.snapshot(code, output, 'expected code to match snapshot');
7171
});
7272

7373
test('does not escape tag opening unnecessarily III', async () => {
74-
const input = '<div>{[].map((something) => <div><Blocknote</div><div><Image</div>)}</div>';
75-
const output = `${TSXPrefix}<Fragment>
74+
const input = '<div>{[].map((something) => <div><Blocknote</div><div><Image</div>)}</div>';
75+
const output = `${TSXPrefix}<Fragment>
7676
<div>{[].map((something) => <Fragment><div><Blocknote< div><div><Image< div>)</Image<></div></Blocknote<></div></Fragment>}</div>
7777
</Fragment>
7878
export default function __AstroComponent_(_props: Record<string, any>): any {}\n`;
79-
const { code } = await convertToTSX(input, { sourcemap: 'external' });
80-
assert.snapshot(code, output, 'expected code to match snapshot');
79+
const { code } = await convertToTSX(input, { sourcemap: 'external' });
80+
assert.snapshot(code, output, 'expected code to match snapshot');
8181
});
8282

8383
test.run();

0 commit comments

Comments
 (0)