Skip to content

Fix TypeScript declaration spacing - #5162

Open
Jialin Huang (JialinHuang803) wants to merge 3 commits into
Azure:mainfrom
JialinHuang803:jialinhuang/restore-typespec-ts-blank-lines
Open

Fix TypeScript declaration spacing#5162
Jialin Huang (JialinHuang803) wants to merge 3 commits into
Azure:mainfrom
JialinHuang803:jialinhuang/restore-typespec-ts-blank-lines

Conversation

@JialinHuang803

Copy link
Copy Markdown
Member

Summary

  • restore blank lines between generated class, enum, function, interface, and type-alias declarations
  • preserve existing leading trivia while leaving import/export grouping unchanged
  • add focused coverage for separate and batched ts-morph insertions

Validation

  • TypeScript emitter build
  • typespec-ts test-next suite (258 tests)

Restore blank lines around generated declarations while preserving existing trivia and compact export groups.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 731b95d5-d943-4b6f-97b7-b923e482069a
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @azure-tools/typespec-ts
Show changes

@azure-tools/typespec-ts - fix ✏️

Restore blank lines between generated TypeScript declarations after batching ts-morph source-file mutations.

@pkg-pr-new

pkg-pr-new Bot commented Aug 5, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/typespec-ts@5162

commit: d04705d

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

You can try these changes here

🛝 Playground 🌐 Website

Keep source-file batching generic and default declaration trivia in addDeclaration without changing imports or exports.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 731b95d5-d943-4b6f-97b7-b923e482069a
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 731b95d5-d943-4b6f-97b7-b923e482069a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:typescript Issues for @azure-tools/typespec-ts emitter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant