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 96% compatibility with Prettier.
Biome is a performant linter for JavaScript, TypeScript, and JSX that features more than 170 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 --apply ./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.
1.4.0 (2023-11-27)
CLI
-
Remove the CLI options from the lsp-proxy
, as they were never meant to be passed to that command. Contributed by
@ematipico
-
Add option --config-path
to lsp-proxy
and start
commands. It's now possible to tell the Daemon server to
load biome.json
from a custom path. Contributed by @ematipico
-
Add option --diagnostic-level
. It lets users control the level of diagnostics printed by the CLI. Possible values
are: "info"
, "warn"
, and "hint"
. Contributed by @simonxabris
-
Add option --line-feed
to the format
command. Contributed by @SuperchupuDev
-
Add option --bracket-same-line
to the format
command. Contributed by @faultyserver
-
Add option --bracket-spacing
to the format
command. Contributed by @faultyserver
Bug fixes
- Fix the command
format
, now it returns a non-zero exit code when if there pending diffs. Contributed by @ematipico
Formatter
New features
-
Add the configuration formatter.lineFeed
. It
allows changing the type of line endings. Contributed by @SuperchupuDev
-
Add the
configuration javascript.formatter.bracketSameLine
.
It allows controlling whether ending >
of a multi-line JSX element should be on the last attribute line or
not. #627. Contributed by @faultyserver
-
Add the
configuration javascript.formatter.bracketSpacing
.
It allows controlling whether spaces are inserted around the brackets of object
literals. #627. Contributed by @faultyserver
Bug fixes
-
Fix #832, the formatter no longer keeps an unnecessary trailing comma
in type parameter lists. Contributed by @Conaclos
- class A<T,> {}
+ class A<T> {}
-
Fix #301, the formatter should not break before the in
keyword.
Contributed by @ematipico
Linter
Promoted rules
The following rules are now recommended:
The following rules are now deprecated:
New features
-
Add noDefaultExport which disallows export default
.
Contributed by @Conaclos
-
Add noAriaHiddenOnFocusable which reports hidden and
focusable elements. Contributed by @vasucp1207
-
Add noImplicitAnyLet that reports variables declared
with let
and without initialization and type annotation. Contributed by @TaKO8Ki and @b4s36t4
-
Add useAwait that reports async
functions that don't use an await
expression.
-
Add useValidAriaRole. Contributed by @vasucp1207
-
Add useRegexLiterals that suggests turning call to the regex
constructor into regex literals. COntributed by @Yuiki
Enhancements
Bug fixes
-
Fix #639 by ignoring unused TypeScript's mapped key. Contributed by
@Conaclos
-
Fix #565 by handling several infer
with the same name in extends
clauses of TypeScript's conditional types. Contributed by @Conaclos
Fix #653. noUnusedImports
now correctly removes the entire line where the unused import
is. Contributed by @Conaclos
-
Fix #607 useExhaustiveDependencies
, ignore optional chaining,
Contributed by @msdlisper
-
Fix #676, by using the correct node for the "noreferrer"
when
applying the code action. Contributed by @ematipico
-
Fix #455. The CLI can now print complex emojis to the console
correctly.
Fix #727. noInferrableTypes
now correctly keeps type annotations when the initialization expression is null
. Contributed by @Conaclos
Fix #784, noSvgWithoutTitle
fixes false-positives to aria-label
and reports svg's role attribute is implicit. Contributed by @unvalley
Parser
Bug fixes
- Fix #846 that erroneously parsed
<const T,>() => {}
as a JSX tag
instead of an arrow function when both TypeScript and JSX are enabled.
VSCode