Skip to content

Update Prettier defaults to enforce single quotes and 100 character line width #30882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

suhasrk
Copy link
Contributor

@suhasrk suhasrk commented Aug 12, 2025

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?

Currently, the prettier block in package.json does not fully align with Angular’s recommended defaults as defined in .editorconfig.
This can lead to inconsistent formatting across projects, as common preferences like "singleQuote": true and "printWidth": 100 are not enforced in Prettier, even though .editorconfig specifies similar rules.

Issue Number: #30744

What is the new behavior?

The prettier block in package.json has been updated to include Angular’s recommended defaults (singleQuote: true, printWidth: 100), ensuring consistency between .editorconfig and Prettier formatting across all projects.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

This change avoids manual intervention in minimal projects while preserving the intended HTML formatting benefits for standard projects.

This comment was marked as resolved.

@suhasrk
Copy link
Contributor Author

suhasrk commented Aug 12, 2025

Hi maintainers, this PR is ready for review. Could you please assign reviewers?
@comewalk @abraham @zed-0xff @jesperronn

@jkrems
Copy link
Contributor

jkrems commented Aug 12, 2025

@suhasrk Can you reword the commit message to follow the commit message format? This is necessary for automatic changelog generation and semver tracking purposes.

@jkrems
Copy link
Contributor

jkrems commented Aug 12, 2025

You can see an example commit messasge in the previous change to the file: 4221a33

@jkrems jkrems added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews target: patch This PR is targeted for the next patch release labels Aug 12, 2025
@suhasrk
Copy link
Contributor Author

suhasrk commented Aug 12, 2025

@suhasrk Can you reword the commit message to follow the commit message format? This is necessary for automatic changelog generation and semver tracking purposes.

Sure. I will do and notify here once checks are passed

@suhasrk
Copy link
Contributor Author

suhasrk commented Aug 12, 2025

@jkrems Can you please review now?
Thanks.

@jkrems jkrems added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Aug 12, 2025
Copy link
Contributor

@jkrems jkrems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this happen! 🎉

@suhasrk
Copy link
Contributor Author

suhasrk commented Aug 12, 2025

@jkrems
Can you please Squash and merge this PR?

@jkrems
Copy link
Contributor

jkrems commented Aug 12, 2025

Created a squash & rebase here: #30884

(We use automated tooling that assumes the commits can land as-is and I don't have access to modify branches from PRs.)

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: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prettier config in package.json overrides singleQuote for .ts files in --minimal projects
3 participants