Biome, Toolchain of the Web

Rate this content
Bookmark

Biome wants to provide an all-in-one experience for web developers while maintaining performance and quality. Emanuele, lead maintainer of the Biome project, will walk through Biome’s tools:

- A formatter with 97% compatibility with Prettier of JavaScript, JSX, TypeScript and TSX files.

- A linter that offers informative and descriptive diagnostics, with modern lint rules exclusive to Biome and others inspired by the most famous ESlint plugins.

- An opinionated import sorting. An excellent tool offered by Biome Analyser.

- First-class support for editors that support LSP. What you get from the CLI, you get in your editor.


At the end, Emanuele will discuss the plans for 2024 and what the team would like to achieve this year.

Emanuele Stoppa
Emanuele Stoppa
19 min
04 Apr, 2024

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Biome is a toolchain for web projects that provides formatting and analysis. It offers high-quality diagnostics and is compatible with Prettier. Biome's analyzer includes over 200 unique lint roles and provides informative error messages. Pion, a part of Biome, aims to be fast and efficient, outperforming other tools. Biome is exploring type inference and plug-in support, and has plans to revamp its configuration in version two.

1. Introduction to Biome

Short description:

Today I'm going to talk about Biome, the toolchain of the web. Biome is a toolchain that wants to provide only one experience for your web projects. It offers Formatter and Analyzer, and aims to provide high-quality diagnostics. Biome is Prettier compatible and offers formatting for JavaScript, TypeScript, JSX, and TSX files. It also has the ability to format broken code as an opt-in feature.

Hello everyone. Today I'm going to talk about Biome, the toolchain of the web. Before going forward with the presentations, I will introduce who I am. My name is Emanuele Stoppa. I'm one of the core contributors of the Biome project and core contributor of the Astra project. I live in Ireland, I'm Italian, I like traveling, and I'm a avid console gamer currently playing Final Fantasy VII.

So let's go with Biome. So what's Biome? So Biome is a toolchain that wants to provide only one experience for your web projects. At the moment, Biome offers Formatter and Analyzer, and we're going to check what are those. Plus, as a mission, I must work and offer the same developer experience on the CLI and the LSP, so editors, and it wants to offer high quality diagnostics.

Now what's a modern toolchain? So well, last year I went to the GIA nation and I talked about the former Biome which was Rome and now Biome and Rome wanted to take all these tools that we wanted that you might have in your web projects and offer just one single toolchain and you use just theoretically, you just use that for everything. Although, well, I mean, let's be realistic. That is not possible at the moment. I mean like, sure, that's still the utopoistic mission, but I want to offer a different point of view of the modern toolchain. So as a modern toolchain, we want to actually own the key operations owned by the software. So parsing, diagnostics, formatting, the linter, and code suggestions, assists. So essentially the things that we actually care and around the toolchain. As a modern, we will also be informative, innovative, and want to offer features that you haven't seen before. So it's really interesting. I mean, let's see further what Biome can offer.

So let's talk about the formatter. So Biome formatter is actually Prettier compatible. It means that it formats as Prettier and we all know that Prettier offers a really nice opinionated formatting experience. Biome is 97 percent compatible by formatting JavaScript, TypeScript, JSX, and TSX files. And it also offers the same options that Prettier does, except for a few that we decided to remove because we feel they are old and not necessary anymore. And also something that Biome formatter does that Prettier can't is actually formatting broken code. Yes, exactly. That's what Biome formatter can do. It's an opt-in feature and it actually works. In this video, we have the while statement that is broken and misses a parenthesis.

2. Biome's Analyzer and Unique Roles

Short description:

You can opt in with Biome and have your formatting working out of the box. The analyzer offers linter and import sorting, with over 200 lint roles, some of which are unique to Biome. Biome also offers import sorting and follows rule pillars for informative and useful error messages.

You would use Prettier and you won't be able to do that. You can opt in with Biome and there you go, you have your formatting working just, you know, out of the box. This is one of the features that a modern toolchain such as Biome can provide.

