-
Notifications
You must be signed in to change notification settings - Fork 0
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
Replace eslint/prettier with biome #10
Conversation
with pnpm exec biome lint --max-diagnostics=30 --reporter github --write .
with pnpm exec biome check --max-diagnostics=30 --reporter github --write .
with pnpm exec biome lint --max-diagnostics=30 --reporter github --write --unsafe .
The fix is by default unsafe, but the changes it made looked fine so I marked the fix as safe
.vscode/settings.json
Outdated
"editor.codeActionsOnSave":{ | ||
"source.organizeImports.biome": "explicit" |
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 took the liberty of adding an auto-sort imports on save. I think this is handy, but feel free to disagree :-)
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.
BTW I noticed that biome respects grouped imports, i.e. there is no sorting off import statements separated by empty lines
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.
Also imports from the same module that are on different lines are not sorted or combined. But once you combine them on one line, they will be sorted alphabetically 🤔
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.
cool thanks, the organize sort is not part of lint or format commands so its nice the editor can do it.
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.
Good to have some decent autoformatting! Also great to get rid of these shared configuration packages.
"turbo": "^2.0.6" | ||
}, | ||
"packageManager": "[email protected]", | ||
"name": "with-vite" | ||
"name": "class-web" |
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.
Good catch!
"test": "jest", | ||
"test:watch": "jext --watch" | ||
"test:watch": "jext --watch", |
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.
"test:watch": "jext --watch", | |
"test:watch": "jest --watch", |
but will be changed in #11
turbo.json
Outdated
"//#format-and-lint": {}, | ||
"//#format-and-lint:fix": { |
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 with this weird syntax //#
? I see it in https://turbo.build/repo/docs/guides/tools/biome#create-a-root-task but I'm not sure why it is like that.
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 so that pnpm exec turbo format-and-lint
works, but on my machine
- 2.7s for pnpm exec turbo format-and-lint (cached)
- 0.3s for time pnpm format-and-lint
So I will remove it as running biome directly is preferred.
I did notice that the |
This reverts commit 640dcde.
I switched away from biome action. See https://github.com/classmodel/class-web/actions/runs/10214528625 for example error report |
Running biome directly is much quicker (2.7s vs 0.3s)
Followed instructions at https://turbo.build/repo/docs/guides/tools/biome
Also
packages/config-typescript/
in favor complete tsconfig.json next to each package.json.TODO