CLI v1.7.2
Analyzer
Bug fixes
-
Import sorting now ignores side effect imports (#817).
A side effect import consists now in its own group.
This ensures that side effect imports are not reordered.Here is an example of how imports are now sorted:
import "z" - import { D } from "d"; import { C } from "c"; + import { D } from "d"; import "y" import "x" - import { B } from "b"; import { A } from "a"; + import { B } from "b"; import "w"
Contributed by @Conaclos
-
Import sorting now adds spaces where needed (#1665)
Contributed by @Conaclos
CLI
Bug fixes
-
biome migrate eslint
now handles cyclic references.Some plugins and configurations export objects with cyclic references.
This causesbiome migrate eslint
to fail or ignore them.
These edge cases are now handled correctly.Contributed by @Conaclos
Formatter
Bug fixes
Linter
New features
-
Add nusery/noReactSpecificProps.
Contributed by @marvin-j97 -
Add noUselessUndefinedInitialization.
Contributed by @lutaok -
Add nusery/useArrayLiterals.
Contributed by @Kazuhiro-Mimaki -
Add nusery/useConsistentBuiltinInstatiation.
Contributed by @minht11 -
Add nusery/useDefaultSwitchClause.
Contributed by @michellocana
Bug fixes
-
noDuplicateJsonKeys no longer crashes when a JSON file contains an unterminated string (#2357).
Contributed by @Conaclos -
noRedeclare now reports redeclarations of parameters in a functions body (#2394).
The rule was unable to detect redeclarations of a parameter or type parameter in the function body.
The following two redeclarations are now reported:function f<T>(a) { type T = number; // redeclaration const a = 0; // redeclaration }
Contributed by @Conaclos
-
noRedeclare no longer reports overloads in object types (#2608).
The rule no longer report redeclarations in the following code:
type Overloads = { ({ a }: { a: number }): number, ({ a }: { a: string }): string, };
Contributed by @Conaclos
-
noRedeclare now merge default function export declarations and types (#2372).
The following code is no longer reported as a redeclaration:
interface Foo {} export default function Foo() {}
Contributed by @Conaclos
-
noUndeclaredVariables no longer reports variable-only and type-only exports (#2637).
Contributed by @Conaclos -
[noUnusedVariables] no longer crash Biome when encountering a malformed conditional type (#1695).
Contributed by @Conaclos -
useConst now ignores a variable that is read before its assignment.
Previously, the rule reported the following example:
let x; x; // read x = 0; // write
It is now correctly ignored.
Contributed by @Conaclos
-
useShorthandFunctionType now suggests correct code fixes when parentheses are required (#2595).
Previously, the rule didn't add parentheses when they were needed.
It now adds parentheses when the function signature is inside an array, a union, or an intersection.- type Union = { (): number } | string; + type Union = (() => number) | string;
Contributed by @Conaclos
-
useTemplate now correctly escapes strings (#2580).
Previously, the rule didn't correctly escape characters preceded by an escaped character.
Contributed by @Conaclos
-
noMisplacedAssertion now allow these matchers
expect.any()
expect.anything()
expect.closeTo
expect.arrayContaining
expect.objectContaining
expect.stringContaining
expect.stringMatching
expect.extend
expect.addEqualityTesters
expect.addSnapshotSerializer
Contributed by @fujiyamaorange
Parser
Bug fixes
-
The language parsers no longer panic on unterminated strings followed by a newline and a space (#2606, #2410).
The following example is now parsed without making Biome panics:
" "
Contributed by @Conaclos
What's Changed
Other changes
- build(xstask): remove deps
fs_extra
andfiletime
by @Conaclos in #2562 - docs: Add more useImportType examples to docs by @drwpow in #2307
- chore: update schema definition by @Mayandev in #2567
- fix(configuration_schema): rename some fields to camelCase in the
configuration_schema.json
by @ah-yu in #2568 - fix: rename some fileds to camelCase in the
configuration_schema
by @ah-yu in #2569 - feat(biome_css_analyzer): noUnknownUnit by @neokidev in #2535
- chore: fix some typos in comments by @hardlydearly in #2579
- refactor: foundations for LSP workspaces support by @ematipico in #2589
- fix(lint/noRedundantAlt): rule source by @Conaclos in #2609
- feat(linter): Implement
useGenericFontNames
by @togami2864 in #2573 - chore: remove some website leftovers by @SuperchupuDev in #2617
- refactor(deserialize): don't handle Option specifically by @Conaclos in #2630
- refactor: use TriviaPiece factory functions in more places by @minht11 in #2632
- feat(biome_css_analyzer): noUnknownFunction by @neokidev in #2570
- fix(snippet): should emit only one diagnostic by @Sec-ant in #2650
- chore: add infrastructure for Grit engine by @arendjr in #2586
- docs: fix typos in biome_rowan batch mutation by @vohoanglong0107 in #2653
- chore: upgrade prettier and update snapshots by @ah-yu in #2502
- build(deps): update by @Conaclos in #2657
New Contributors
- @Mayandev made their first contribution in #2567
- @neokidev made their first contribution in #2535
- @hardlydearly made their first contribution in #2579
- @minht11 made their first contribution in #2540
- @Kazuhiro-Mimaki made their first contribution in #2541
- @michellocana made their first contribution in #2605
- @Shyam-Chen made their first contribution in #2598
Full Changelog: cli/v1.7.1...cli/v1.7.2