Let's move forward with the analyzer. So the analyzer is quite a metty feature that offers things like linter and import sorting. So as a linter, Biome offers more than two hundred lint roles. Some of them are quite unique to Biome. Many of them are actually taken from ESLint and the most popular ESLint plugins. The analyzer also offers import sorting out of the box and the Biome lint roles are informative and teach you actually something. So let's see what it means.

So among all the other roles, I want to show you some exclusive Biome roles. You can't find in other linters and hopefully the other linters will adopt them. So, for example, use while or another really nice is no cost enum, which is quite quite nice and we'll see what it does. So I mean, it's not just we don't just copy paste what we have, but Biome offers something more than the existing tools have to offer. It offers also an import sorting, so import sorting Biome is just an assist role. It's just a rule different from a lint role, but still a rule that does essentially the import sorting. And we have our Biome has its own logic, which is explained in the documentation. And essentially it's a proof of how powerful is the infrastructure of Biome analyzer. And also it's informative. So internally we have this thing that we call a rule pillars. So when we create the role, we try to adhere to these pillars. And what are those? So a rule might essentially explain as a first rule explain the error to you like, okay, a rule is triggered. You actually want to know why it was triggered. But actually, we want to know the actual error. But then you also want to know why it was triggered. Like you can just say, okay, this is an error. You actually a rule should tell you why. So you know, and you learn from the actual rule. And then as a third pillar, a rule should always explain you what you should do. Okay, you get the error, you know why but now what do I do? So most of the times you get the code fix.

QnA

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Vite: Rethinking Frontend Tooling
JSNation Live 2021JSNation Live 2021
31 min
Vite: Rethinking Frontend Tooling
Top Content
Vite is a new build tool that intends to provide a leaner, faster, and more friction-less workflow for building modern web apps. This talk will dive into the project's background, rationale, technical details and design decisions: what problem does it solve, what makes it fast, and how does it fit into the JS tooling landscape.
React Compiler - Understanding Idiomatic React (React Forget)
React Advanced Conference 2023React Advanced Conference 2023
33 min
React Compiler - Understanding Idiomatic React (React Forget)
Top Content
React provides a contract to developers- uphold certain rules, and React can efficiently and correctly update the UI. In this talk we'll explore these rules in depth, understanding the reasoning behind them and how they unlock new directions such as automatic memoization. 
How Bun Makes Building React Apps Simpler & Faster
React Day Berlin 2022React Day Berlin 2022
9 min
How Bun Makes Building React Apps Simpler & Faster
Bun’s builtin JSX transpiler, hot reloads on the server, JSX prop punning, macro api, automatic package installs, console.log JSX support, 4x faster serverside rendering and more make Bun the best runtime for building React apps
The Inner Workings of Vite Build
DevOps.js Conf 2022DevOps.js Conf 2022
31 min
The Inner Workings of Vite Build
Vite unbundled ESM dev server and fast HMR are game-changing for DX. But Vite also shines when building your production applications.This talk will dive into how the main pieces fit together to bundle and minify your code:Vite build as an opinionated Rollup setup.How esbuild is used as a fast TS and JSX transpile and a minifier.The production plugins pipeline.Modern frameworks (Nuxt, SvelteKit, Astro, among others) have chosen Vite, augmenting the DX and optimizations for their target use case.We'll discover Vite as a polished and extendable toolkit to craft optimized modern apps.

Workshops on related topic

Using CodeMirror to Build a JavaScript Editor with Linting and AutoComplete
React Day Berlin 2022React Day Berlin 2022
86 min
Using CodeMirror to Build a JavaScript Editor with Linting and AutoComplete
Top Content
WorkshopFree
Hussien Khayoon
Kahvi Patel
2 authors
Using a library might seem easy at first glance, but how do you choose the right library? How do you upgrade an existing one? And how do you wade through the documentation to find what you want?
In this workshop, we’ll discuss all these finer points while going through a general example of building a code editor using CodeMirror in React. All while sharing some of the nuances our team learned about using this library and some problems we encountered.