Skip to content

Commit

Permalink
fix(tsx): Remove unnecessary jsdoc comment (#967)
Browse files Browse the repository at this point in the history
* fix(tsx): Remove unnecessary jsdoc comment

* chore: changeset
  • Loading branch information
Princesseuh committed Feb 13, 2024
1 parent a7c48c6 commit 6ffa54b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
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';

0 comments on commit 6ffa54b

Please sign in to comment.