DEV Community

Cover image for Biome.js : Prettier+ESLint killer ?
Thibault Walterspieler
Thibault Walterspieler

Posted on • Originally published at walterspieler.dev

Biome.js : Prettier+ESLint killer ?

Prettier/ESLint

If you're a developer, you're surely familiar with Prettier and ESLint. With over 8 years of existence, they have established themselves as references in the JavaScript ecosystem.

Prettier, as a code formatter, has not only made coding easier by enforcing stylistic uniformity, but has also put an end to countless debates over coding standards within teams.

Tab vs space indent ⚔️

By automating and standardizing code formatting, Prettier allows one to focus on logic and features rather than the aesthetics of the code.

On the other hand, ESLint is a powerful JS linting tool. Designed to identify and report syntax errors, style issues, and bad practices in the code, it thus helps to maintain quality standards and consistency within projects.

Prettier bounty 🏆

Recently, Christopher Chedeau (Vjeux), the creator of Prettier and co-creator of React Native, promised a $10,000 bonus for any Rust project that passes more than 95% of the JS Prettier test suite.

Prettier bounty

Why this competition? In practice, Prettier has been the dominant code formatter for JavaScript and, due to a lack of competition, there has been little incentive to push its performance and improve the tool.

In reality, for many developers in recent years, Prettier has been the default JS code formatter. This overwhelming market dominance resulted in a lack of competition, leading in turn to a loss of interest among maintainers in improving the tool's performance.

By funding and then highlighting a competitor written in Rust, capable of passing the majority of its JS test suite, Prettier thus recreated this healthy competition that will potentially allow it to challenge the details of its current implementation.

Interested in the initiative as well as the outcome of this bounty hunt, many tech players like Guillermo Rauch, CEO of Vercel, have increased the reward to a total of $22,500.

Vjeux tweet

From this competition, one project emerged victorious: Biome.js 🎉

Biome.js, one tool to rule them all

Biome is a fork of Rome, which was originally an ambitious tool written in Rust but abandoned in October 2023. It includes both a linter and a formatter, putting an end to the time-consuming difficulties associated with reconciling ESLint and Prettier rules.

Biome.js landing page

On paper, Biome.js offers several advantages:

  • Better performance: according to their benchmarks, it boasts a formatting speed that surpasses Prettier by 25 times and dethrones ESLint by 15 times on a MacBook Pro M1.
  • Simplified installation: only one dependency to install, replacing ESLint, Prettier, and several plugins necessary for their proper functioning.
  • A single configuration file for both formatting and linting.
  • Native TypeScript support.

Should we migrate now ?

If this tool is so powerful, why hasn't it been universally adopted yet? After several weeks of use, I've identified some edge cases that might hinder its adoption:

irony of fate

To conclude my opinion, I believe it's preferable to continue using ESLint + Prettier for now because their wider support and massive adoption by the industry give them a lead that's still too significant.

However, Biome.js is a very promising project that should be kept an eye on, as its evolution could potentially lead it to replace these two pillars of the JS ecosystem that are Prettier and ESLint one day. 🧐

How to use it ?

For those curious to still try out this tool, simply run this command in your project:

npx @biomejs/biome init

It will install all the necessary dependencies in your project and create a biome.jsonc file, which, similar to a .prettierrc or .eslintrc, will allow you to configure your project.

If you want to fully take advantage of Biome.js in VSCode, you can install the Biome extension. And if you're using a different IDE, take a look at the documentation.

Thanks to Alex Mongeot for helping me write this article. ❤️

🔗 My original article

Top comments (2)

Collapse
 
zirkelc profile image
Chris Cook

I use Biome for smaller projects and I like it very much. I’m planning to move off ESLint completely because the performance is terrible.

I know it’s kind a religious thing, but for me linting and formatting belong together.

Collapse
 
jangelodev profile image
João Angelo

Hi Thibault Walterspieler,
Your tips are very useful.
Thanks for sharing.