Skip to content

Commit 31dd6e3

Browse files
so1vejohnsoncodehk
andauthored
fix: add a newline after comments (#3549)
Co-authored-by: Johnson Chu <[email protected]>
1 parent e39ab06 commit 31dd6e3

File tree

2 files changed

+6
-2
lines changed
  • packages
    • vue-language-core/src/generators
    • vue-test-workspace/vue-tsc/non-strict-template/#3548

2 files changed

+6
-2
lines changed

packages/vue-language-core/src/generators/script.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ export function generate(
266266
return;
267267

268268
codes.push([
269-
sfc.scriptSetup.content.substring(0, Math.max(scriptSetupRanges.importSectionEndOffset, scriptSetupRanges.leadingCommentEndOffset)),
269+
sfc.scriptSetup.content.substring(0, Math.max(scriptSetupRanges.importSectionEndOffset, scriptSetupRanges.leadingCommentEndOffset)) + '\n',
270270
'scriptSetup',
271271
0,
272272
FileRangeCapabilities.full,
@@ -465,7 +465,6 @@ export function generate(
465465

466466
if (vueCompilerOptions.target >= 3.3) {
467467
const bindings = new Set(scriptSetupRanges.bindings.map(range => sfc.scriptSetup!.content.substring(range.start, range.end)));
468-
codes.push('\n');
469468
codes.push('const { ');
470469
for (const [macro, aliases] of Object.entries(vueCompilerOptions.macros)) {
471470
for (const alias of aliases) {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script setup lang="ts" generic="T">
2+
// @experimentalDefinePropProposal=johnsonEdition
3+
4+
defineProp<T>();
5+
</script>

0 commit comments

Comments
 (0)