Getting Started
Biome is best installed as a development dependency of your projects, but it is also available as a standalone executable that doesn’t require Node.js.
npm i -D -E @biomejs/biome
pnpm add -D -E @biomejs/biome
bun add -D -E @biomejs/biome
deno add -D npm:@biomejs/biome
yarn add -D -E @biomejs/biome
Configuration
Section titled “Configuration”Although Biome can run with zero configuration, you’ll likely want to tweak some
settings to suit your project’s needs, in which case you can run the following
command to generate a biome.json
configuration file.
npx @biomejs/biome init
pnpm exec biome init
bunx --bun biome init
deno run -A npm:@biomejs/biome init
yarn exec biome init
Lets get a quick overview of how to use Biome in your project.
Command-line interface
Section titled “Command-line interface”Biome provides a command-line interface to format, lint, and check your code.
# Format all filesnpx @biomejs/biome format --write
# Format specific filesnpx @biomejs/biome format --write <files>
# Lint files and apply safe fixes to all filesnpx @biomejs/biome lint --write
# Lint files and apply safe fixes to specific filesnpx @biomejs/biome lint --write <files>
# Format, lint, and organize imports of all filesnpx @biomejs/biome check --write
# Format, lint, and organize imports of specific filesnpx @biomejs/biome check --write <files>
# Format all filespnpm exec biome format --write
# Format specific filespnpm exec biome format --write <files>
# Lint and apply safe fixes to all filespnpm exec biome lint --write
# Lint files and apply safe fixes to specific filespnpm exec biome lint --write <files>
# Format, lint, and organize imports of all filespnpm exec biome check --write
# Format, lint, and organize imports of specific filespnpm exec biome check --write <files>
# Format all filesbunx biome format --write
# Format specific filesbunx biome format --write <files>
# Lint and apply safe fixes to all filesbunx biome lint --write
# Lint files and apply safe fixes to specific filesbunx biome lint --write <files>
# Format, lint, and organize imports of all filesbunx biome check --write
# Format, lint, and organize imports of specific filesbunx biome check --write <files>
# Format specific filesdeno run -A npm:@biomejs/biome format --write <files>
# Format all filesdeno run -A npm:@biomejs/biome format --write
# Lint files and apply safe fixes to all filesdeno run -A npm:@biomejs/biome lint --write
# Lint files and apply safe fixes to specific filesdeno run -A npm:@biomejs/biome lint --write <files>
# Format, lint, and organize imports of all filesdeno run -A npm:@biomejs/biome check --write
# Format, lint, and organize imports of specific filesdeno run -A npm:@biomejs/biome check --write <files>
# Format all filesyarn exec biome format --write
# Format specific filesyarn exec biome format --write <files>
# Lint files and apply safe fixes to all filesyarn exec biome lint --write
# Lint files and apply safe fixes to specific filesyarn exec biome lint --write <files>
# Format, lint, and organize imports of all filesyarn exec biome check --write <files>
# Format, lint, and organize imports of specific filesyarn exec biome check --write <files>
Editor integrations
Section titled “Editor integrations”Biome is available as a first-party extension in your favorite editors.
There are also community extensions for other editors, such as Vim, Neovim, and Sublime Text, to name a few.
Continuous Integration
Section titled “Continuous Integration”Run biome ci
as part of your CI pipeline to enforce code quality and consistency
across your team. It works just like the biome check
command, but is optimized for
CI environments.
See the Continuous Integration recipes for more examples.
Next Steps
Section titled “Next Steps”Success! You’re now ready to use Biome. 🥳
- Migrate from ESLint and Prettier
- Learn more about how to configure Biome
- Learn more about how to use and configure the formatter
- Learn more about how to use and configure the linter
- Get familiar with the CLI commands and options
- Get familiar with the configuration options
- Join our community on Discord