Convert Figma logo to code with AI

biomejs logobiome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.

13,952
423
13,952
160

Top Related Projects

50,335

Prettier is an opinionated code formatter.

23,624

Unified developer tools for JavaScript, TypeScript, and the web

25,843

Find and fix problems in your JavaScript code.

A JavaScript codemod toolkit.

5,902

:vertical_traffic_light: An extensible linter for the TypeScript language

29,311

🌟 JavaScript Style Guide, with linter & automatic code fixer

Quick Overview

Biome is a high-performance toolchain for web development, focusing on JavaScript and TypeScript. It aims to provide a fast, unified experience for formatting, linting, and more, with an emphasis on developer productivity and code quality.

Pros

  • Extremely fast performance, often outperforming other tools in the same category
  • All-in-one solution for formatting, linting, and other web development tasks
  • Highly configurable with a focus on ease of use
  • Built with Rust, offering robustness and efficiency

Cons

  • Relatively new project, which may lead to potential instability or lack of mature features
  • Smaller ecosystem and community compared to more established tools like ESLint or Prettier
  • May require adjustments for developers accustomed to other tooling setups
  • Limited language support compared to some alternatives (primarily focuses on JavaScript and TypeScript)

Code Examples

  1. Basic configuration file (biome.json):
{
  "formatter": {
    "enabled": true,
    "indentStyle": "space",
    "indentSize": 2
  },
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true
    }
  }
}
  1. Running Biome CLI for linting:
biome lint src/
  1. Using Biome to format code:
biome format --write src/

Getting Started

  1. Install Biome:

    npm install --save-dev @biomejs/biome
    
  2. Create a configuration file (biome.json) in your project root:

    {
      "formatter": {
        "enabled": true
      },
      "linter": {
        "enabled": true
      }
    }
    
  3. Add scripts to your package.json:

    {
      "scripts": {
        "lint": "biome lint .",
        "format": "biome format --write ."
      }
    }
    
  4. Run Biome:

    npm run lint
    npm run format
    

Competitor Comparisons

50,335

Prettier is an opinionated code formatter.

Pros of Prettier

  • Wider language support, including CSS, GraphQL, and YAML
  • Larger ecosystem with more plugins and integrations
  • More established project with a longer track record

Cons of Prettier

  • Slower performance, especially on large codebases
  • Less configurable, with a "opinionated" approach to formatting
  • No built-in linting capabilities

Code Comparison

Biome:

biome.format({
  filePath: "example.js",
  text: "const x=1;const y=2;",
});

Prettier:

prettier.format("const x=1;const y=2;", {
  parser: "babel",
  semi: false,
});

Key Differences

  • Biome is faster and more performant, especially for large projects
  • Biome includes linting capabilities, while Prettier focuses solely on formatting
  • Prettier supports more languages out of the box
  • Biome offers more configuration options for formatting rules
  • Prettier has a larger community and ecosystem of plugins

Use Cases

  • Choose Biome for projects prioritizing performance and customization
  • Opt for Prettier when working with multiple languages or requiring extensive plugin support
  • Consider Biome for projects that want combined formatting and linting in a single tool
  • Prettier may be preferable for teams wanting a strict, opinionated formatting approach
23,624

Unified developer tools for JavaScript, TypeScript, and the web

Pros of Rome

  • More established project with a longer history
  • Larger community and contributor base
  • Wider range of supported languages and file types

Cons of Rome

  • Development has slowed down significantly
  • Less frequent updates and releases
  • Some reported performance issues with larger codebases

Code Comparison

Rome configuration:

{
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true
    }
  }
}

Biome configuration:

{
  "formatter": {
    "enabled": true,
    "indentStyle": "space",
    "indentSize": 2
  },
  "linter": {
    "enabled": true
  }
}

Summary

While Rome has been around longer and has a larger community, Biome is gaining traction due to its more active development and performance improvements. Biome is essentially a continuation of Rome's vision, with a renewed focus on speed and efficiency. Both tools aim to provide an all-in-one solution for JavaScript and TypeScript development, including linting, formatting, and bundling capabilities. However, Biome's more recent updates and optimizations may make it a more attractive choice for new projects or those looking to migrate from other tooling setups.

25,843

Find and fix problems in your JavaScript code.

Pros of ESLint

  • Extensive ecosystem with numerous plugins and configurations
  • Highly customizable with fine-grained control over rules
  • Well-established with a large community and widespread adoption

Cons of ESLint

  • Configuration can be complex and time-consuming
  • Slower performance, especially on large codebases
  • Requires separate tools for formatting and other code quality checks

Code Comparison

ESLint configuration:

{
  "extends": "eslint:recommended",
  "rules": {
    "semi": ["error", "always"],
    "quotes": ["error", "single"]
  }
}

Biome configuration:

{
  "formatter": {
    "enabled": true,
    "indentStyle": "space",
    "lineWidth": 80
  },
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true
    }
  }
}

Biome offers a more streamlined configuration with built-in formatting and linting capabilities, while ESLint requires separate configuration for each aspect of code quality. ESLint's configuration is more verbose but allows for more granular control over individual rules. Biome's approach simplifies setup and maintenance, potentially leading to improved developer experience and consistency across projects.

A JavaScript codemod toolkit.

Pros of jscodeshift

  • More mature and widely adopted in the JavaScript ecosystem
  • Extensive documentation and community support
  • Powerful AST manipulation capabilities for complex code transformations

