Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tsx): Remove unnecessary jsdoc comment #967

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bright-lemons-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/compiler': patch
---

Fix TSX output prefixing output with unnecessary jsdoc comment
2 changes: 1 addition & 1 deletion internal/printer/print-to-tsx.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

func getTSXPrefix() string {
return "/** @jsxImportSource astro */\n\n"
return "/* @jsxImportSource astro */\n\n"
}

func PrintToTSX(sourcetext string, n *Node, opts transform.TransformOptions, h *handler.Handler) PrintResult {
Expand Down
16 changes: 8 additions & 8 deletions packages/compiler/test/tsx/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,12 @@ test('return ranges', async () => {

assert.equal(metaRanges, {
frontmatter: {
start: 31,
end: 55,
start: 30,
end: 54,
},
body: {
start: 69,
end: 81,
start: 68,
end: 80,
},
});
});
Expand All @@ -267,12 +267,12 @@ test('return ranges - no frontmatter', async () => {

assert.equal(metaRanges, {
frontmatter: {
start: 31,
end: 31,
start: 30,
end: 30,
},
body: {
start: 42,
end: 54,
start: 41,
end: 53,
},
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ export async function testJSSourcemap(input: string, snippet: string) {

return originalPosition;
}
export const TSXPrefix = '/** @jsxImportSource astro */\n\n';
export const TSXPrefix = '/* @jsxImportSource astro */\n\n';
Loading