-
Notifications
You must be signed in to change notification settings - Fork 346
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
Add TS/JS/JSON formatting to the project #2543
Conversation
d347b12
to
5c3ff67
Compare
I didn't feel like doing it so who am I to throw it on you but if you feel like adding bazel take a look at https://github.com/bazelbuild/buildtools/blob/main/buildifier/README.md |
Do we want to use prettier for markdown as well? |
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.
I think this is extremely hard to review and land without making sure we don't break anything. What we should do is, to enable prettier new rules on a specific folder, and divide the large chunk to smaller chunks while opening specific pull-requests according to that.
Also, I think we should use a specific prettier config that reduces the changes, and later iterate on finding the "sweet" formatting config that fits to our needs.
npm/lib/node-install.ts
Outdated
@@ -9,23 +9,23 @@ | |||
import { | |||
downloadedBinPath, | |||
pkgAndSubpathForCurrentPlatform, | |||
} from "./node-platform"; | |||
} from './node-platform'; |
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.
These files have already been formatted with prettier, mostly—it seems like this change is just to change the '
to "
?
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.
In this discussion, several colleagues said they preferred single quotes, so I decided to apply it throughout the project.
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.
Fair enough—as long as we're consistent. Worth noting that we use "
in workers-sdk
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.
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.
Obvs not a big deal but I prefer double quotes since JSON requires them, and being consistent with workers-sdk would be a nice benefit
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.
Quote fight!
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.
I'm on team single quotes, but it's not a big deal for me either.
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.
We can use different configuration on different folders. We just need to add .prettierrc
to the folder where we want to have double quotes.
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.
I would prefer to have a unified style in all of workerd, but I'm not opposed to per-folder if there is a strong reason
c59be19
to
20a4606
Compare
20a4606
to
2b0b22f
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.
I only looked at the pyodide
folder but it looked nice, thanks!
2b0b22f
to
c08dd6c
Compare
cbb920b
to
93d2934
Compare
93d2934
to
a666f32
Compare
a666f32
to
d5b2e51
Compare
This PR extends @danlapid's work in #2505 to format JS/TS/JSON code too.