biomejs/biome (@biomejs/biome)
### [`v1.7.3`](https://togithub.com/biomejs/biome/blob/HEAD/CHANGELOG.md#173-2024-05-06)
[Compare Source](https://togithub.com/biomejs/biome/compare/2c70d3fde5b13ec9ef0915d22837ab8321b6737f...b9f90b7ee63506a1995bc29f4e389efec25a1525)
##### CLI
##### Bug fixes
- The [stdin-file-path](https://biomejs.dev/guides/integrate-in-editor/#use-stdin) option now works correctly for Astro/Svelte/Vue files ([#2686](https://togithub.com/biomejs/biome/pull/2686))
Fix [#2225](https://togithub.com/biomejs/biome/issues/2225) where lint output become empty for Vue files.
Contributed by [@tasshi-me](https://togithub.com/tasshi-me)
- `biome migrate eslint` now correctly resolve `@scope/eslint-config` ([#2705](https://togithub.com/biomejs/biome/issues/2705)). Contributed by [@Conaclos](https://togithub.com/Conaclos)
##### Formatter
##### Linter
##### New features
- Add [nursery/useExplicitLengthCheck](https://biomejs.dev/linter/rules/use-explicit-length-check/).
##### Bug fixes
- [noBlankTarget](https://biomejs.dev/linter/rules/no-blank-target/) no longer hangs when applying a code fix ([#2675](https://togithub.com/biomejs/biome/issues/2675)).
Previously, the following code made Biome hangs when applying a code fix.
```jsx
```
Contributed by [@Conaclos](https://togithub.com/Conaclos)
- [noRedeclare](https://biomejs.dev/linter/rules/no-redeclare/) no longer panics on conditional type ([#2659](https://togithub.com/biomejs/biome/issues/2659)).
This is a regression introduced by [#2394](https://togithub.com/biomejs/biome/issues/2394).
This regression makes `noRedeclare` panics on every conditional types with `infer` bindings.
Contributed by [@Conaclos](https://togithub.com/Conaclos)
- [noUnusedLabels](https://biomejs.dev/linter/rules/no-unused-labels/) and [noConfusingLabels](https://biomejs.dev/linter/rules/no-confusing-labels/) now ignore svelte reactive statements ([#2571](https://togithub.com/biomejs/biome/issues/2571)).
The rules now ignore reactive Svelte blocks in Svelte components.
```svelte
```
Contributed by [@Conaclos](https://togithub.com/Conaclos)
- [useExportType](https://biomejs.dev/linter/rules/use-export-type/) no longer removes leading comments ([#2685](https://togithub.com/biomejs/biome/issues/2685)).
Previously, `useExportType` removed leading comments when it factorized the `type` qualifier.
It now provides a code fix that preserves the leading comments:
```diff
- export {
+ export type {
/**leading comment*/
- type T
+ T
}
```
Contributed by [@Conaclos](https://togithub.com/Conaclos)
- [useJsxKeyInIterable](https://biomejs.dev/linter/rules/use-jsx-key-in-iterable/) no longer reports false positive when iterating on non-jsx items ([#2590](https://togithub.com/biomejs/biome/issues/2590)).
The following snipet of code no longer triggers the rule:
```jsx
<>{data.reduce((total, next) => total + next, 0)}>
```
Contributed by [@dyc3](https://togithub.com/dyc3)
- Fix typo by renaming `useConsistentBuiltinInstatiation` to `useConsistentBuiltinInstantiation`
Contributed by [@minht11](https://togithub.com/minht11)
### [`v1.7.2`](https://togithub.com/biomejs/biome/blob/HEAD/CHANGELOG.md#172-2024-04-30)
[Compare Source](https://togithub.com/biomejs/biome/compare/aba7b0c1c40a6137b3b78064841f621b53aa5fd0...2c70d3fde5b13ec9ef0915d22837ab8321b6737f)
##### Analyzer
##### Bug fixes
- Import sorting now ignores side effect imports ([#817](https://togithub.com/biomejs/biome/issues/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:
```diff
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](https://togithub.com/Conaclos)
- Import sorting now adds spaces where needed ([#1665](https://togithub.com/biomejs/biome/issues/1665))
Contributed by [@Conaclos](https://togithub.com/Conaclos)
##### CLI
##### Bug fixes
- `biome migrate eslint` now handles cyclic references.
Some plugins and configurations export objects with cyclic references.
This causes `biome migrate eslint` to fail or ignore them.
These edge cases are now handled correctly.
Contributed by [@Conaclos](https://togithub.com/Conaclos)
##### Formatter
##### Bug fixes
- Correctly handle placement of comments inside named import clauses. [#2566](https://togithub.com/biomejs/biome/pull/2566). Contributed by [@ah-yu](https://togithub.com/ah-yu)
##### Linter
##### New features
- Add [nursery/noReactSpecificProps](https://biomejs.dev/linter/rules/no-react-specific-props/).
Contributed by [@marvin-j97](https://togithub.com/marvin-j97)
- Add [noUselessUndefinedInitialization](https://biomejs.dev/linter/rules/no-useless-undefined-initialization/).
Contributed by [@lutaok](https://togithub.com/lutaok)
- Add [nursery/useArrayLiterals](https://biomejs.dev/linter/rules/use-array-literals/).
Contributed by [@Kazuhiro-Mimaki](https://togithub.com/Kazuhiro-Mimaki)
- Add [nursery/useConsistentBuiltinInstatiation](https://biomejs.dev/linter/rules/use-consistent-builtin-instantiation/).
Contributed by [@minht11](https://togithub.com/minht11)
- Add [nursery/useDefaultSwitchClause](https://biomejs.dev/linter/rules/use-default-switch-clause/).
Contributed by [@michellocana](https://togithub.com/michellocana)
##### Bug fixes
- [noDuplicateJsonKeys](https://biomejs.dev/linter/rules/no-duplicate-json-keys/) no longer crashes when a JSON file contains an unterminated string ([#2357](https://togithub.com/biomejs/biome/issues/2357)).
Contributed by [@Conaclos](https://togithub.com/Conaclos)
- [noRedeclare](https://biomejs.dev/linter/rules/no-redeclare/) now reports redeclarations of parameters in a functions body ([#2394](https://togithub.com/biomejs/biome/issues/2394)).
The rule was unable to detect redeclarations of a parameter or a type parameter in the function body.
The following two redeclarations are now reported:
```ts
function f(a) {
type T = number; // redeclaration
const a = 0; // redeclaration
}
```
Contributed by [@Conaclos](https://togithub.com/Conaclos)
- [noRedeclare](https://biomejs.dev/linter/rules/no-redeclare/) no longer reports overloads in object types ([#2608](https://togithub.com/biomejs/biome/issues/2608)).
The rule no longer report redeclarations in the following code:
```ts
type Overloads = {
({ a }: { a: number }): number,
({ a }: { a: string }): string,
};
```
Contributed by [@Conaclos](https://togithub.com/Conaclos)
- [noRedeclare](https://biomejs.dev/linter/rules/no-redeclare/) now merge default function export declarations and types ([#2372](https://togithub.com/biomejs/biome/issues/2372)).
The following code is no longer reported as a redeclaration:
```ts
interface Foo {}
export default function Foo() {}
```
Contributed by [@Conaclos](https://togithub.com/Conaclos)
- [noUndeclaredVariables](https://biomejs.dev/linter/rules/no-undeclared-variables/) no longer reports variable-only and type-only exports ([#2637](https://togithub.com/biomejs/biome/issues/2637)).
Contributed by [@Conaclos](https://togithub.com/Conaclos)
- [noUnusedVariables](https://biomejs.dev/linter/rules/no-unused-variables/) no longer crash Biome when encountering a malformed conditional type ([#1695](https://togithub.com/biomejs/biome/issues/1695)).
Contributed by [@Conaclos](https://togithub.com/Conaclos)
- [useConst](https://biomejs.dev/linter/rules/use-const/) now ignores a variable that is read before its assignment.
Previously, the rule reported the following example:
```js
let x;
x; // read
x = 0; // write
```
It is now correctly ignored.
Contributed by [@Conaclos](https://togithub.com/Conaclos)
- [useShorthandFunctionType](https://biomejs.dev/linter/rules/use-shorthand-function-type/) now suggests correct code fixes when parentheses are required ([#2595](https://togithub.com/biomejs/biome/issues/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.
```diff
- type Union = { (): number } | string;
+ type Union = (() => number) | string;
```
Contributed by [@Conaclos](https://togithub.com/Conaclos)
- [useTemplate](https://biomejs.dev/linter/rules/use-template/) now correctly escapes strings ([#2580](https://togithub.com/biomejs/biome/issues/2580)).
Previously, the rule didn't correctly escape characters preceded by an escaped character.
Contributed by [@Conaclos](https://togithub.com/Conaclos)
- [noMisplacedAssertion](https://biomejs.dev/linter/rules/no-misplaced-assertion/) 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](https://togithub.com/fujiyamaorange)
##### Parser
##### Bug fixes
- The language parsers no longer panic on unterminated strings followed by a newline and a space ([#2606](https://togithub.com/biomejs/biome/issues/2606), [#2410](https://togithub.com/biomejs/biome/issues/2410)).
The following example is now parsed without making Biome panics:
"
"
Contributed by [@Conaclos](https://togithub.com/Conaclos)
### [`v1.7.1`](https://togithub.com/biomejs/biome/blob/HEAD/CHANGELOG.md#171-2024-04-22)
[Compare Source](https://togithub.com/biomejs/biome/compare/2dce6af835cc9339669b09f3a758de36a90b15f7...aba7b0c1c40a6137b3b78064841f621b53aa5fd0)
##### Editors
##### Bug fixes
- Fix [#2403](https://togithub.com/biomejs/biome/issues/2403) by printing the errors in the client console. Contributed by [@ematipico](https://togithub.com/ematipico)
##### Formatter
##### Bug fixes
- Add parentheses for the return expression that has leading multiline comments. [#2504](https://togithub.com/biomejs/biome/pull/2504). Contributed by [@ah-yu](https://togithub.com/ah-yu)
- Correctly format dangling comments of continue statements. [#2555](https://togithub.com/biomejs/biome/pull/2555). Contributed by [@ah-yu](https://togithub.com/ah-yu)
##### Linter
##### Bug fixes
- Fix case where `jsxRuntime` wasn't being respected by `useImportType` rule ([#2473](https://togithub.com/biomejs/biome/issues/2473)).Contributed by [@arendjr](https://togithub.com/arendjr)
- Fix [#2460](https://togithub.com/biomejs/biome/issues/2460), where the rule `noUselessFragments` was crashing the linter in some cases. Now cases like these are correctly handled:
```jsx
callFunction(<>{bar}>)
```
Contributed by [@ematipico](https://togithub.com/ematipico)
- Fix [#2366](https://togithub.com/biomejs/biome/issues/2366), where `noDuplicateJsonKeys` incorrectly computed the kes to highlight. Contributed by [@ematipico](https://togithub.com/ematipico)
##### Enhancements
- The rule `noMisplacedAssertions` now considers valid calling `expect` inside `waitFor`:
```js
import { waitFor } from '@testing-library/react';
await waitFor(() => {
expect(111).toBe(222);
});
```
Contributed by [@ematipico](https://togithub.com/ematipico)
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
This PR contains the following updates:
1.7.0
->1.7.3
Release Notes
biomejs/biome (@biomejs/biome)
### [`v1.7.3`](https://togithub.com/biomejs/biome/blob/HEAD/CHANGELOG.md#173-2024-05-06) [Compare Source](https://togithub.com/biomejs/biome/compare/2c70d3fde5b13ec9ef0915d22837ab8321b6737f...b9f90b7ee63506a1995bc29f4e389efec25a1525) ##### CLI ##### Bug fixes - The [stdin-file-path](https://biomejs.dev/guides/integrate-in-editor/#use-stdin) option now works correctly for Astro/Svelte/Vue files ([#2686](https://togithub.com/biomejs/biome/pull/2686)) Fix [#2225](https://togithub.com/biomejs/biome/issues/2225) where lint output become empty for Vue files. Contributed by [@tasshi-me](https://togithub.com/tasshi-me) - `biome migrate eslint` now correctly resolve `@scope/eslint-config` ([#2705](https://togithub.com/biomejs/biome/issues/2705)). Contributed by [@Conaclos](https://togithub.com/Conaclos) ##### Formatter ##### Linter ##### New features - Add [nursery/useExplicitLengthCheck](https://biomejs.dev/linter/rules/use-explicit-length-check/). ##### Bug fixes - [noBlankTarget](https://biomejs.dev/linter/rules/no-blank-target/) no longer hangs when applying a code fix ([#2675](https://togithub.com/biomejs/biome/issues/2675)). Previously, the following code made Biome hangs when applying a code fix. ```jsx ``` Contributed by [@Conaclos](https://togithub.com/Conaclos) - [noRedeclare](https://biomejs.dev/linter/rules/no-redeclare/) no longer panics on conditional type ([#2659](https://togithub.com/biomejs/biome/issues/2659)). This is a regression introduced by [#2394](https://togithub.com/biomejs/biome/issues/2394). This regression makes `noRedeclare` panics on every conditional types with `infer` bindings. Contributed by [@Conaclos](https://togithub.com/Conaclos) - [noUnusedLabels](https://biomejs.dev/linter/rules/no-unused-labels/) and [noConfusingLabels](https://biomejs.dev/linter/rules/no-confusing-labels/) now ignore svelte reactive statements ([#2571](https://togithub.com/biomejs/biome/issues/2571)). The rules now ignore reactive Svelte blocks in Svelte components. ```svelte ``` Contributed by [@Conaclos](https://togithub.com/Conaclos) - [useExportType](https://biomejs.dev/linter/rules/use-export-type/) no longer removes leading comments ([#2685](https://togithub.com/biomejs/biome/issues/2685)). Previously, `useExportType` removed leading comments when it factorized the `type` qualifier. It now provides a code fix that preserves the leading comments: ```diff - export { + export type { /**leading comment*/ - type T + T } ``` Contributed by [@Conaclos](https://togithub.com/Conaclos) - [useJsxKeyInIterable](https://biomejs.dev/linter/rules/use-jsx-key-in-iterable/) no longer reports false positive when iterating on non-jsx items ([#2590](https://togithub.com/biomejs/biome/issues/2590)). The following snipet of code no longer triggers the rule: ```jsx <>{data.reduce((total, next) => total + next, 0)}> ``` Contributed by [@dyc3](https://togithub.com/dyc3) - Fix typo by renaming `useConsistentBuiltinInstatiation` to `useConsistentBuiltinInstantiation` Contributed by [@minht11](https://togithub.com/minht11) ### [`v1.7.2`](https://togithub.com/biomejs/biome/blob/HEAD/CHANGELOG.md#172-2024-04-30) [Compare Source](https://togithub.com/biomejs/biome/compare/aba7b0c1c40a6137b3b78064841f621b53aa5fd0...2c70d3fde5b13ec9ef0915d22837ab8321b6737f) ##### Analyzer ##### Bug fixes - Import sorting now ignores side effect imports ([#817](https://togithub.com/biomejs/biome/issues/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: ```diff 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](https://togithub.com/Conaclos) - Import sorting now adds spaces where needed ([#1665](https://togithub.com/biomejs/biome/issues/1665)) Contributed by [@Conaclos](https://togithub.com/Conaclos) ##### CLI ##### Bug fixes - `biome migrate eslint` now handles cyclic references. Some plugins and configurations export objects with cyclic references. This causes `biome migrate eslint` to fail or ignore them. These edge cases are now handled correctly. Contributed by [@Conaclos](https://togithub.com/Conaclos) ##### Formatter ##### Bug fixes - Correctly handle placement of comments inside named import clauses. [#2566](https://togithub.com/biomejs/biome/pull/2566). Contributed by [@ah-yu](https://togithub.com/ah-yu) ##### Linter ##### New features - Add [nursery/noReactSpecificProps](https://biomejs.dev/linter/rules/no-react-specific-props/). Contributed by [@marvin-j97](https://togithub.com/marvin-j97) - Add [noUselessUndefinedInitialization](https://biomejs.dev/linter/rules/no-useless-undefined-initialization/). Contributed by [@lutaok](https://togithub.com/lutaok) - Add [nursery/useArrayLiterals](https://biomejs.dev/linter/rules/use-array-literals/). Contributed by [@Kazuhiro-Mimaki](https://togithub.com/Kazuhiro-Mimaki) - Add [nursery/useConsistentBuiltinInstatiation](https://biomejs.dev/linter/rules/use-consistent-builtin-instantiation/). Contributed by [@minht11](https://togithub.com/minht11) - Add [nursery/useDefaultSwitchClause](https://biomejs.dev/linter/rules/use-default-switch-clause/). Contributed by [@michellocana](https://togithub.com/michellocana) ##### Bug fixes - [noDuplicateJsonKeys](https://biomejs.dev/linter/rules/no-duplicate-json-keys/) no longer crashes when a JSON file contains an unterminated string ([#2357](https://togithub.com/biomejs/biome/issues/2357)). Contributed by [@Conaclos](https://togithub.com/Conaclos) - [noRedeclare](https://biomejs.dev/linter/rules/no-redeclare/) now reports redeclarations of parameters in a functions body ([#2394](https://togithub.com/biomejs/biome/issues/2394)). The rule was unable to detect redeclarations of a parameter or a type parameter in the function body. The following two redeclarations are now reported: ```ts function fConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.