-
Notifications
You must be signed in to change notification settings - Fork 75
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
Update prettier, change print width to 120, and enable dangling commas for functions #371
base: main
Are you sure you want to change the base?
Conversation
At this point, I'd rather not take a huge PR like this into the repo right before the release even if it should not have any real impact on performance in theory. |
Adding v3.1 label to match the label on #370 |
fully agreed, this was definitely meant for after the release. Thanks for adding the label. |
ec73337
to
231c0d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loooking good. I guess we can redo the formatting now that we've released?
yeah, I was waiting to see if there was some interest before doing more work :-) |
I'd definitely prefer some width-limit, especially for the html files. |
231c0d7
to
c6b86de
Compare
@@ -1,4 +1,4 @@ | |||
<!DOCTYPE html> | |||
<!doctype html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's up with these DOCTYPE change? These don't seem desirable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comes from the prettier update to v3 (see https://prettier.io/blog/2023/07/05/3.0.0.html#html). There's also no option to disable this behavior.
The doctype is case insensitive so IMO it's not important. I'm glad somebody else has an opinion about it so that I don't need to have one.
@@ -1,12 +1,4 @@ | |||
{ | |||
"arrowParens": "always", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we making all these other changes to prettier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can find out more if you look at the individual commits, as there's one commit for each logical change.
In short a lot of them are the defaults (see 3rd commit), except printWidth
and trailingComma
which are the changes by this PR.
Changing trailingComma
is beneficial because it makes better diffs: with the old style, there's no trailing comma, and therefore when function parameters or array properties or object properties are added or removed, the previous line also shows up in a diff. If it has a trailing comma, then it isn't changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not removing the default ones would make this PR easier to review/less scary
ping @rniwa |
@@ -1,12 +1,4 @@ | |||
{ | |||
"arrowParens": "always", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not removing the default ones would make this PR easier to review/less scary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine.
Fixes #370
I didn't regenerate all workloads (yet). Please do not land this just yet, this PR is here so that we can decide about #370.
I made separate commits so that we can easily see the effect of each action: