Skip to content

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

Closed
suhasrk wants to merge 2 commits into
angular:mainfrom
suhasrk:patch-1
Closed

Update Prettier defaults to enforce single quotes and 100 character line width#30882
suhasrk wants to merge 2 commits into
angular:mainfrom
suhasrk:patch-1

Conversation

@suhasrk

@suhasrk suhasrk commented Aug 12, 2025

Copy link
Copy Markdown
Contributor

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.

@google-cla

This comment was marked as resolved.

@suhasrk

suhasrk commented Aug 12, 2025

Copy link
Copy Markdown
Contributor Author

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

@hybrist

hybrist commented Aug 12, 2025

Copy link
Copy Markdown
Contributor

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

@hybrist

hybrist commented Aug 12, 2025

Copy link
Copy Markdown
Contributor

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

@hybrist hybrist 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

suhasrk commented Aug 12, 2025

Copy link
Copy Markdown
Contributor Author

@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

suhasrk commented Aug 12, 2025

Copy link
Copy Markdown
Contributor Author

@jkrems Can you please review now?
Thanks.

@hybrist hybrist 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

@hybrist hybrist left a comment

Copy link
Copy Markdown
Contributor

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

suhasrk commented Aug 12, 2025

Copy link
Copy Markdown
Contributor Author

@jkrems
Can you please Squash and merge this PR?

@hybrist

hybrist commented Aug 12, 2025

Copy link
Copy Markdown
Contributor

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.)

@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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