Can’t stand eslint/prettier. Let’s switch to Biome
The developer experience with eslint and prettier is unpleasant. Here’s why.
Overlapping Roles
The roles of eslint and prettier overlap. That’s why people use eslint-config-prettier and eslint-plugin-prettier. These two libraries overwrite eslint’s settings with prettier’s settings.
But it is recommended not to use eslint-plugin-prettier. Something about not needing to use eslint? So what happens if you remove eslint-plugin-prettier? The IDE and prettier go their separate ways. This is especially true in IntelliJ-family IDEs (WebStorm).
To get straight to the point, WebStorm doesn’t properly support prettier. WebStorm has a feature that automatically runs eslint and prettier to fix files when you save after editing. It’s convenient since indentation and import sorting happen automatically, and above all, it prevents git log chaos caused by things like whitespace changes during collaboration. But this is only true in theory. As you tweak the eslint and prettier settings, WebStorm gets confused about whether to follow prettier’s settings or eslint’s settings. Watching the pathetic state where import sorting won’t work no matter what you do makes the anger boil up inside you. This doesn’t seem to happen in Visual Studio Code, but… the IntelliJ-family IDEs have been abandoned.
Biome
Since the eslint/prettier combo doesn’t work properly and is inconvenient, the alternative is Biome. Biome does everything that eslint and prettier do. And the WebStorm integration plugin works well too. The formatter works fine on file save, and lint is displayed well too!
Migration
Migrating from eslint/prettier to Biome is simple.
npx @biomejs/biome migrate
That said, since most of the rules are compatible with eslint/prettier, I didn’t use the above feature and migrating by hand was enough.
Pros
- It supports WebStorm well. Lint and the formatter work well!
- It supports typescript, jsx, and tsx out of the box. No further explanation needed.
- It supports React well.
- The configuration is simple. There’s no need to install
eslint + prettier + @type. - The CLI works correctly.
- It supports bun well. Node.js is not required.
Cons
- Unstable WebStorm support. The v1.0 plugin is currently a nightly version. But it works well.
- Lack of references. Searching doesn’t turn up much.
- You never know when the project might die.
- Support for css, html, vue, and markdown is planned for the future.
Lies(?)
- They promote it as being incredibly fast because it’s built in rust… but I didn’t really feel it on an M1 Pro MacBook. eslint and prettier are pretty fast too…
TMI
Biome is the successor to Rome, which aspired to be a unified build tool but failed. Will it manage to survive without dying?
20240220
Leave a comment