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

feat: add biome as formatter #45

Merged
merged 1 commit into from
Aug 8, 2024
Merged

Conversation

dragove
Copy link
Contributor

@dragove dragove commented Aug 7, 2024

add biome to format json and javascript things.

biome is a replacement for prettier with better performance.

I'm not using npx to run command since npx noticeably slow down the startup of biome.

biome refuse to format file with extension javascript, thus I'm using js instead of javascript in the test.

Estimated time consumption for different commands:

time npx prettier --stdin-filepath demo.json
Executed in 457.11 millis fish external
usr time 432.23 millis 0.00 micros 432.23 millis
sys time 199.27 millis 703.00 micros 198.57 millis

time npx @biomejs/biome format --write demo.json
Executed in 1.15 secs fish external
usr time 635.26 millis 0.40 millis 634.87 millis
sys time 340.36 millis 1.12 millis 339.24 millis

time prettier --stdin-filepath demo.json
Executed in 145.69 millis fish external
usr time 120.74 millis 363.00 micros 120.38 millis
sys time 89.82 millis 113.00 micros 89.71 millis

time biome format --write demo.json
Executed in 57.95 millis fish external
usr time 30.06 millis 415.00 micros 29.64 millis
sys time 48.54 millis 763.00 micros 47.78 millis

@xiaoshihou514
Copy link
Collaborator

lgtm!

@xiaoshihou514 xiaoshihou514 merged commit fe25ff0 into nvimdev:main Aug 8, 2024
1 of 2 checks passed
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.

2 participants