DEV Community

Alex Spinov
Alex Spinov

Posted on

Biome Has a Free API — Lint and Format JavaScript 100x Faster Than ESLint

Biome is a toolchain for JavaScript, TypeScript, JSON, CSS, and more. It's a linter AND formatter in one tool — and it's 100x faster than ESLint + Prettier because it's written in Rust.

Why Biome?

  • 100x faster than ESLint + Prettier (benchmarked)
  • One tool — replaces both ESLint AND Prettier
  • Zero config — works out of the box with sensible defaults
  • 200+ lint rules — covers ESLint, TypeScript-ESLint, import rules

Quick Start

npm install --save-dev --save-exact @biomejs/biome
npx @biomejs/biome init
Enter fullscreen mode Exit fullscreen mode
// biome.json (auto-generated)
{
  "$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
  "organizeImports": { "enabled": true },
  "linter": { "enabled": true },
  "formatter": { "enabled": true }
}
Enter fullscreen mode Exit fullscreen mode

Commands

# Format
npx biome format --write .

# Lint
npx biome lint .

# Both + import sorting
npx biome check --write .

# CI mode (fail on issues)
npx biome ci .
Enter fullscreen mode Exit fullscreen mode

Configuration

{
  "formatter": {
    "indentStyle": "space",
    "indentWidth": 2,
    "lineWidth": 100
  },
  "javascript": {
    "formatter": {
      "quoteStyle": "single",
      "semicolons": "asNeeded",
      "trailingCommas": "all"
    }
  },
  "linter": {
    "rules": {
      "recommended": true,
      "complexity": {
        "noForEach": "warn",
        "useSimplifiedLogicExpression": "error"
      },
      "suspicious": {
        "noExplicitAny": "error"
      },
      "style": {
        "useConst": "error",
        "noNonNullAssertion": "warn"
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Migrating from ESLint + Prettier

# Auto-migrate ESLint config
npx @biomejs/biome migrate eslint --write

# Auto-migrate Prettier config
npx @biomejs/biome migrate prettier --write

# Remove old tools
npm uninstall eslint prettier eslint-config-prettier
Enter fullscreen mode Exit fullscreen mode

Performance

Task Biome ESLint + Prettier
Lint 1000 files 0.3s 30s
Format 1000 files 0.2s 15s
IDE feedback Instant 1-3s delay

VS Code Extension

// .vscode/settings.json
{
  "editor.defaultFormatter": "biomejs.biome",
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "quickfix.biome": "explicit",
    "source.organizeImports.biome": "explicit"
  }
}
Enter fullscreen mode Exit fullscreen mode

Building developer tools? Check out my Apify actors for web scraping, or email spinov001@gmail.com for custom tooling solutions.

Biome, ESLint, or oxlint — which linter do you use? Share below!

Top comments (0)