Skip to content

Conversation

camillobruni
Copy link
Contributor

This PR copies over the prettier config from Speedometer.

Note that I didn't implement the dual prettier + eslint approach, I always found that annoying (we need to duplicate the ignore files) and slow.

In Speedometer this was introduced to more closely adhere to WebKit's style guide which I always found a bit problematic. I personally introduced a few bugs due to the no-braces for single block statements, so I'd be more than happy to loosen this requirement and go with the prettier defaults for sake of simplicity.

  • Single block statements are on the same line
  • Braces are required to force a new line for block statements

Beyond that I presonally don't care too much about code formatting, if there is an easy way to get closer to WebKit I'm fine.

Copy link

netlify bot commented Sep 3, 2025

Deploy Preview for webkit-jetstream-preview ready!

Name Link
🔨 Latest commit 39875b4
🔍 Latest deploy log https://app.netlify.com/projects/webkit-jetstream-preview/deploys/68b81085720bb100085d9a9c
😎 Deploy Preview https://deploy-preview-176--webkit-jetstream-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@danleh danleh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally LGTM with some nits and these high-level questions:

I didn't implement the dual prettier + eslint approach

Since I'm not familiar with how it's done for Speedometer: Does this mean first running prettier and then (only a subset of) eslint? Keeping it simpler sounds good to me.

I personally introduced a few bugs due to the no-braces for single block statements, so I'd be more than happy to loosen this requirement and go with the prettier defaults for sake of simplicity.

  • Single block statements are on the same line
  • Braces are required to force a new line for block statements

Strong +1, I also dislike no-braces for single block statements, especially in the combination with blocks with braces, e.g.,

if (cond)
  stmt1;
else {
  stmt2;
  stmt3;
}

Question 1: Do we plan on having a "big formatting" CL at some point? Or iteratively (per-file or even more fine grained)?

Question 2: Do we plan on having a pre-commit hook in the future? If yes, will it always format everything? (Which would be fine if everything is already in a formatted state, otherwise not so much.)

@camillobruni
Copy link
Contributor Author

Q1: yes, I'd plan to make a big format PR and then – but not touching the old workloads which have code inlined in benchmark.js

Q2: We can try this (for speedometer we only added a CQ check, because this was too slow so we didn't do it), I'd probably be in favour of having having a direct push / commit hook

@camillobruni
Copy link
Contributor Author

@kmiller68 how strongly do you feel about the braces? I find them rather error prone – I only know WebKit who does that personally so very little day-to-day exposure on this.

@kmiller68
Copy link
Contributor

I don't mind braces (were I writing a project from scratch I'd probably expect them). I think JetStream tends to follow WebKit style overall but I personally don't care too much. I'll probably mess up a lot and elide the braces so as long as something complains when I upload the PR I'm fine with whatever.

Let me check if other folks internally care.

@camillobruni
Copy link
Contributor Author

Not feeling strongly about this either, but I'd definitely add an auto-formatter for the harness code so we wouldn't have to really deal with this manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants