跳转到内容

Comparison with other tools

此内容尚不支持你的语言。

Biome can replace both your formatter and your linter. See how it compares with Prettier, ESLint, and Oxc in compatibility, performance, and language support.

Prettier is the most widely used formatter for the web, and Biome’s formatter is built to work as a drop-in replacement for it.

Biome’s formatter matches Prettier’s output in 97% of cases. It won the Prettier challenge, launched by Christopher Chedeau, one of Prettier’s creators.

Some output differences exist, and they are intentional. You can find them in Formatting differences below.

Biome’s default options also differ from Prettier’s. For example, Biome indents with tabs while Prettier uses spaces.

According to the official benchmark, Biome formats about 25 times faster than Prettier.

The performance difference is especially noticeable where formatting speed gets in your way: formatting on save, pre-commit hooks, and CI jobs that check the whole repository.

Prettier and Biome support a different set of languages out of the box. Prettier has more stable support for HTML and for HTML super languages such as Vue and Angular, and it has a large ecosystem of community plugins.

See Prettier’s documentation and Biome’s language support page for details.

In a few cases, Biome intentionally formats code differently from Prettier, usually to be more consistent. You are unlikely to run into most of them, but they explain why a migration might change a handful of lines.

Both formatters remove quotes from property names that are valid identifiers. Prettier only does so for identifiers that were valid in ES5, while Biome does so for any identifier that is valid today:

example.js
const obj = {
a: true,
b: true,
"𐊧": true, // Prettier
𐊧: true, // Biome
};

Prettier wraps an assignment in a computed key with parentheses in object literals, but not in classes. Biome never adds them, in both cases:

example.js
a = {
[(x = 0)]: 1, // Prettier
[x = 0]: 1, // Biome
};
class C {
[x = 0] = 1;
}

Trailing commas in arrow function type parameters

Section titled “Trailing commas in arrow function type parameters”

In .tsx files, a type parameter list sometimes needs a trailing comma so that it is not mistaken for a JSX element. Prettier adds the comma even when a default type already makes the code unambiguous. Biome only adds it when it is needed:

example.tsx
<T = unknown,>() => {}; // Prettier
<T = unknown>() => {}; // Biome

In TypeScript, (a?.b)!, (a?.b!), and a?.b! all mean the same thing. Prettier keeps the parentheses, and moves the ! outside of them. Biome removes the parentheses so that all three are written the same way:

example.ts
(a?.b)! // Prettier
a?.b! // Biome

Biome’s parser is stricter than Prettier’s. It reports errors that Prettier accepts, such as duplicate class modifiers, a return outside of a function, or an assignment to an optional chain.

When a piece of code contains such an error, Biome leaves it exactly as you wrote it instead of formatting it, because formatting invalid code could change what it means. Prettier formats it as if it were valid, and can silently drop part of it:

example.ts
class Foo {
private a = 1; // Prettier
private public a = 1; // Biome
}
a?.b = c; // Prettier
(a?.b) = c; // Biome

Once you fix the error, Biome formats the code normally.

ESLint is the standard linter for JavaScript, with a decade of rules and plugins behind it. Biome’s linter takes a lot from it, but is not built to be a drop-in replacement.

Biome ships 880 rules, most of them ported from ESLint and its popular plugins, such as eslint-plugin-react, eslint-plugin-jsx-a11y, eslint-plugin-import, and eslint-plugin-unicorn. You can find the origin of each Biome rule in the rule sources.

The Biome team curates every lint rule, and each one follows the rule pillars. As a result, some rules have different names from their ESLint counterparts, support fewer options, or behave slightly differently, in favor of a more consistent experience across languages.

Rule names use camelCase rather than ESLint’s kebab-case, and Biome often chooses a different name to make a rule’s intent clearer. For example, ESLint’s eqeqeq is Biome’s noDoubleEquals.

According to the official benchmark, Biome lints about 15 times faster than ESLint.

The performance difference is especially noticeable where linting speed gets in your way: diagnostics that keep up with you as you type, and CI jobs that lint the whole repository.

In a typical ESLint setup, you wire together a parser, the TypeScript plugin, framework and library plugins, and eslint-config-prettier for Prettier compatibility.

Biome only needs @biomejs/biome and, optionally, a biome.json configuration file for finer control.

ESLint has an ecosystem of JavaScript plugins that Biome cannot run. Instead, you write Biome plugins in GritQL, a pattern language that matches code and reports a diagnostic, or in JavaScript with Biome’s own plugin API.

ESLint needs typescript-eslint and the TypeScript compiler for type-aware linting. Biome comes with its own set of type-aware rules that do not depend on the typescript package.

Type-aware rules were added to Biome in the v2 release. The rule count is considerably smaller than typescript-eslint’s, but coverage is growing.

Oxc is a collection of JavaScript tools written in Rust: a parser, a linter (oxlint), a formatter (oxfmt), a transformer, and a minifier. It was inspired by Rome, the same project Biome forked from, so both share the goal of fast, native tooling for the web.

Oxc takes a different approach from Biome: each of its tools is a drop-in replacement for an existing one, with its own configuration file.

Oxlint uses the same rule names and options as ESLint, and its alpha plugin API is compatible with ESLint’s, so most existing ESLint plugins work out of the box. Oxfmt matches Prettier’s output and passes Prettier’s JavaScript and TypeScript conformance tests.

Biome’s tools all come in the same package and share the same configuration file. Its formatter is Prettier-compatible and its linter ports most ESLint rules, but Biome is more opinionated: it changes some rules and formatting options in favor of a more integrated experience across the toolchain.

Both projects are fast. In Oxc’s official benchmark, Oxc’s parser is 5 times faster than Biome’s and Oxfmt is 3 times faster than Biome’s formatter. Both projects are many times faster than Prettier and ESLint.

Part of the difference comes from a design choice. Biome’s parser produces a concrete syntax tree and is built to be resilient and recoverable, which costs some speed but lets Biome format and lint your code while it is still malformed, so you get feedback as you type.

Oxlint is scoped as a linter for JavaScript and TypeScript only, while Biome also lints CSS, SCSS, JSON, GraphQL, HTML, YAML, and Markdown.

Oxfmt and Biome support a different set of languages out of the box. Oxfmt supports more languages overall, because it bundles Prettier for the languages it has not implemented natively yet. Biome implements every language it supports natively.

See the Oxfmt language support and Biome language support pages for details.

Oxlint adds type-aware linting through the oxlint-tsgolint package. It is built on top of typescript-go and includes most of typescript-eslint’s type-aware rules.

Biome infers types itself and does not need TypeScript installed. Its type-aware rule count is considerably smaller than Oxlint’s, but coverage is growing.