This project follows Semantic Versioning. Due to the nature of Biome as a toolchain, it can be unclear what changes are considered major, minor, or patch. Read our guidelines to categorize a change.
New entries must be placed in a section entitled Unreleased.
Read our guidelines for writing a good changelog entry.
-
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-pathtolsp-proxyandstartcommands. It's now possible to tell the Daemon server to loadbiome.jsonfrom a custom path. Contributed by @ematipico -
Add new
--diagnostic-leveloption to let users control the level of diagnostics printed by the CLI. Possible values are:"info","warn","hint". Contributed by @simonxabris
- Fix the command
format, now it returns a non-zero exit code when if there pending diffs. Contributed by @ematipico
- Add a new option
--line-ending. This option allows changing the type of line endings. Contributed by @SuperchupuDev - Added a new option called
--bracket-spacingto the formatter. This option allows you to control whether spaces are inserted around the brackets of object literals. #627. Contributed by @faultyserver
- Fix #301, the formatter should not break before the
inkeyword. Contributed by @ematipico
- Add noDefaultExport which disallows
export default. Contributed by @Conaclos
-
Fix #639 by ignoring unused TypeScript's mapped key. Contributed by @Conaclos
-
Fix #565 by handling several
inferwith 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
importis. 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-labeland reports svg's role attribute is implicit. Contributed by @unvalley
- Fix #604 which made noConfusingVoidType report false positives when the
voidtype is used in a generic type parameter. Contributed by @unvalley
- Fix how
overridesbehave. Nowignoreandincludeapply or not the override pattern, so they override each other. Now the options insideoverridesoverride the top-level options. - Bootstrap the logger only when needed. Contributed by @ematipico
- Fix how
overridesare run. The propertiesignoreandincludehave different semantics and only apply/not apply an override. Contributed by @ematipico
- Fix #592, by changing binary resolution in the IntelliJ plugin. Contributed by @Joshuabaker2
- Apply the correct layout when the right hand of an assignment expression is a await expression or a yield expression. Contributed by @ematipico
- Fix #303, where nested arrow functions didn't break. Contributed by @victor-teles
-
Fix #175 which made noRedeclare report index signatures using the name of a variable in the parent scope.
-
Fix #557 which made noUnusedImports report imported types used in
typeofexpression. Contributed by @Conaclos -
Fix #576 by removing some erroneous logic in noSelfAssign. Contributed by @ematipico
-
Fix #595 by updating unsafe-apply logic to avoid unexpected errors in noUselessFragments. Contributed by @nissy-dev
-
Fix #591 which made noRedeclare report type parameters with identical names but in different method signatures. Contributed by @Conaclos
-
Support more a11y roles and fix some methods for a11y lint rules Contributed @nissy-dev
-
Fix #609
useExhaustiveDependencies, by removinguseContext,useIdanduseSyncExternalStorefrom the known hooks. Contributed by @msdlisper -
Fix
useExhaustiveDependencies, by removinguseContext,useIdanduseSyncExternalStorefrom the known hooks. Contributed by @msdlisper
- Add noUnusedPrivateClassMembers rule. The rule disallow unused private class members. Contributed by @victor-teles
- Support RegExp v flag. Contributed by @nissy-dev
- Improve error messages. Contributed by @ematipico
- Fix
ragecommand, now it doesn't print info about running servers. Contributed by @ematipico
- Fix #552, where the formatter isn't correctly triggered in Windows systems. Contributed by @victor-teles
- Add noThisInStatic rule. Contributed by @ditorodev and @Conaclos
-
Fix #548 which made noSelfAssign panic.
-
Fix #555, by correctly map
globalsinto the workspace.
-
Import sorting is safe to apply now, and it will be applied when running
check --applyinstead ofcheck --apply-unsafe. -
Import sorting now handles Bun imports
bun:<name>, absolute path imports/<path>, and Node's subpath imports#<name>. See our documentation for more details. Contributed by @Conaclos
- Fix #319. The command
biome lintnow shows the correct options. Contributed by @ematipico - Fix #312. Running
biome --versionnow exits with status code0instead of1. Contributed by @nhedger - Fix a bug where the
extendsfunctionality doesn't carry overorganizeImports.ignore. Contributed by @ematipico - The CLI now returns the original content when using
stdinand the original content doesn't change. Contributed by @ematipico
-
Add support for
BIOME_BINARYenvironment variable to override the location of the binary. Contributed by @ematipico -
Add option
--indent-width, and deprecated the option--indent-size. Contributed by @ematipico -
Add option
--javascript-formatter-indent-width, and deprecated the option--javascript-formatter-indent-size. Contributed by @ematipico -
Add option
--json-formatter-indent-width, and deprecated the option--json-formatter-indent-size. Contributed by @ematipico -
Add option
--daemon-logstobiome rage. The option is required to view Biome daemon server logs. Contributed by @unvalley -
Add support for logging. By default, Biome doesn't log anything other than diagnostics. Logging can be enabled with the new option
--log-level:biome format --log-level=info ./src
There are four different levels of logging, from the most verbose to the least verbose:
debug,info,warnanderror. Here's how anINFOlog will look like:2023-10-05T08:27:01.954727Z INFO Analyze file ./website/src/playground/components/Resizable.tsx at crates/biome_service/src/file_handlers/javascript.rs:298 on biome::worker_5 in Pulling diagnostics with categories: RuleCategories(SYNTAX) in Processes formatting with path: "./website/src/playground/components/Resizable.tsx" in Process check with path: "./website/src/playground/components/Resizable.tsx"You can customize how the log will look like with a new option
--log-kind. The supported kinds are:pretty,compactandjson.prettyis the default logging. Here's how acompactlog will look like:2023-10-05T08:29:04.864247Z INFO biome::worker_2 Process check:Processes linting:Pulling diagnostics: crates/biome_service/src/file_handlers/javascript.rs: Analyze file ./website/src/playground/components/Resizable.tsx path="./website/src/playground/components/Resizable.tsx" path="./website/src/playground/components/Resizable.tsx" categories=RuleCategories(LINT) 2023-10-05T08:29:04.864290Z INFO biome::worker_7 Process check:Processes formatting: crates/biome_service/src/file_handlers/javascript.rs: Format file ./website/src/playground/components/Tabs.tsx path="./website/src/playground/components/Tabs.tsx" path="./website/src/playground/components/Tabs.tsx" 2023-10-05T08:29:04.879332Z INFO biome::worker_2 Process check:Processes formatting:Pulling diagnostics: crates/biome_service/src/file_handlers/javascript.rs: Analyze file ./website/src/playground/components/Resizable.tsx path="./website/src/playground/components/Resizable.tsx" path="./website/src/playground/components/Resizable.tsx" categories=RuleCategories(SYNTAX) 2023-10-05T08:29:04.879383Z INFO biome::worker_2 Process check:Processes formatting: crates/biome_service/src/file_handlers/javascript.rs: Format file ./website/src/playground/components/Resizable.tsx path="./website/src/playground/components/Resizable.tsx" path="./website/src/playground/components/Resizable.tsx"
- Deprecated the environment variable
ROME_BINARY. UseBIOME_BINARYinstead. Contributed by @ematipico - Biome doesn't check anymore the presence of the
.gitfolder when VCS support is enabled. Contributed by @ematipico biome ragedoesn't print the logs of the daemon, usebiome rage --daemon-logsto print them. Contributed by @unvalley
-
Add option
formatter.indentWidth, and deprecated the optionformatter.indentSize. Contributed by @ematipico -
Add option
javascript.formatter.indentWidth, and deprecated the optionjavascript.formatter.indentSize. Contributed by @ematipico -
Add option
json.formatter.indentWidth, and deprecated the optionjson.formatter.indentSize. Contributed by @ematipico -
Add option
includeto multiple sections of the configurationfiles.include;formatter.include;linter.include;organizeImports.include; Whenincludeandignoreare both specified,ignoretakes precedence overinclude
-
Add option
overrides, where users can modify the behaviour of the tools for certain files or paths.For example, it's possible to modify the formatter
lineWidth, and evenquoteStylefor certain files that are included in glob pathgenerated/**:{ "formatter": { "lineWidth": 100 }, "overrides": [ { "include": ["generated/**"], "formatter": { "lineWidth": 160 }, "javascript": { "formatter": { "quoteStyle": "single" } } } ] }Or, you can disable certain rules for certain path, and disable the linter for other paths:
{ "linter": { "enabled": true, "rules": { "recommended": true } }, "overrides": [ { "include": ["lib/**"], "linter": { "rules": { "suspicious": { "noDebugger": "off" } } } }, { "include": ["shims/**"], "linter": { "enabled": false } } ] }
- Fix #343,
extendswas incorrectly applied to thebiome.jsonfile. Contributed by @ematipico
-
Fix #404. Biome intellij plugin now works on Windows. Contributed by @victor-teles
-
Fix #402. Biome
formaton intellij plugin now recognize biome.json. Contributed by @victor-teles
- Use
OnceCellfor the Memoized memory because that's what theRefCell<Option>implemented. Contributed by @denbezrukov
- complexity/noExcessiveCognitiveComplexity
- complexity/noVoid
- correctness/useExhaustiveDependencies
- correctness/useHookAtTopLevel
- performance/noAccumulatingSpread
- style/useCollapsedElseIf
- suspicious/noConfusingVoidType
- suspicious/noFallthroughSwitchClause
- suspicious/noGlobalIsFinite
- suspicious/noGlobalIsNan
- suspicious/useIsArray
The following rules are now recommended:
-
Add noEmptyCharacterClassInRegex rule. The rule reports empty character classes and empty negated character classes in regular expression literals. Contributed by @Conaclos
-
Add noMisleadingInstantiator rule. The rule reports the misleading use of the
newandconstructormethods. Contributed by @unvalley -
Add noUselessElse rule. The rule reports
elseclauses that can be omitted because theirifbranches break. Contributed by @Conaclos -
Add noUnusedImports rule. The rule reports unused imports and suggests to remove them. Contributed by @Conaclos
noUnusedVariables reports also unused imports, but don't suggest their removal. Once noUnusedImports stabilized, noUnusedVariables will not report unused imports.
-
Add useShorthandAssign rule. The rule enforce use of shorthand operators that combine variable assignment and some simple mathematical operations. For example, x = x + 4 can be shortened to x += 4. Contributed by @victor-teles
-
Add useAsConstAssertion rule. The rule enforce use of
as constassertion to infer literal types. Contributed by @unvalley -
Add noMisrefactoredShorthandAssign rule. The rule reports shorthand assigns when variable appears on both sides. For example
x += x + bContributed by @victor-teles -
Add noApproximativeNumericConstant rule. Contributed by @nikeee
-
Add noInteractiveElementToNoninteractiveRole rule. The rule enforces the non-interactive ARIA roles are not assigned to interactive HTML elements. Contributed by @nissy-dev
-
Add useAriaActivedescendantWithTabindex rule. The rule enforces that
tabIndexis assigned to non-interactive HTML elements witharia-activedescendant. Contributed by @nissy-dev -
Add noUselessLoneBlockStatements rule. The rule reports standalone blocks that don't include any lexical scoped declaration. Contributed by @emab
-
Add noInvalidNewBuiltin rule. The rule reports use of
newonSymbolandBigInt. Contributed by @lucasweng
-
The following rules have now safe code fixes:
-
noAccumulatingSpread makes more check in order to reduce potential false positives. Contributed by @Vivalldi
-
noConstAssign now provides an unsafe code fix that replaces
constwithlet. Contributed by @vasucp1207 -
noExcessiveComplexity default complexity threshold is now
15. Contributed by @arendjr -
noPositiveTabindexValue now provides an unsafe code fix that set to
0the tab index. Contributed by @vasucp1207 -
noUnusedLabels no longer reports unbreakable labeled statements. Contributed by @Conaclos
-
noUnusedVariables now reports unused TypeScript's type parameters. Contributed by @Conaclos
-
useAnchorContent now provides an unsafe code fix that removes the `aria-hidden`` attribute. Contributed by @vasucp1207
-
useValidAriaProps now provides an unsafe code fix that removes invalid properties. Contributed by @vasucp1207
-
noExcessiveComplexitywas renamed tonoExcessiveCognitiveComplexity
-
Fix #294. noConfusingVoidType no longer reports false positives for return types. Contributed by @b4s36t4
-
Fix #313. noRedundantUseStrict now keeps leading comments.
-
Fix #383. noMultipleSpacesInRegularExpressionLiterals now provides correct code fixes when consecutive spaces are followed by a quantifier. Contributed by @Conaclos
-
Fix #397. useNumericLiterals now provides correct code fixes for signed numbers. Contributed by @Conaclos
-
Fix 452. The linter panicked when it met a malformed regex (a regex not ending with a slash).
-
Fix #104. We now correctly handle types and values with the same name.
-
Fix #243 a false positive case where the incorrect scope was defined for the
infertype. in rule noUndeclaredVariables. Contributed by @denbezrukov -
Fix #322, now noSelfAssign correctly handles literals inside call expressions.
-
Changed how noSelfAssign behaves. The rule is not triggered anymore on function calls. Contributed by @ematipico
-
Enhance diagnostic for infer type handling in the parser. The 'infer' keyword can only be utilized within the 'extends' clause of a conditional type. Using it outside of this context will result in an error. Ensure that any type declarations using 'infer' are correctly placed within the conditional type structure to avoid parsing issues. Contributed by @denbezrukov
-
Add support for parsing trailing commas inside JSON files:
{ "json": { "parser": { "allowTrailingCommas": true } } }Contributed by @nissy-dev
- Fix a condition where import sorting wasn't applied when running
biome check --apply
- Fix an edge case where the formatter language configuration wasn't picked.
- Fix the configuration schema, where
json.formatterproperties weren't transformed in camel case.
- Add new options to customize the behaviour the formatter based on the language of the file
--json-formatter-enabled--json-formatter-indent-style--json-formatter-indent-size--json-formatter-line-width--javascript-formatter-enabled--javascript-formatter-indent-style--javascript-formatter-indent-size--javascript-formatter-line-width
- Fix a bug where
--errors-on-warningdidn't work when runningbiome cicommand.
- Add new options to customize the behaviour of the formatter based on the language of the file
json.formatter.enabledjson.formatter.indentStylejson.formatter.indentSizejson.formatter.lineWidthjavascript.formatter.enabledjavascript.formatter.indentStylejavascript.formatter.indentSizejavascript.formatter.lineWidth
New rules are incubated in the nursery group. Once stable, we promote them to a stable group. The following rules are promoted:
- a11y/noAriaUnsupportedElements
- a11y/noNoninteractiveTabindex
- a11y/noRedundantRoles
- a11y/useValidAriaValues
- complexity/noBannedTypes
- complexity/noStaticOnlyClass
- complexity/noUselessEmptyExport
- complexity/noUselessThisAlias
- correctness/noConstantCondition
- correctness/noNonoctalDecimalEscape
- correctness/noSelfAssign
- style/useLiteralEnumMembers
- style/useNamingConvention
- suspicious/noControlCharactersInRegex
- suspicious/noUnsafeDeclarationMerging
- suspicious/useGetterReturn
- Add noConfusingVoidType rule. The rule reports the unusual use of the
voidtype. Contributed by @shulandmimi
-
Remove noConfusingArrow.
Code formatters, such as prettier and Biome, always adds parentheses around the parameter or the body of an arrow function. This makes the rule useless.
Contributed by @Conaclos
-
noFallthroughSwitchClause now relies on control flow analysis to report most of switch clause fallthrough. Contributed by @Conaclos
-
noAssignInExpressions no longer suggest code fixes. Most of the time the suggestion didn't match users' expectations. Contributed by @Conaclos
-
noUselessConstructor no longer emits safe code fixes. Contributed by @Conaclos
All code fixes are now emitted as unsafe code fixes. Removing a constructor can change the behavior of a program.
-
useCollapsedElseIf now only provides safe code fixes. Contributed by @Conaclos
-
noUnusedVariables now reports more cases.
The rule is now able to ignore self-writes. For example, the rule reports the following unused variable:
let a = 0; a++; a += 1;
The rule is also capable of detecting an unused declaration that uses itself. For example, the rule reports the following unused interface:
interface I { instance(): I }
Finally, the rule now ignores all TypeScript declaration files, including global declaration files.
Contributed by @Conaclos
-
Fix #182, making useLiteralKeys retains optional chaining. Contributed by @denbezrukov
-
Fix #168, fix useExhaustiveDependencies false positive case when stable hook is on a new line. Contributed by @denbezrukov
-
Fix #137, fix noRedeclare false positive case with TypeScript module declaration:
declare module '*.gif' { const src: string; } declare module '*.bmp' { const src: string; }
Contributed by @denbezrukov
-
Fix #258, fix noUselessFragments the case where the rule removing an assignment. Contributed by @denbezrukov
-
Fix #266, where
complexity/useLiteralKeysemitted a code action with an invalid AST. Contributed by @ematipico -
Fix #105, removing false positives reported by noUnusedVariables.
The rule no longer reports the following used variable:
const a = f(() => a);
Contributed by @Conaclos
-
Improve server binary resolution when using certain package managers, notably pnpm.
The new strategy is to point to
node_modules/.bin/biomepath, which is consistent for all package managers.
- Fix a case where an empty JSON file would cause the LSP server to crash. Contributed by @ematipico
-
useNamingConvention now accepts import namespaces in PascalCase and rejects export namespaces in CONSTANT_CASE.
The following code is now valid:
import * as React from "react";
And the following code is now invalid:
export * as MY_NAMESPACE from "./lib.js";
Contributed by @Conaclos
-
noUselessConstructor now ignores decorated classes and decorated parameters. The rule now gives suggestions instead of safe fixes when parameters are annotated with types. Contributed by @Conaclos
- The diagnostic for
// rome-ignoresuppression comment should not be a warning. A warning could block the CI, marking a gradual migration difficult. The code action that changes// rome-ignoreto// biome-ignoreis disabled as consequence. Contributed by @ematipico
- Add a code action to replace
rome-ignorewithbiome-ignore. Usebiome check --apply-unsafeto update all the comments. The action is not bulletproof, and it might generate unwanted code, that's why it's unsafe action. Contributed by @ematipico
- Biome now reports a diagnostics when a
rome.jsonfile is found. biome migrate --writecreatesbiome.jsonfromrome.json, but it won't delete therome.jsonfile. Contributed by @ematipico
- Biome uses
biome.jsonfirst, then it attempts to userome.json. - Fix a case where Biome couldn't compute correctly the ignored files when the VSC integration is enabled. Contributed by @ematipico
- The LSP now uses its own socket and won't rely on Biome's socket. This fixes some cases where users were seeing multiple servers in the
rageoutput.
- You can use
// biome-ignoreas suppression comment. - The
// rome-ignoresuppression is deprecated.
- Add useCollapsedElseIf rule. This new rule requires merging an
elseand anif, if theifstatement is the only statement in theelseblock. Contributed by @n-gude
-
useTemplate now reports all string concatenations.
Previously, the rule ignored concatenation of a value and a newline or a backquote. For example, the following concatenation was not reported:
v + "\n"; "`" + v + "`";
The rule now reports these cases and suggests the following code fixes:
- v + "\n"; + `${v}\n`; - v + "`"; + `\`${v}\``;
Contributed by @Conaclos
-
useExponentiationOperator suggests better code fixes.
The rule now preserves any comment preceding the exponent, and it preserves any parenthesis around the base or the exponent. It also adds spaces around the exponentiation operator
**, and always adds parentheses for pre- and post-updates.- Math.pow(a++, /**/ (2)) + (a++) ** /**/ (2)
Contributed by @Conaclos
-
You can use
// biome-ignoreas suppression comment. -
The
// rome-ignoresuppression is deprecated.
-
Fix #80, making noDuplicateJsxProps case-insensitive.
Some frameworks, such as Material UI, rely on the case-sensitivity of JSX properties. For example, TextField has two properties with the same name, but distinct cases:
<TextField inputLabelProps="" InputLabelProps=""></TextField>
Contributed by @Conaclos
-
Fix #138
noCommaOperator now correctly ignores all use of comma operators inside the update part of a
forloop. The following code is now correctly ignored:for ( let i = 0, j = 1, k = 2; i < 100; i++, j++, k++ ) {}
Contributed by @Conaclos
-
Fix rome#4713.
Previously, useTemplate made the following suggestion:
- a + b + "px" + `${a}${b}px`
This breaks code where
aandbare numbers.Now, the rule makes the following suggestion:
- a + b + "px" + `${a + b}px`
Contributed by @Conaclos
-
Fix rome#4109
Previously, useTemplate suggested an invalid code fix when a leading or trailing single-line comment was present:
// leading comment - 1 /* inner comment */ + "+" + 2 // trailing comment + `${// leading comment + 1 /* inner comment */}+${2 //trailing comment}` // trailing comment
Now, the rule correctly handle this case:
// leading comment - 1 + "+" + 2 // trailing comment + `${1}+${2}` // trailing comment
As a sideeffect, the rule also suggests the removal of any inner comments.
Contributed by @Conaclos
-
Fix rome#3850
Previously useExponentiationOperator suggested invalid code in a specific edge case:
- 1 +Math.pow(++a, 2) + 1 +++a**2
Now, the rule properly adds parentheses:
- 1 +Math.pow(++a, 2) + 1 +(++a) ** 2
Contributed by @Conaclos
-
Fix #106
noUndeclaredVariables now correctly recognizes some TypeScript types such as
Uppercase.Contributed by @Conaclos
-
Fix rome#4616
Previously noUnreachableSuper reported valid codes with complex nesting of control flow structures.
Contributed by @Conaclos
-
The organize imports feature now groups import statements by "distance".
Modules "farther" from the user are put on the top, and modules "closer" to the user are placed on the bottom. Check the documentation for more information about it.
-
The organize imports tool is enabled by default. If you don't want to use it, you need to disable it explicitly:
{ "organizeImports": { "enabled": false } }
-
The CLI now exists with an error when there's an error inside the configuration.
Previously, biome would raise warnings and continue the execution by applying its defaults.
This could have been better for users because this could have created false positives in linting or formatted code with a configuration that wasn't the user's.
-
The command
biome checknow shows formatter diagnostics when checking the code.The diagnostics presence will result in an error code when the command finishes.
This aligns with semantic and behaviour meant for the command
biome check. -
initcommand emits abiome.jsonfile;
-
Fix #4670, don't crash at empty default export.
-
Fix #4556, which correctly handles new lines in the
.gitignorefile across OS. -
Add a new option to ignore unknown files
--files-ignore-unknown:biome format --files-ignore-unknown ./src
Doing so, Biome won't emit diagnostics for files that doesn't know how to handle.
-
Add the new option
--no-errors-on-unmatched:biome format --no-errors-on-unmatched ./src
Biome doesn't exit with an error code if no files were processed in the given paths.
-
Fix the diagnostics emitted when running the
biome formatcommand. -
Biome no longer warns when discovering (possibly infinite) symbolic links between directories.
This fixes #4193 which resulted in incorrect warnings when a single file or directory was pointed at by multiple symbolic links. Symbolic links to other symbolic links do still trigger warnings if they are too deeply nested.
-
Introduced a new command called
biome lint, which will only run lint rules against the code base. -
Biome recognises known files as "JSON files with comments allowed":
typescript.json;tsconfig.json;jsconfig.json;tslint.json;babel.config.json;.babelrc.json;.ember-cli;typedoc.json;.eslintrc.json;.eslintrc;.jsfmtrc;.jshintrc;.swcrc;.hintrc;.babelrc;
-
Add support for
biome.json;
-
Add a new option to ignore unknown files:
{ "files": { "ignoreUnknown": true } }Doing so, Biome won't emit diagnostics for file that it doesn't know how to handle.
-
Add a new
"javascript"option to support the unsafe/experimental parameter decorators:{ "javascript": { "parser": { "unsafeParameterDecoratorsEnabled": true } } } -
Add a new
"extends"option, useful to split the configuration file in multiple files:{ "extends": ["../sharedFormatter.json", "linter.json"] }The resolution of the files is file system based, Biome doesn't know how to resolve dependencies yet.
-
The commands
biome checkandbiome lintnow show the remaining diagnostics even when--apply-safeor--apply-unsafeare passed. -
Fix the commands
biome checkandbiome lint, they won't exit with an error code if no error diagnostics are emitted. -
Add a new option
--error-on-warnings, which instructs Biome to exit with an error code when warnings are emitted.biome check --error-on-wanrings ./src
-
Add a configuration to enable parsing comments inside JSON files:
{ "json": { "parser": { "allowComments": true } } }
-
The Biome LSP can now show diagnostics belonging to JSON lint rules.
-
The Biome LSP no longer applies unsafe quickfixes on-save when
editor.codeActionsOnSave.quickfix.biomeis enabled. -
Fix #4564; files too large don't emit errors.
-
The Biome LSP sends client messages when files are ignored or too big.
-
Add a new option called
--jsx-quote-style.This option lets you choose between single and double quotes for JSX attributes.
-
Add the option
--arrow-parentheses.This option allows setting the parentheses style for arrow functions.
-
The JSON formatter can now format
.jsonfiles with comments.
-
Remove
complexity/noExtraSemicolon(#4553)The Biome formatter takes care of removing extra semicolons. Thus, there is no need for this rule.
-
Remove
useCamelCaseUse useNamingConvention instead.
-
Add noGlobalIsFinite
This rule recommends using
Number.isFiniteinstead of the global and unsafeisFinitethat attempts a type coercion. -
Add noGlobalIsNan
This rule recommends using
Number.isNaNinstead of the global and unsafeisNaNthat attempts a type coercion. -
Add noUnsafeDeclarationMerging
This rule disallows declaration merging between an interface and a class.
-
This rule disallows useless aliasing of
thisin arrow functions. -
Add useArrowFunction
This rule proposes turning function expressions into arrow functions. Function expressions that use
thisare ignored. -
This rule disallow duplicate keys in a JSON object.
-
Add noVoid
This rules disallow the use of
void. -
This rule disallows
\8and\9escape sequences in string literals. -
This rule disallows useless
export {}. -
Add useIsArray
This rule proposes using
Array.isArray()instead ofinstanceof Array. -
Add useGetterReturn
This rule enforces the presence of non-empty return statements in getters. This makes the following code incorrect:
class Person { get firstName() {} }
New rules are promoted, please check #4750 for more details:
- a11y/useHeadingContent
- complexity/noForEach
- complexity/useLiteralKeys
- complexity/useSimpleNumberKeys
- correctness/useIsNan
- suspicious/noConsoleLog
- suspicious/noDuplicateJsxProps
The following rules are now recommended:
-
Add new TypeScript globals (
AsyncDisposable,Awaited,DecoratorContext, and others) 4643. -
noRedeclare: allow redeclare of index signatures are in different type members #4478
-
Improve noConsoleLog, noGlobalObjectCalls, useIsNan, and useNumericLiterals by handling
globalThisandwindownamespaces.For instance, the following code is now reported by
noConsoleLog:globalThis.console.log("log")
-
Improve noDuplicateParameters to manage constructor parameters.
-
Improve noInnerDeclarations
Now, the rule doesn't report false-positives about ambient TypeScript declarations. For example, the following code is no longer reported by the rule:
declare var foo;
-
Improve useEnumInitializers
The rule now reports all uninitialized members of an enum in a single diagnostic.
Moreover, ambient enum declarations are now ignored. This avoids reporting ambient enum declarations in TypeScript declaration files.
declare enum Weather { Rainy, Sunny, }
-
Relax noBannedTypes and improve documentation
The rule no longer reports a user type that reuses a banned type name. The following code is now allowed:
import { Number } from "a-lib"; declare const v: Number;
The rule now allows the use of the type
{}to denote a non-nullable generic type:function f<T extends {}>(x: T) { assert(x != null); }
And in a type intersection for narrowing a type to its non-nullable equivalent type:
type NonNullableMyType = MyType & {};
-
Improve noConstantCondition
The rule now allows
while(true). This recognizes a common pattern in the web community:while (true) { if (cond) { break; } }
-
Improve the diagnostic and the code action of useDefaultParameterLast.
The diagnostic now reports the last required parameter which should precede optional and default parameters.
The code action now removes any whitespace between the parameter name and its initialization.
-
Relax noConfusingArrow
All arrow functions that enclose its parameter with parenthesis are allowed. Thus, the following snippet no longer trigger the rule:
var x = (a) => 1 ? 2 : 3;
The following snippet still triggers the rule:
var x = a => 1 ? 2 : 3;
-
Relax useLiteralEnumMembers
Enum members that refer to previous enum members are now allowed. This allows a common pattern in enum flags like in the following example:
enum FileAccess { None = 0, Read = 1, Write = 1 << 1, All = Read | Write, }
Arbitrary numeric constant expressions are also allowed:
enum FileAccess { None = 0, Read = 2**0, Write = 2**1, All = Read | Write, }
-
Improve useLiteralKeys.
Now, the rule suggests simplifying computed properties to string literal properties:
{ - ["1+1"]: 2, + "1+1": 2, }It also suggests simplifying string literal properties to static properties:
{ - "a": 0, + a: 0, }These suggestions are made in object literals, classes, interfaces, and object types.
-
Improve noNewSymbol.
The rule now handles cases where
Symbolis namespaced with the globalglobalThisorwindow. -
The rules useExhaustiveDependencies and useHookAtTopLevel accept a different shape of options
Old configuration:
{ "linter": { "rules": { "nursery": { "useExhaustiveDependencies": { "level": "error", "options": { "hooks": [ ["useMyEffect", 0, 1] ] } } } } } }New configuration:
{ "linter": { "rules": { "nursery": { "useExhaustiveDependencies": { "level": "error", "options": { "hooks": [ { "name": "useMyEffect", "closureIndex": 0, "dependenciesIndex": 1 } ] } } } } } } -
noRedundantUseStrict check only
'use strict'directive to resolve false positive diagnostics.React introduced new directives, "use client" and "use server". The rule raises false positive errors about these directives.
-
Fix a crash in the NoParameterAssign rule that occurred when there was a bogus binding. #4323
-
Fix useExhaustiveDependencies in the following cases #4330:
- when the first argument of hooks is a named function
- inside an export default function
- for React.use* hooks
-
Fix noInvalidConstructorSuper that erroneously reported generic parents #4624.
-
Fix noDuplicateCase that erroneously reported as equals the strings literals
"'"and'"'#4706. -
Fix NoUnreachableSuper's false positive diagnostics (#4483) caused to nested if statement.
The rule no longer reports
This constructor calls super() in a loopwhen using nested if statements in a constructor. -
Fix useHookAtTopLevel's false positive diagnostics (#4637)
The rule no longer reports false positive diagnostics when accessing properties directly from a hook and calling a hook inside function arguments.
-
Fix noUselessConstructor which erroneously reported constructors with default parameters rome#4781
-
Fix noUselessFragments's panics when running
biome check --apply-unsafe(#4637)This rule's code action emits an invalid AST, so I fixed using JsxString instead of JsStringLiteral
-
Fix noUndeclaredVariables's false positive diagnostics (#4675)
The semantic analyzer no longer handles
thisreference identifier. -
Fix noUnusedVariables's false positive diagnostics (#4688)
The semantic analyzer handles ts export declaration clause correctly.
-
Add support for decorators in class method parameters, example:
class AppController { get(@Param() id) {} // ^^^^^^^^ new supported syntax }
This syntax is only supported via configuration, because it's a non-standard syntax.
{ "javascript": { "parser": { "unsafeParameterDecoratorsEnabled": true } } } -
Add support for parsing comments inside JSON files:
{ "json": { "parser": { "allowComments": true } } } -
Add support for the new
usingsyntaxconst using = resource.lock();