Skip to content

Conversation

danymarques
Copy link

Applies consistent formatting to Angular schematic template files to prevent changes when Prettier is executed on freshly generated files. The templates now respect the formatting configuration defined in package.json.

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

When we format a file using Prettier on a freshly generated project, it reads the configuration in the package.json and formats the file. It would be nice if the templates were already formatted correctly to avoid unnecessary git changes.

Issue Number: N/A

Templates are formatted following the configuration set in package.json

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

…figuration

Applies consistent formatting to Angular schematic template files to prevent
changes when Prettier is executed on freshly generated files. The templates
now respect the formatting configuration defined in package.json.
@jkrems
Copy link
Contributor

jkrems commented Aug 18, 2025

Thanks, I think this is a good idea overall! But in its current form, it does seem to break some of the additional variants that can be created (https://github.com/angular/angular-cli/actions/runs/16963647619/job/48160598107?pr=30916). I'm a bit concerned that this approach might not be fully generalizable because the correct formatting can change based on the exact options provided, e.g. optional imports or provider array elements.

That said, I'd be happy to merge this kind of formatting-only change assuming that the build passes.

@jkrems jkrems added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Aug 18, 2025
@alan-agius4
Copy link
Collaborator

Closing as the feedback has not been addressed. Please feel free to re-open.

@alan-agius4 alan-agius4 closed this Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews area: @schematics/angular

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants