Skip to content

chore: replace eslint with biome #14263

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

Merged
merged 26 commits into from
Aug 15, 2024
Merged

chore: replace eslint with biome #14263

merged 26 commits into from
Aug 15, 2024

Conversation

aslilac
Copy link
Member

@aslilac aslilac commented Aug 13, 2024

Goodbye ESLint, and all the config and dependencies and waiting that came with it.

Instead, we can use Biome! Has all the lint rules that I think are "important" and is sooooo much faster.

@matifali
Copy link
Member

To avoid the large diff can we keep the tab width to 2 spaces?

@aslilac
Copy link
Member Author

aslilac commented Aug 14, 2024

I actually feel pretty strongly that we should take this opportunity to just go all in on the defaults of our code formatter. Every setting we change is a bit self defeating, when the purpose of the tool is to eliminate code style discussions.

I'd be ok with doing the tab transition in a separate PR to make this one more reviewable, but I think the plan should be to stick strongly with the defaults. As a bonus, we use tabs in our Go code because go fmt doesn't even have an option to use anything else, and this would be a nice bit of consistency to gain.

Copy link

alwaysmeticulous bot commented Aug 14, 2024

✅ Meticulous spotted zero visual differences across 1412 screens tested: view results.

Meticulous tested 526/900 of the executable lines edited in this PR1.

1. These lines will likely automatically gain test coverage over the coming days, however if you wish to increase coverage immediately you can do so by interacting with your feature on localhost.

Expected differences? Click here. Last updated for commit 075c3be. This comment will update as new commits are pushed.

Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

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

I smoke-tested this and didn't find any UI issues (but this was not an exhaustive test).

However, I did find a significant speedup from 54s for eslint+prettier to 10s for biome.

I'm holding back approval for the FE folks, but I like the overall idea of not needing to think about formatting. I'm also a fan of the 'auto-fix' decisions that Biome makes.

@@ -401,22 +401,18 @@ fmt/go:
go run mvdan.cc/gofumpt@v0.4.0 -w -l .
.PHONY: fmt/go

Copy link
Member

@matifali matifali Aug 15, 2024

Choose a reason for hiding this comment

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

I used to do fmt/prettier when formatting markdown files.
Can you extract a fmt/docs or fmt/md to make docs formatting easier?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, we still need prettier for basically everything it was doing before outside of site/, so I'll just put that job back.

Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

If the tests pass, I'm fine with these changes. I have a few questions, but I trust your judgment on when to merge them.

Questions:

  • Do we need to make any changes on the Coder template side?
  • Is there a VSCode plugin we should use, similar to what we did with Prettier? If so, it would be helpful to describe how this will affect our existing workflow and post a note about it in #dev.

@matifali
Copy link
Member

matifali commented Aug 15, 2024

@aslilac We can add biomejs.biome to .vscode/extensions.json and configure some biome related settings in .vscode/settings.json. There are also eslint settings there that should be cleaned up.

@code-asher
Copy link
Member

You can ignore whitespace changes in diffs (in GitHub too) so no harm to reviewability if we want to change the indentation now imo

@aslilac aslilac merged commit d15f16f into main Aug 15, 2024
32 checks passed
@aslilac aslilac deleted the biome branch August 15, 2024 19:26
@github-actions github-actions bot locked and limited conversation to collaborators Aug 15, 2024
@aslilac
Copy link
Member Author

aslilac commented Aug 15, 2024

You can ignore whitespace changes in diffs (in GitHub too) so no harm to reviewability if we want to change the indentation now imo

This PR was just already massive. 😅

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

Successfully merging this pull request may close these issues.

5 participants