Skip to content

biome

GitHub stars autofix sarif GitHub release (latest SemVer) GitHub last commit GitHub commit activity GitHub contributors

Biome is one fast toolchain for the web, linting, formatting and sorting imports of JavaScript, TypeScript, JSX, TSX, JSON, CSS and GraphQL files with a single Rust binary. MegaLinter runs biome check, which applies lint rules, formatting checks and assist actions in a single pass.

Key Features:

  • All-in-one toolchain: linter, formatter and import sorter in a single tool, replacing several separate dependencies
  • Rust performance: checks large codebases in milliseconds
  • Sensible defaults: hundreds of lint rules with recommended presets, most of them providing safe automatic fixes
  • Formatter compatibility: about 97% compatibility with Prettier output
  • Inline suppressions: granular control with // biome-ignore comments
  • First-class monorepo support: nested configurations with extends and root detection

Activation: this linter runs only if a biome.json or biome.jsonc configuration file is found in your repository. Apply safe fixes automatically with APPLY_FIXES.

biome documentation

biome - GitHub

Configuration in MegaLinter

Variable Description Default value
JAVASCRIPT_BIOME_ARGUMENTS User custom arguments to add in linter CLI call
Ex: -s --foo "bar"
JAVASCRIPT_BIOME_COMMAND_REMOVE_ARGUMENTS User custom arguments to remove from command line before calling the linter
Ex: -s --foo "bar"
JAVASCRIPT_BIOME_FILTER_REGEX_INCLUDE Custom regex including filter
Ex: (src\|lib)
⚠️ Not available with JAVASCRIPT_BIOME_CLI_LINT_MODE = project
Exclude no file
JAVASCRIPT_BIOME_FILTER_REGEX_EXCLUDE Custom regex excluding filter
Ex: (test\|examples)
⚠️ Not available with JAVASCRIPT_BIOME_CLI_LINT_MODE = project
Exclude no file
JAVASCRIPT_BIOME_CLI_LINT_MODE Override default CLI lint mode
- file: Calls the linter for each file
- list_of_files: Call the linter with the list of files as argument
- project: Call the linter from the root of the project
list_of_files
JAVASCRIPT_BIOME_FORWARD_EXCLUDED_DIRECTORIES In project CLI lint mode, forward excluded directories (EXCLUDED_DIRECTORIES + ADDITIONAL_EXCLUDED_DIRECTORIES) to the linter through its native exclusion arguments or generated ignore/config files true
JAVASCRIPT_BIOME_FILE_EXTENSIONS Allowed file extensions. "*" matches any extension, "" matches empty extension. Empty list excludes all files
Ex: [".py", ""]
[".js"]
JAVASCRIPT_BIOME_FILE_NAMES_REGEX File name regex filters. Regular expression list for filtering files by their base names using regex full match. Empty list includes all files
Ex: ["Dockerfile(-.+)?", "Jenkinsfile"]
Include every file
JAVASCRIPT_BIOME_PRE_COMMANDS List of bash commands to run before the linter None
JAVASCRIPT_BIOME_POST_COMMANDS List of bash commands to run after the linter None
JAVASCRIPT_BIOME_UNSECURED_ENV_VARIABLES List of env variables explicitly not filtered before calling JAVASCRIPT_BIOME and its pre/post commands None
JAVASCRIPT_BIOME_CONFIG_FILE biome configuration file name
Use LINTER_DEFAULT to let the linter find it
biome.json
JAVASCRIPT_BIOME_RULES_PATH Path where to find linter configuration file Workspace folder, then MegaLinter default rules
JAVASCRIPT_BIOME_DISABLE_ERRORS Run linter but consider errors as warnings false
JAVASCRIPT_BIOME_DISABLE_ERRORS_IF_LESS_THAN Maximum number of errors allowed 0
JAVASCRIPT_BIOME_TIMEOUT_SECONDS Maximum duration in seconds of the linter run, after which the linter process and its child processes are killed and reported as an error (exit code 124). Overrides LINTER_TIMEOUT_SECONDS. 0 disables the timeout 300
JAVASCRIPT_BIOME_CLI_EXECUTABLE Override CLI executable ['biome']

IDE Integration

Use biome in your favorite IDE to catch errors before MegaLinter !

IDE Extension Name Install
IDEA Biome
Visual Studio Code Biome Install in VSCode

MegaLinter Flavors

This linter is available in the following flavors

Flavor Description Embedded linters Info
all Default MegaLinter Flavor 131 Docker Image Size (tag) Docker Pulls
cupcake MegaLinter for the most commonly used languages 98 Docker Image Size (tag) Docker Pulls
dotnetweb Optimized for C, C++, C# or VB based projects with JS/TS 82 Docker Image Size (tag) Docker Pulls
javascript Optimized for JAVASCRIPT or TYPESCRIPT based projects 69 Docker Image Size (tag) Docker Pulls

Behind the scenes

How are identified applicable files

  • Activated only if one of these files is found: biome.json, biome.jsonc
  • File extensions: .js

How the linting is performed

biome is called once on the whole project directory (project CLI lint mode)

  • filtering can not be done using MegaLinter configuration variables,it must be done using biome configuration or ignore file (if existing)
  • VALIDATE_ALL_CODEBASE: false doesn't make biome analyze only updated files

Example calls

biome check myfile.js
biome check --config-path biome.json myfile.js
biome check --write myfile.js

Help content

Biome's command-line interface for checking, formatting, and linting files, managing configuration,
and interacting with the daemon.

Usage: biome COMMAND ...

Available options:
    -h, --help     Prints help information
    -V, --version  Prints version information

Available commands:
    version        Prints the Biome CLI version and information about the connected daemon server,
                   if any, then exits.
    upgrade        Upgrades Biome to the latest stable version.
    rage           Prints a troubleshooting report with CLI, platform, environment, configuration,
                   workspace, and daemon server information.
    start          Starts the Biome daemon server used for integration with third-party clients,
                   such as editor extensions.
    stop           Stops the Biome daemon server if it is running.
    check          Checks the specified files for formatting, linting, and assist actions.
    lint           Runs the linter on the specified files.
    format         Formats the specified files.
    ci             Runs formatting checks, linting checks, and assist actions in CI without
                   modifying files.
    init           Creates a default Biome configuration file in the current working directory.
    lsp-proxy      Ensures that the Biome daemon server is running, then forwards Language Server
                   Protocol messages between the daemon server and standard input and output.
    migrate        Previews configuration updates required by breaking changes. The `prettier` and
                   `eslint` subcommands instead import settings from those tools.
    search         Finds code that matches a GritQL pattern. This command is experimental.
    explain        Prints documentation for a lint rule or the path to the daemon server log
                   directory.
    clean          Removes the Biome daemon server log files.

Installation on mega-linter Docker image

  • Dockerfile commands :
    # renovate: datasource=npm depName=@biomejs/biome
    ARG NPM_BIOMEJS_BIOME_VERSION=2.5.7