You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Angular with prettier configuration confusion #17683
background story
in angular 20 there is a change that components doesn't end with component.html by default
which made this issue
the angular team fixed it by adding prettier to the package.json in this PR
the way prettier work now is that if there is prettier property in the package.json it will ignore the .prettierrc
which can be reproduced here https://github.com/robertIsaac/ng-prettier
now running prettier . -wl will do nothing (while it should change the spaces to 4, and remove all training comma)
while this is documented, it will for sure confuse many people who expect generating a prettierrc file take effect and many plugins docs ask people to add it to the configuration file (including the plugins docs of prettier)and when it doesn't work people won't understand why
there are 3 solutions to this (unless we decide to ignore it)
to merge the configuration between package.json and prettierrc files if they don't conflict
to warn the user if prettierrc file is found while also prettier exist in the package.json (suggested by @jkrems)
that the angular team generate prettierrc file instead of adding prettier to package.json (my suggestion which is discussed in the PR
it's up to prettier and angular team to decide how to proceed, personally all solutions seems valid to me
changed the title [-]Angular feature request: warn user if multiple configurations is observed[/-][+]Angular with prettier configuration confusion[/+]on Jun 26, 2025
First, I want share that we have an open issue about performance issue of config resolution #15653
to merge the configuration between package.json and prettierrc files if they don't conflict
That's not going to happen, it will just make the config difficult to understand.
to warn the user if prettierrc file is found while also prettier exist in the package.json
This is actually a good idea, anyway we already have a performance bottleneck about finding config file mentioned earlier, because we support many formats, and allow it at any level, search for multiple files will make the performance worse. We probably should avoid doing this.
that the angular team generate prettierrc file instead of adding prettier to package.json (my suggestion which is discussed in the PR
package.json and .prettierrc are both config file for Prettier, we treat them with no difference, please pick any format you think the best.
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
Activity
[-]Angular feature request: warn user if multiple configurations is observed[/-][+]Angular with prettier configuration confusion[/+]fisker commentedon Jun 26, 2025
First, I want share that we have an open issue about performance issue of config resolution #15653
That's not going to happen, it will just make the config difficult to understand.
This is actually a good idea, anyway we already have a performance bottleneck about finding config file mentioned earlier, because we support many formats, and allow it at any level, search for multiple files will make the performance worse. We probably should avoid doing this.
package.jsonand.prettierrcare both config file for Prettier, we treat them with no difference, please pick any format you think the best.github-actions commentedon Jul 11, 2025
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
robertIsaac commentedon Jul 11, 2025
what kind of response you want me to give?
fisker commentedon Jul 13, 2025
Close since we are not going to do anything.
robertIsaac commentedon Jul 13, 2025
But you said This is actually a good idea for
fisker commentedon Jul 13, 2025
The idea is good, but it will have a huge impact on performance. I also said