In Biome v1, the formatter has options for JSX quotes and parentheses in the arrow functions; the CLI adds a new command
.jsonc files are supported, and it’s possible to extend the configuration file.
You can upgrade Biome by running the following command:
Or install the VS Code extension to integrate Biome into your editor.
New formatter optionsSection titled New formatter options
Biome now supports two new, long-awaited options:
- support for formatting the preferred quote kind in JSX;
- support for formatting parenthesis in arrow functions only when they are needed;
JSX quotes styleSection titled JSX quotes style
You can use this option via CLI or via
And Biome will apply single quotes when defining attributes in JSX code:
Arrow function parenthesisSection titled Arrow function parenthesis
You can decide not to print parenthesis in arrow functions. You can customize the option via CLI or via
And Biome will print parenthesis only for those arrow functions that require them:
CLI improvementsSection titled CLI improvements
The CLI was heavily reworked to guarantee consistent behaviour when handling files, diagnostics emitted and commands.
Among those changes, there are some breaking changes in its behaviour.
- The CLI exits with an error code if the configuration file contains errors; while Biome can parse the configuration successfully - even with errors - this was a hazard for our users. A typo in the configuration file would have resulted in Biome applying its defaults, and executing Biome with a different behaviour compared to the one set by the user.
- The command
biome checkwill now emit error diagnostics for code not formatted and exits with an error code. This behaviour aligns with the semantics meant for this command.
New Section titled New biome lint command
biome lint command
biome check is meant to run multiple tools, which sometimes can overwhelm the users. With
biome lint, Biome will only run lint rules against files.
As for now, the command accepts almost all the CLI arguments of the
biome check. In the future, this command will specialize and tweak its behaviour around linting.
More control over errorsSection titled More control over errors
By default, when Biome sees a file that can’t handle, it fires a diagnostic and will exit with an error code.
--files-ignore-unknown option, the CLI won’t emit diagnostics and will continue processing files.
You can define this behaviour in the
When Biome doesn’t process files during a command, it exits with an error code and emits an error diagnostic.
--no-errors-on-unmatched, Biome will exist with a successful code and doesn’t emit any diagnostics.
This new option allows users to use Biome with tools like
Exit on warningsSection titled Exit on warnings
In Biome, you can change the configuration of rules and allow them to emit diagnostics. This behaviour was limited, and now with
--error-on-warnings option, you can tell Biome to exit with an error code if a warning is emitted.
Here’s an example, let’s change the diagnostic level of a rule via
Here’s a sample code that will trigger the rule:
And now, run the CLI using the new option:
JSONC support and commentsSection titled JSONC support and comments
Biome’s JSON parser now supports comments, so we enabled these exciting new features.
Section titled .jsonc file support
.jsonc file support
Biome can now format and lint
Allow comments in JSON filesSection titled Allow comments in JSON files
Biome can parse comments inside JSON files. You can opt-in to this feature via the configuration file:
Plus, Biome now recognizes some known files as “JSON files that can have comments”. For example, now Biome can
tsconfig.json file with comments without emitting errors!
Section titled extends property
You can now break down your configuration file into different files and join them using the new
Check the documentation to understand how it works.
LinterSection titled Linter
We deleted two rules:
useCamelCase, which is replaced by
noExtraSemicolon, not needed; the formatter takes care of it;
New RulesSection titled New Rules
This rule disallows duplicate keys in a JSON object.
This rule computes a complexity score and reports code with a score above a configurable threshold.
This rule disallows
switchcases that fall through to the next
This rule recommends using
Number.isFiniteinstead of the global and unsafe
isFinitethat attempts a type of coercion.
This rule recommends using
Number.isNaNinstead of the global and unsafe
isNaNthat attempts a type of coercion.
This rule disallows
\9escape sequences in string literals.
This rule disallows declaration merging between an interface and a class.
This rule disallows useless
This rule disallows useless aliasing of
thisin arrow functions.
This rule disallows the use of
This rule proposes turning function expressions into arrow functions. Function expressions that use
This rule enforces
getmethods to always return a value.
Enables restrictions on how local imports should be imported.
This rule proposes using
Promoted rulesSection titled Promoted rules
New rules are promoted, please check #4750 for more details:
The following rules are now recommended:
Support for function class parameter decoratorsSection titled Support for function class parameter decorators
In the last release, Biome introduced support for Stage 3 decorators. Although, this final proposal doesn’t support the function class parameter decorators:
Some users were dissatisfied because they couldn’t use Biome inside their Angular/NestJS project. Now you can do it via configuration:
AcknowledgementsSection titled Acknowledgements
Big thank you to the following contributors:
- denbezrukov, they implemented the new decorator parameter, the new option
jsxQuoteStylein the formatter, and started the works for our new CSS parser;
- Conaclos, they continued creating new rules, making the existing ones smarter and adding tons of value to Biome;
- SuperchupuDev, they implemented the new option
arrowParenthesesin the formatter;
- nissy-dev, they fixed a bunch of issues around the linter;
- unvalley, they fixed a bunch of issues around the linter and implemented new rules;
- arendjr, they implemented new rules in the linter and implemented the new import sorting strategy;
- ddanielsantos, for their first contribution to the project;
- nikeee, for their first contribution to the project;