-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
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