Skip to content

Commit 0b42ed3

Browse files
release: synchronize to 2.1.4 (#2863)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 713765d commit 0b42ed3

File tree

4 files changed

+15207
-2
lines changed

4 files changed

+15207
-2
lines changed

src/components/generated/DefaultConfiguration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
```json title="biome.json"
33
{
4-
"$schema": "https://biomejs.dev/schemas/2.1.3/schema.json",
4+
"$schema": "https://biomejs.dev/schemas/2.1.4/schema.json",
55
"vcs": {
66
"enabled": false,
77
"clientKind": "git",

src/content/docs/internals/changelog.md

Lines changed: 206 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,218 @@ tableOfContents:
66
---
77
# @biomejs/biome
88

9+
## 2.1.4
10+
11+
### Patch Changes
12+
13+
- [#7121](https://github.com/biomejs/biome/pull/7121) [`b9642ab`](https://github.com/biomejs/biome/commit/b9642abc6d05135180f4243df30524cf40ba12df) Thanks [@arendjr](https://github.com/arendjr)! - Fixed [#7111](https://github.com/biomejs/biome/issues/7111): Imported symbols using aliases are now correctly recognised.
14+
15+
- [#7103](https://github.com/biomejs/biome/pull/7103) [`80515ec`](https://github.com/biomejs/biome/commit/80515ecad8cc272feeae4c17762d3b150acd88e7) Thanks [@omasakun](https://github.com/omasakun)! - Fixed [#6933](https://github.com/biomejs/biome/issues/6933) and [#6994](https://github.com/biomejs/biome/issues/6994).
16+
17+
When the values of private member assignment expressions, increment expressions, etc. are used, those private members are no longer marked as unused.
18+
19+
- [#6887](https://github.com/biomejs/biome/pull/6887) [`0cc38f5`](https://github.com/biomejs/biome/commit/0cc38f59cd9ddf0fdcd12d6f8cb3642743cc4406) Thanks [@ptkagori](https://github.com/ptkagori)! - Added the [`noQwikUseVisibleTask`](https://biomejs.dev/linter/rules/no-qwik-use-visible-task) rule to Qwik.
20+
21+
This rule is intended for use in Qwik applications to warn about the use of `useVisibleTask$()` functions which require careful consideration before use.
22+
23+
**Invalid:**
24+
25+
```js
26+
useVisibleTask$(() => {
27+
console.log("Component is visible");
28+
});
29+
```
30+
31+
**Valid:**
32+
33+
```js
34+
useTask$(() => {
35+
console.log("Task executed");
36+
});
37+
```
38+
39+
- [#7084](https://github.com/biomejs/biome/pull/7084) [`50ca155`](https://github.com/biomejs/biome/commit/50ca1553f08348ab1e92dc7cf04013c85ff743a4) Thanks [@ematipico](https://github.com/ematipico)! - Added the new nursery rule `noUnnecessararyConditions`, which detects whenever some conditions don't
40+
change during the life cycle of the program, and truthy or false, hence deemed redundant.
41+
42+
For example, the following snippets will trigger the rule:
43+
44+
```js
45+
// Always truthy literal conditions
46+
if (true) {
47+
console.log("always runs");
48+
}
49+
```
50+
51+
```ts
52+
// Unnecessary condition on constrained string type
53+
function foo(arg: "bar" | "baz") {
54+
if (arg) {
55+
// This check is unnecessary
56+
}
57+
}
58+
```
59+
60+
- [#6887](https://github.com/biomejs/biome/pull/6887) [`0cc38f5`](https://github.com/biomejs/biome/commit/0cc38f59cd9ddf0fdcd12d6f8cb3642743cc4406) Thanks [@ptkagori](https://github.com/ptkagori)! - Added the [`useImageSize`](https://biomejs.dev/linter/rules/use-image-size) rule to Biome.
61+
62+
The `useImageSize` rule enforces the use of width and height attributes on `<img>` elements for performance reasons. This rule is intended to prevent layout shifts and improve Core Web Vitals by ensuring images have explicit dimensions.
63+
64+
**Invalid:**
65+
66+
```jsx
67+
<img src="/image.png" />
68+
<img src="https://example.com/image.png" />
69+
<img src="/image.png" width="200" />
70+
<img src="/image.png" height="200" />
71+
```
72+
73+
**Valid:**
74+
75+
```jsx
76+
<img width="200" height="600" src="/static/images/portrait-01.webp" />
77+
<img width="100" height="100" src="https://example.com/image.png" />
78+
```
79+
80+
- [#6887](https://github.com/biomejs/biome/pull/6887) [`0cc38f5`](https://github.com/biomejs/biome/commit/0cc38f59cd9ddf0fdcd12d6f8cb3642743cc4406) Thanks [@ptkagori](https://github.com/ptkagori)! - Added the [`useAnchorHref`](https://biomejs.dev/linter/rules/use-anchor-href) rule to Biome.
81+
82+
The `useAnchorHref` rule enforces the presence of an `href` attribute on `<a>` elements in JSX. This rule is intended to ensure that anchor elements are always valid and accessible.
83+
84+
**Invalid:**
85+
86+
```jsx
87+
<a>Link</a>
88+
```
89+
90+
```jsx
91+
<a target="_blank">External</a>
92+
```
93+
94+
**Valid:**
95+
96+
```jsx
97+
<a href="/home">Home</a>
98+
```
99+
100+
```jsx
101+
<a href="https://example.com" target="_blank">
102+
External
103+
</a>
104+
```
105+
106+
- [#7100](https://github.com/biomejs/biome/pull/7100) [`29fcb05`](https://github.com/biomejs/biome/commit/29fcb0540ed817d92a3f663132b658541706765b) Thanks [@Jayllyz](https://github.com/Jayllyz)! - Added the rule [`noNonNullAssertedOptionalChain`](https://biomejs.dev/linter/rules/no-non-null-asserted-optional-chain).
107+
108+
This rule prevents the use of non-null assertions (`!`) immediately after optional chaining expressions (`?.`). Optional chaining is designed to safely handle nullable values by returning `undefined` when the chain encounters `null` or `undefined`. Using a non-null assertion defeats this purpose and can lead to runtime errors.
109+
110+
```ts
111+
// Invalid - non-null assertion after optional chaining
112+
obj?.prop!;
113+
obj?.method()!;
114+
obj?.[key]!;
115+
obj?.prop!;
116+
117+
// Valid - proper optional chaining usage
118+
obj?.prop;
119+
obj?.method();
120+
obj?.prop ?? defaultValue;
121+
obj!.prop?.method();
122+
```
123+
124+
- [#7129](https://github.com/biomejs/biome/pull/7129) [`9f4538a`](https://github.com/biomejs/biome/commit/9f4538ab8bad8a974b8e408641b1fd4770d26c79) Thanks [@drwpow](https://github.com/drwpow)! - Removed option, combobox, listbox roles from [useSemanticElements](https://biomejs.dev/linter/rules/use-semantic-elements/) suggestions
125+
126+
- [#7106](https://github.com/biomejs/biome/pull/7106) [`236deaa`](https://github.com/biomejs/biome/commit/236deaadca077051f6e2ef01cfdbbc55cc1c3d78) Thanks [@arendjr](https://github.com/arendjr)! - Fixed [#6985](https://github.com/biomejs/biome/issues/6985): Inference of return types no longer mistakenly picks up return types of nested functions.
127+
128+
- [#7102](https://github.com/biomejs/biome/pull/7102) [`d3118c6`](https://github.com/biomejs/biome/commit/d3118c6ac3bba0ca29251fa7fc5ba36a9e4456b0) Thanks [@omasakun](https://github.com/omasakun)! - Fixed [#7101](https://github.com/biomejs/biome/issues/7101): [`noUnusedPrivateClassMembers`](https://biomejs.dev/linter/rules/no-unused-private-class-members/) now handles members declared as part of constructor arguments:
129+
1. If a class member defined in a constructor argument is only used within the constructor, it removes the `private` modifier and makes it a plain method argument.
130+
1. If it is not used at all, it will prefix it with an underscore, similar to `noUnusedFunctionParameter`.
131+
132+
- [#7104](https://github.com/biomejs/biome/pull/7104) [`5395297`](https://github.com/biomejs/biome/commit/53952972cd5786cfdcc3deda0c226d6488ef1aee) Thanks [@harxki](https://github.com/harxki)! - Reverting to prevent regressions around ref handling
133+
134+
- [#7143](https://github.com/biomejs/biome/pull/7143) [`1a6933a`](https://github.com/biomejs/biome/commit/1a6933aaf2c5b57d70a60d607b5cab68d532eeb4) Thanks [@siketyan](https://github.com/siketyan)! - Fixed [#6799](https://github.com/biomejs/biome/issues/6799): The [`noImportCycles`](https://biomejs.dev/linter/rules/no-import-cycles/) rule now ignores type-only imports if the new `ignoreTypes` option is enabled (enabled by default).
135+
136+
> [!WARNING]
137+
> **Breaking Change**: The `noImportCycles` rule no longer detects import cycles that include one or more type-only imports by default.
138+
> To keep the old behaviour, you can turn off the `ignoreTypes` option explicitly:
139+
>
140+
> ```json
141+
> {
142+
> "linter": {
143+
> "rules": {
144+
> "nursery": {
145+
> "noImportCycles": {
146+
> "options": {
147+
> "ignoreTypes": false
148+
> }
149+
> }
150+
> }
151+
> }
152+
> }
153+
> }
154+
> ```
155+
156+
- [#7099](https://github.com/biomejs/biome/pull/7099) [`6cc84cb`](https://github.com/biomejs/biome/commit/6cc84cb547480f83119d2cba5542e2d2afc65b4d) Thanks [@arendjr](https://github.com/arendjr)! - Fixed [#7062](https://github.com/biomejs/biome/issues/7062): Biome now correctly considers extended configs when determining the mode for the scanner.
157+
158+
- [#6887](https://github.com/biomejs/biome/pull/6887) [`0cc38f5`](https://github.com/biomejs/biome/commit/0cc38f59cd9ddf0fdcd12d6f8cb3642743cc4406) Thanks [@ptkagori](https://github.com/ptkagori)! - Added the [`useQwikClasslist`](https://biomejs.dev/linter/rules/use-qwik-classlist) rule to Biome.
159+
160+
This rule is intended for use in Qwik applications to encourage the use of the built-in `class` prop (which accepts a string, object, or array) instead of the `classnames` utility library.
161+
162+
**Invalid:**
163+
164+
```jsx
165+
<div class={classnames({ active: true, disabled: false })} />
166+
```
167+
168+
**Valid:**
169+
170+
```jsx
171+
<div classlist={{ active: true, disabled: false }} />
172+
```
173+
174+
- [#7019](https://github.com/biomejs/biome/pull/7019) [`57c15e6`](https://github.com/biomejs/biome/commit/57c15e6df5b6257ffb9f69d7614c3455a1f5c870) Thanks [@fireairforce](https://github.com/fireairforce)! - Added support in the JS parser for `import source`(a [stage3 proposal](https://github.com/tc39/proposal-source-phase-imports)). The syntax looks like:
175+
176+
```ts
177+
import source foo from "<specifier>";
178+
```
179+
180+
- [#7053](https://github.com/biomejs/biome/pull/7053) [`655049e`](https://github.com/biomejs/biome/commit/655049e9e38f536b33fff6d7b160299f0b446908) Thanks [@jakeleventhal](https://github.com/jakeleventhal)! - Added the [`useConsistentTypeDefinitions`](https://biomejs.dev/rules/use-consistent-type-definitions) rule.
181+
182+
This rule enforces consistent usage of either `interface` or `type` for object type definitions in TypeScript.
183+
184+
The rule accepts an option to specify the preferred style:
185+
- `interface` (default): Prefer using `interface` for object type definitions
186+
- `type`: Prefer using `type` for object type definitions
187+
188+
Examples:
189+
190+
```ts
191+
// With default option (interface)
192+
// ❌ Invalid
193+
type Point = { x: number; y: number };
194+
195+
// ✅ Valid
196+
interface Point {
197+
x: number;
198+
y: number;
199+
}
200+
201+
// With option { style: "type" }
202+
// ❌ Invalid
203+
interface Point {
204+
x: number;
205+
y: number;
206+
}
207+
208+
// ✅ Valid
209+
type Point = { x: number; y: number };
210+
```
211+
212+
The rule will automatically fix simple cases where conversion is straightforward.
213+
9214
## 2.1.3
10215

11216
### Patch Changes
12217

13218
- [#7057](https://github.com/biomejs/biome/pull/7057) [`634a667`](https://github.com/biomejs/biome/commit/634a667ac8e9f74a4633895eab4bd4695ffffa1d) Thanks [@mdevils](https://github.com/mdevils)! - Added the rule [`noVueReservedKeys`](https://biomejs.dev/linter/rules/no-vue-reserved-keys/), which prevents the use of reserved Vue keys.
14219

15-
It prevents the use of Vue reserved keys such as those starting with `# @biomejs/biome (like `$el`, `$data`, `$props`) and keys starting with `\_` in data properties, which can cause conflicts and unexpected behavior in Vue components.
220+
It prevents the use of Vue reserved keys such as those starting with like `$el`, `$data`, `$props`) and keys starting with `\_` in data properties, which can cause conflicts and unexpected behavior in Vue components.
16221

17222
##### Invalid example
18223

0 commit comments

Comments
 (0)