Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Oct 22, 2025

The TypeScript printer, by design, does not retain blank lines. This caused the jasmine-to-vitest refactoring schematic to produce code that lost the original file's vertical spacing, harming readability.

This commit introduces a pre- and post-processing step within the main transformation function. Before parsing, blank lines are converted into unique placeholder comments. After the TypeScript printer generates the new code, these placeholders are converted back into blank lines, ensuring that the vertical formatting of the original file is preserved in the transformed output.

…chematic

The TypeScript printer, by design, does not retain blank lines. This caused the jasmine-to-vitest refactoring schematic to produce code that lost the original file's vertical spacing, harming readability.

This commit introduces a pre- and post-processing step within the main transformation function. Before parsing, blank lines are converted into unique placeholder comments. After the TypeScript printer generates the new code, these placeholders are converted back into blank lines, ensuring that the vertical formatting of the original file is preserved in the transformed output.
@clydin clydin added the target: major This PR is targeted for the next major release label Oct 22, 2025
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 22, 2025
@clydin clydin added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 22, 2025
@clydin clydin merged commit 512ad28 into angular:main Oct 22, 2025
35 checks passed
@clydin clydin deleted the refactor/blank-line-vitest branch October 22, 2025 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @schematics/angular target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants