Skip to content
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

use biome instead of prettier #561

Closed
wants to merge 12 commits into from
Closed

Conversation

gulfaraz
Copy link
Contributor

@gulfaraz gulfaraz commented Jan 7, 2024

resolves #492

search for biome-ignore to address migration issues

Copy link

vercel bot commented Jan 7, 2024

@gulfaraz is attempting to deploy a commit to the OpenStatus Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Jan 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
openstatus-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2024 3:56pm

Copy link
Member

@mxkaske mxkaske left a comment

Choose a reason for hiding this comment

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

Cool! Didn't know about all the biome recommendations but I really like comes with zero config and is biased.

Comment on lines +15 to 16
{/* biome-ignore lint/a11y/useButtonType: */}
<button onClick={() => setTheme("light")}>
Copy link
Member

Choose a reason for hiding this comment

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

Interesting - wasn't expecting that you should always specify the button type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Neither did I. This PR was a nice revisit to the basics.

@gulfaraz
Copy link
Contributor Author

gulfaraz commented Jan 7, 2024

Cool! Didn't know about all the biome recommendations but I really like comes with zero config and is biased.

I did make some config choices as specified in biome.json

This makes biome ignore the shadcn files so it's easy to update them.

openstatus/biome.json

Lines 3 to 8 in b4f722e

"files": {
"ignore": [
"packages/ui/src/components/*.tsx",
"packages/ui/src/components/*.ts"
]
},

This is equivalent to prettier-plugin-sort-imports. It is disabled but you can choose to enable it. Change false to true and run npm run format.

openstatus/biome.json

Lines 9 to 11 in b4f722e

"organizeImports": {
"enabled": false
},

This was tab by default but changed it to space.

openstatus/biome.json

Lines 18 to 20 in b4f722e

"formatter": {
"indentStyle": "space"
},

This makes biome ignore all .json files. There were minor auto-fixable format changes. I disabled it coz prettier was ignoring json files via **/*.{ts,tsx,md}.

openstatus/biome.json

Lines 21 to 25 in b4f722e

"json": {
"formatter": {
"enabled": false
}
}

You can also disable any rule if you prefer.

@gulfaraz gulfaraz requested a review from mxkaske January 7, 2024 21:31
@thibaultleouay
Copy link
Member

@gulfaraz
That's cool my only concern is the tailwind class sort which does not work at the moment with Biome

@gulfaraz
Copy link
Contributor Author

@thibaultleouay

Biome doesn't have tailwind sorting yet, but it is in discussion. So you have a decision to make,

  1. We can merge and continue using biome without tailwind sort. When sorting is released, update biome and npm run format to fix the unsorted classes.
  2. We close this PR until sorting is released.

@thibaultleouay
Copy link
Member

@gulfaraz

I would love to use Biomejs,
Can we keep it for code? And just have prettier at the same time but only for class sorting? Which will be removed when biomejs implements it?

What's your thought on it?

@gulfaraz
Copy link
Contributor Author

And just have prettier at the same time but only for class sorting?

That is not possible.

@thibaultleouay
Copy link
Member

@gulfaraz
if you don't mind waiting for couple of days until this is released
biomejs/biome#1274

@gulfaraz
Copy link
Contributor Author

No problem.

@thibaultleouay
Copy link
Member

I think they added some support to class sorting
biomejs/biome#164

Let's integrate biomejs 🔥

@gulfaraz
Copy link
Contributor Author

gulfaraz commented Feb 9, 2024

The related PR biomejs/biome#1362 (2 weeks ago) is not in their latest release (3 weeks ago) yet.

@gulfaraz
Copy link
Contributor Author

closed in favour of #728

@gulfaraz gulfaraz closed this Mar 25, 2024
@gulfaraz gulfaraz deleted the feat.biome branch March 25, 2024 13:59
@thibaultleouay
Copy link
Member

@gulfaraz Would love if you double check the other PR, it seems like a mess to me 😭

@gulfaraz gulfaraz restored the feat.biome branch March 27, 2024 09:38
@gulfaraz gulfaraz deleted the feat.biome branch March 27, 2024 14:02
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.

Use BiomeJS instead of prettier
3 participants