Upgrade Biome
此内容尚不支持你的语言。
This page explains how to upgrade Biome in your project, lists the upgrade guides for each major version, and describes what each kind of release can change. For every change in each release, see the changelog.
Upgrade via CLI
Section titled “Upgrade via CLI”-
Install the latest version of Biome with the same method you used to install it:
npm i -D -E @biomejs/biome@latestpnpm add -D -E @biomejs/biome@latestbun add -D -E @biomejs/biome@latestdeno add -D npm:@biomejs/biome@latestyarn add -D -E @biomejs/biome@latestbiome upgradeWhen you run
biome upgrade, Biome detects whether it was installed through Homebrew or as a plain binary and upgrades accordingly. If the detection is wrong, set theBIOME_DISTRIBUTIONenvironment variable. If you installed Biome through Winget or pacman, update it with that tool instead. -
Run the
migratecommand to update the configuration:npx biome migrate --writepnpm biome migrate --writebunx biome migrate --writedeno run -A npm:@biomejs/biome migrate --writeyarn biome migrate --writebiome migrate --write -
Check the output of the command. The
migratecommand updates your configuration to mitigate possible breaking changes, but in some cases you need to perform some manual steps. If so, the command points them out to you.
Automate upgrades
Section titled “Automate upgrades”If you use Renovate to update your dependencies, it can also keep the $schema version in your Biome configuration files up to date. Add the customManagers:biomeVersions preset to the extends list of your Renovate configuration:
{ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["customManagers:biomeVersions"]}Upgrade guides
Section titled “Upgrade guides”Each major version comes with an upgrade guide that explains its breaking changes and how to update your project:
Versioning
Section titled “Versioning”Biome follows semantic versioning. Even patch releases can change your formatting or linting results, so pin the exact version of Biome in your project.
Because Biome is a toolchain, it is not always clear whether a change is major, minor, or patch. The Biome team classifies changes as follows.
Patch release
Section titled “Patch release”Patch releases fix bugs and make internal improvements. They increase the last number of the version, for example from 2.6.7 to 2.6.8. You do not need to change your configuration, but your formatting or linting results can still change slightly.
Patch releases include changes such as:
- Fixing false positives in lint rules, and incorrect code suggestions.
- Fixing formatting that produces invalid code or changes how the program behaves.
- Making internal changes, such as refactors and performance improvements.
Minor release
Section titled “Minor release”Minor releases add new features. They increase the middle number of the version, for example from 2.5.3 to 2.6.0. A minor release can report new lint errors, for example when it adds a recommended rule.
Minor releases include changes such as:
- Adding new rules, or promoting rules from the nursery group to a stable group.
- Supporting new language features.
- Adding configuration options that do not change your results by default.
Major release
Section titled “Major release”Major releases include breaking changes that can require updates to your configuration. They increase the first number of the version, for example from 1.9.4 to 2.0.0. Each major release comes with an upgrade guide.
Major releases include changes such as:
- Changing configuration options or their default values in a way that changes your results.
- Changing Biome’s public API.
Why pinning the version is important
Section titled “Why pinning the version is important”Fixes to lint rules and formatting layouts can make your scripts fail, and even patch releases can produce slightly different formatting or linting results. Save the exact version of Biome in your package.json instead of using a range operator, so that every team member and your CI environments use the same version, and your scripts do not fail unexpectedly.
© 2023-present Biome developers and contributors.