-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 formatter config #11640
update formatter config #11640
Conversation
|
a56b2e7
to
de0b00d
Compare
I'll admit that I, very subjectively of course, don't like the 80 line lengths. I use a condensed font and so it kinda result in 70% of my screen just being empty now Going through the changes and testing 80 in the language-tools, I also (subjectively) feel like some code now takes a bigger cognitive effort to parse due to being (somewhat unnecessarily) spread over multiple lines I could probably be convinced, just not feeling it on first look Everything else is fine, don't care |
Big fan of making refactoring code easier, where reordering items in an array/object/function definition leads to fewer syntax errors around missing commas where the entire file breaks. If this reduces paper-cut friction for devs on the project than I'm +1. I don't see this stated in the link. The link only states that prettier will choose the option that will result in the fewest escapes for that specific string, but will blindly defaulting to whatever
Torn on this one. I personally always code with 100 columns visible and prefer the extra space, having used both |
For context: we were discussing these changes originally in another Astro repo, but I set the hard hard rule that all Astro repos should use the same formatter config, copy-pasting from the Thanks for taking the time to kick this off in the main repo, Darius! |
|
|
|
I'm neutral on trailingComma because I think there are decent arguments in favour of it that balance my strong bias against any changes to the config. I'm against the other two because there are arguments both for and against, and we should only be changing these if there's a strong reason for doing it. |
de0b00d
to
4569ed3
Compare
Looks like we're not strongly against trailingComma - kept. I'll elaborate more on double quotes: anecdotally, I frequently find myself needing to change from single to double quotes due to adding an apostrophe. I'll admit I misinterpreted what Prettier was saying there 😅 thinking that it was basically saying this. Still, reverted quotes too. I'll bet that's a me thing (even though I already count several apostrophes in this comment alone 😂). In response to some less-than-appreciated dismissive comments here and elsewhere, I'll reiterate that my motivations here are not subjective. They're mechanical, in the name of reducing friction.
This is all small stuff, but it adds up. Microfriction is real, and I believe it affects all devs to some extent, whether they know it or not.
|
I'm sorry if my comments came across as dismissive. I'm not suggesting that your suggestions are arbitrary. The point I was trying to make is that even when there are objective arguments for the different options, few are as cut and dried as to avoid having arguments on both sides. My main objection is that these sort of things generate disagreements that are way out proportion to the actual impact of a change, which is why I am so biased against changing any option that's already in use. |
I agree, and no worries. I only initially included the And, not specifically to you, but generally, I want to make clear that my motivation for |
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.
It's crazy that we're in 2024 and opening the "files" tab on this PR crashed my browser twice, what are we doing with our life really, is the web really the best platform to build on?
I'll take care of adding this to other repos, thank you for kicking the discussion! Apologies if any comments came as dismissive and/or rude. |
Changes
Makes the following formatter changes:
trailingComma: "all"
Rationale:
all
in prettier v3Reverted changes
printWidth: 80
Rationale:
singleQuote: false
Rationale:
Testing
Tests passed after running format. I got a local test failure at
packages\markdown\remark\test\shiki.test.js
, but it doesn't seem related.Docs
No docs needed, internal change.