« Back to Search  |  Reader Mode  |  Switch to Full Retro Site View Links: Stay in Reader  |  Retro Mode: ON  |  Original »
Biome · Extracted in 255 ms

Biome

Source: https://biomejs.dev/

One toolchain for your web project

Format, lint, and more in a fraction of a second. Get started View on GitHub
npm i -D -E @biomejs/biome

Format code like Prettier, save time

Biome is a fast formatter for JavaScript , TypeScript , JSX , TSX , JSON , HTML , CSS , SCSS , GraphQL , YAML and Markdown that scores 97% compatibility with Prettier (see known limitations ), saving CI and developer time .

Biome can even format malformed code as you write it in your favorite editor .

CODE

function HelloWorld({greeting = "hello", greeted = '"World"', silent = false, onMouseOver,}) {

  if(!greeting){return null};

      // TODO: Don't use random in render

  let num = Math.floor (Math.random() * 1E+7).toString().replace(/.d+/ig, "")

  return <div className='HelloWorld' title={`You are visitor number ${ num }`} onMouseOver={onMouseOver}>

    <strong>{ greeting.slice( 0, 1 ).toUpperCase() + greeting.slice(1).toLowerCase() }</strong>

    {greeting.endsWith(",") ? " " : <span style={{color: 'grey'}}>", "</span> }

    <em>

  { greeted }

    </em>

    { (silent)

      ? "."

      : "!"}

    </div>;

}
OUTPUT

function HelloWorld({

  greeting = "hello",

  greeted = '"World"',

  silent = false,

  onMouseOver,

}) {

  if (!greeting) {

    return null;

  }

  // TODO: Don't use random in render

  let num = Math.floor(Math.random() * 1E+7)

    .toString()

    .replace(/.d+/gi, "");

  return (

    <div

      className="HelloWorld"

      title={`You are visitor number ${num}`}

      onMouseOver={onMouseOver}

    >

      <strong>

        {greeting.slice(0, 1).toUpperCase() + greeting.slice(1).toLowerCase()}

      </strong>

      {greeting.endsWith(",") ? (

        " "

      ) : (

        <span style={{ color: "grey" }}>", "</span>

      )}

      <em>{greeted}</em>

      {silent ? "." : "!"}

    </div>

  );

}
PERFORMANCE
Biome

Prettier
~25x

Faster than Prettier in the official benchmark , on a MacBook Pro with an M1 chip.

Try the Biome formatter on the playground or directly on your project:

npm @biomejs/biome format

Fix problems, learn best practice

Biome is a performant linter for JavaScript , TypeScript , JSX , JSON , HTML , CSS , SCSS , GraphQL , YAML and Markdown that features 880 rules from ESLint, TypeScript ESLint, and other sources .

Biome outputs detailed, contextual diagnostics that explain each problem and how to fix it, so you learn the patterns behind them.

complexity/useFlatMap.js:2:1 lint/complexity/useFlatMap  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ The call chain .map().flat() can be replaced with a single .flatMap() call.

    1 │ const array = ["split", "the text", "into words"];
  > 2 │ array.map(sentence => sentence.split(' ')).flat();
      │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    3 │ 

  ℹ Safe fix: Replace the chain with .flatMap().

    1 1 │   const array = ["split", "the text", "into words"];
    2   │ - array.map(sentence·=>·sentence.split('·')).flat();
      2 │ + array.flatMap(sentence·=>·sentence.split('·'));
    3 3 │   

Try the Biome linter on the playground or directly on your project:

npm @biomejs/biome lint --write

Everything all at once

You can format and lint your code separately, or do it all at once with a single command .

The tools share one configuration and work together as a cohesive toolchain for web projects.

Run all tools with the check command:

npm @biomejs/biome check --write

Fast

Built with Rust and an innovative architecture inspired by rust-analyzer.

Simple

Zero configuration needed to get started. When you need more control, one configuration file covers every tool.

Scalable

Designed to handle codebases of any size, so you can focus on your product instead of your tools.

Actionable and informative

No obscure error messages. When Biome reports a problem, it shows you exactly where it is and how to fix it.

Batteries included

Out-of-the-box support for all the language features you use today, and first-class support for TypeScript and JSX.

Enterprise support

Commercial support is available to organizations that need it, through the Biome community of contributors.

Try Biome

Install Biome with your preferred package manager and integrate it in your editor.

Install with package manager

Integrate Biome in your editor

Trusted by leading organizations

Join thousands of developers and companies using Biome in production

Astro AWS Canonical Cloudflare Coinbase Comcast Discord Google Microsoft n8n Node.js Slack Socket Uniswap Vercel View all users

Community

Powered by open-source contributors

Discord

GitHub

BlueSky

Mastodon

Sponsors

Biome is free and open source, made possible by our sponsors


Platinum
Depot
Gold
CodSpeed Become a sponsor Hosted by This site is powered by Netlify

© 2023-present Biome developers and contributors .