Cons of jscodeshift

  • Steeper learning curve due to its low-level API
  • Slower performance for large-scale transformations
  • Limited built-in formatting options

Code Comparison

jscodeshift:

export default function transformer(file, api) {
  const j = api.jscodeshift;
  return j(file.source)
    .find(j.Identifier)
    .replaceWith(
      p => j.identifier(p.node.name.toUpperCase())
    )
    .toSource();
}

Biome:

import { parse, print } from "@biomejs/biome";

const source = "const hello = 'world';";
const ast = parse(source);
const transformed = ast.replace({
  Identifier: (node) => ({
    ...node,
    name: node.name.toUpperCase(),
  }),
});
console.log(print(transformed).code);

Both tools allow for AST manipulation, but Biome offers a more high-level API and integrated formatting capabilities. jscodeshift provides finer control over transformations but requires more boilerplate code. Biome's approach is more concise and potentially easier for beginners to grasp.

5,902

:vertical_traffic_light: An extensible linter for the TypeScript language

Pros of TSLint

  • Mature and well-established project with extensive documentation
  • Large ecosystem of custom rules and plugins
  • Specifically designed for TypeScript, offering deep integration

Cons of TSLint

  • Deprecated and no longer actively maintained
  • Slower performance compared to newer linting tools
  • Limited support for modern JavaScript features

Code Comparison

TSLint configuration:

{
  "rules": {
    "no-unused-variable": true,
    "semicolon": [true, "always"]
  }
}

Biome configuration:

{
  "linter": {
    "rules": {
      "style": {
        "useConst": "error",
        "useSemicolons": "always"
      }
    }
  }
}

Summary

TSLint is a deprecated linting tool specifically designed for TypeScript projects. While it offers deep TypeScript integration and a large ecosystem of rules, it lacks support for modern JavaScript features and has performance issues. Biome, on the other hand, is a newer, faster, and actively maintained tool that supports both JavaScript and TypeScript. Biome aims to provide a more unified development experience by combining linting, formatting, and other tools into a single package.

29,311

🌟 JavaScript Style Guide, with linter & automatic code fixer

Pros of Standard

  • Widely adopted and well-established in the JavaScript community
  • Simple setup with zero configuration required
  • Extensive ecosystem of plugins and integrations

Cons of Standard

  • Limited customization options
  • Slower performance compared to newer linters
  • Less comprehensive language support (primarily focused on JavaScript)

Code Comparison

Standard:

module.exports = {
  extends: 'standard',
  rules: {
    // No additional configuration needed
  }
}

Biome:

{
  "$schema": "https://biomejs.dev/schemas/1.0.0/schema.json",
  "organizeImports": {
    "enabled": true
  },
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true
    }
  }
}

Key Differences

  • Biome is a more modern, all-in-one tool that includes formatting, linting, and more
  • Standard focuses on JavaScript, while Biome supports multiple languages
  • Biome offers more customization options and faster performance
  • Standard has a larger community and more established ecosystem
  • Biome provides a unified configuration for multiple tools, while Standard is primarily a linter

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Shows the banner of Biome, with its logo and the phrase 'Biome - Toolchain of the web'.

Discord chat CI on main npm version VSCode version Open VSX version

Biome is a performant toolchain for web projects, it aims to provide developer tools to maintain the health of said projects.

Biome is a fast formatter for JavaScript, TypeScript, JSX, and JSON that scores 97% compatibility with Prettier.

Biome is a performant linter for JavaScript, TypeScript, and JSX that features more than 200 rules from ESLint, typescript-eslint, and other sources. It outputs detailed and contextualized diagnostics that help you to improve your code and become a better programmer!

Biome is designed from the start to be used interactively within an editor. It can format and lint malformed code as you are writing it.

Installation

npm install --save-dev --save-exact @biomejs/biome

Usage

# format files
npx @biomejs/biome format --write ./src

# lint files
npx @biomejs/biome lint ./src

# run format, lint, etc. and apply the safe suggestions
npx @biomejs/biome check --write ./src

# check all files against format, lint, etc. in CI environments
npx @biomejs/biome ci ./src

If you want to give Biome a run without installing it, use the online playground, compiled to WebAssembly.

Documentation

Check out our homepage to learn more about Biome, or directly head to the Getting Started guide to start using Biome.

More about Biome

Biome has sane defaults and it doesn't require configuration.

Biome aims to support all main languages of modern web development.

Biome doesn't require Node.js to function.

Biome has first-class LSP support, with a sophisticated parser that represents the source text in full fidelity and top-notch error recovery.

Biome unifies functionality that has previously been separate tools. Building upon a shared base allows us to provide a cohesive experience for processing code, displaying errors, parallelize work, caching, and configuration.

Read more about our project philosophy.

Biome is MIT licensed or Apache 2.0 licensed and moderated under the Contributor Covenant Code of Conduct.

Funding

You can fund the project in different ways

Project sponsorship and funding

You can sponsor or fund the project via Open collective or GitHub sponsors

Biome offers a simple sponsorship program that allows companies to get visibility and recognition among various developers.

Issue funding

We use Polar.sh to up-vote and promote specific features that you would like to see and implement. Check our backlog and help us:

Sponsors

Gold Sponsors

Silver Sponsors

Bronze Sponsors

NPM DownloadsLast 30 Days