Skip to content

Commit a3840ac

Browse files
authored
Merge pull request #7167 from biomejs/next
2 parents 2afaa49 + a78e878 commit a3840ac

File tree

898 files changed

+19115
-9960
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

898 files changed

+19115
-9960
lines changed

.changeset/better-adults-roll.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
"@biomejs/biome": minor
3+
---
4+
5+
The `noRestrictedImports` rule has been enhanced with a new `patterns` option. This option allows for more flexible and powerful import restrictions using gitignore-style patterns.
6+
7+
You can now define patterns to restrict entire groups of modules. For example, you can disallow imports from any path under `import-foo/` except for `import-foo/baz`.
8+
9+
```json
10+
{
11+
"options": {
12+
"patterns": [
13+
{
14+
"group": ["import-foo/*", "!import-foo/baz"],
15+
"message": "import-foo is deprecated, except for modules in import-foo/baz."
16+
}
17+
]
18+
}
19+
}
20+
```
21+
22+
**Invalid examples**
23+
```js
24+
import foo from 'import-foo/foo';
25+
import bar from 'import-foo/bar';
26+
```
27+
28+
**Valid examples**
29+
```js
30+
import baz from 'import-foo/baz';
31+
```
32+
33+
Additionally, the `patterns` option introduces `importNamePattern` to restrict specific import names using regular expressions.
34+
The following example restricts the import names that match `x` , `y` or `z` letters from modules under `import-foo/`.
35+
```json
36+
{
37+
"options": {
38+
"patterns": [
39+
{
40+
"group": ["import-foo/*"],
41+
"importNamePattern": "[xyz]"
42+
}
43+
]
44+
}
45+
}
46+
```
47+
**Invalid examples**
48+
```js
49+
import { x } from 'import-foo/foo';
50+
```
51+
52+
**Valid examples**
53+
```js
54+
import { foo } from 'import-foo/foo';
55+
```
56+
57+
Furthermore, you can use the `invertImportNamePattern` boolean option to reverse this logic. When set to true, only the import names that match the `importNamePattern` will be allowed. The following configuration only allows the import names that match `x` , `y` or `z` letters from modules under `import-foo/`.
58+
```json
59+
{
60+
"options": {
61+
"patterns": [
62+
{
63+
"group": ["import-foo/*"],
64+
"importNamePattern": "[xyz]",
65+
"invertImportNamePattern": true
66+
}
67+
]
68+
}
69+
}
70+
```
71+
**Invalid examples**
72+
```js
73+
import { foo } from 'import-foo/foo';
74+
```
75+
76+
**Valid examples**
77+
```js
78+
import { x } from 'import-foo/foo';
79+
```

.changeset/brave-trees-push.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
"@biomejs/biome": patch
3+
---
4+
5+
Added a new **experimental option** that allows parsing of `.html` files that contain interpolation syntax.
6+
7+
```json5
8+
// biome.json
9+
{
10+
"html": {
11+
// This is the new, experimental option.
12+
"parser": {
13+
"interpolation": true
14+
}
15+
}
16+
}
17+
```
18+
19+
```html
20+
<h1>{{ $title }}</h1>
21+
```

.changeset/fancy-trains-happen.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
"@biomejs/biome": minor
3+
---
4+
5+
Allow customization of the sort order for different sorting actions. These actions now support a sort option:
6+
7+
- [`assist/source/useSortedKeys`](https://biomejs.dev/assist/actions/use-sorted-keys/) now has a `sortOrder` option
8+
- [`assist/source/useSortedAttributes`](https://biomejs.dev/assist/actions/use-sorted-attributes/) now has a `sortOrder` option
9+
- [`assist/source/organizeImports`](https://biomejs.dev/assist/actions/organize-imports/) now has an `identifierOrder` option
10+
11+
For each of these options, the supported values are the same:
12+
13+
1. **`natural`**. Compares two strings using a natural ASCII order. Uppercase letters come first (e.g. `A` < `a` < `B` < `b`) and number are compared in a human way (e.g. `9` < `10`). This is the default value.
14+
2. **`lexicographic`**. Strings are ordered lexicographically by their byte values. This orders Unicode code points based on their positions in the code charts. This is not necessarily the same as “alphabetical” order, which varies by language and locale.

.changeset/floppy-sloths-visit.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
"@biomejs/biome": minor
3+
---
4+
5+
Added the new rule `useBiomeIgnoreFolder`. Since v2.2, Biome correctly prevents the indexing and crawling of folders.
6+
7+
However, the correct pattern has changed. This rule attempts to detect incorrect usage, and promote the new pattern:
8+
9+
```diff
10+
// biome.json
11+
{
12+
"files": {
13+
"includes": [
14+
- "!dist/**",
15+
- "!**/fixtures/**",
16+
+ "!dist",
17+
+ "!**/fixtures",
18+
]
19+
}
20+
}
21+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@biomejs/biome": minor
3+
---
4+
5+
Fixed minor inconsistencies in how `files.includes` was being handled.
6+
7+
Previously, Biome sometimes failed to properly ignore the contents of a folder if you didn't specify the `/**` at the end of a glob pattern. This was unfortunate, because it meant we still had to traverse the folder and then apply the glob to every entry inside it.
8+
9+
This is no longer an issue and we now recommend to ignore folders without using the `/**` suffix.

.changeset/legal-mugs-care.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@biomejs/biome": minor
3+
---
4+
5+
Added support for `.graphqls` files. Biome can now format and lint GraphQL files that have the extension `.graphqls`

.changeset/mighty-seals-dance.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
"@biomejs/biome": minor
3+
---
4+
5+
Added a new option to Biome's JavaScript formatter, `javascript.formatter.operatorLinebreak`, to configure whether long lines should be broken before or after binary operators.
6+
7+
For example, the following configuration:
8+
9+
```json
10+
{
11+
"formatter": {
12+
"javascript": {
13+
"operatorLinebreak": "before" // defaults to "after"
14+
}
15+
}
16+
}
17+
```
18+
19+
Will cause this JavaScript file:
20+
21+
```js
22+
const VERY_LONG_CONDITION_1234123412341234123412341234 = false;
23+
24+
if (VERY_LONG_CONDITION_1234123412341234123412341234 && VERY_LONG_CONDITION_1234123412341234123412341234 && VERY_LONG_CONDITION_1234123412341234123412341234 && VERY_LONG_CONDITION_1234123412341234123412341234) {
25+
console.log("DONE")
26+
}
27+
```
28+
29+
to be formatted like this:
30+
31+
```js
32+
const VERY_LONG_CONDITION_1234123412341234123412341234 = false;
33+
if (
34+
VERY_LONG_CONDITION_1234123412341234123412341234
35+
&& VERY_LONG_CONDITION_1234123412341234123412341234
36+
&& VERY_LONG_CONDITION_1234123412341234123412341234
37+
&& VERY_LONG_CONDITION_1234123412341234123412341234
38+
) {
39+
console.log("DONE")
40+
}
41+
```
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
"@biomejs/biome": minor
3+
---
4+
5+
Promoted multiple lint rules from nursery to stable groups and renamed several rules for consistency.
6+
7+
#### Promoted rules
8+
9+
The following rules have been promoted from nursery to stable groups:
10+
11+
##### CSS
12+
13+
- Promoted [`noImportantStyles`](https://biomejs.dev/linter/rules/no-important-styles) to the `complexity` group.
14+
- Promoted [`noUnknownAtRules`](https://biomejs.dev/linter/rules/no-unknown-at-rules) to the `suspicious` group.
15+
##### GraphQL
16+
17+
- Promoted [`useGraphqlNamedOperations`](https://biomejs.dev/linter/rules/use-graphql-named-operations) to the `correctness` group.
18+
- Promoted [`useGraphqlNamingConvention`](https://biomejs.dev/linter/rules/use-graphql-naming-convention) to the `style` group.
19+
##### JavaScript/TypeScript
20+
21+
- Promoted [`noExcessiveLinesPerFunction`](https://biomejs.dev/linter/rules/no-excessive-lines-per-function) to the `complexity` group.
22+
- Promoted [`noImplicitCoercions`](https://biomejs.dev/linter/rules/no-implicit-coercions) to the `complexity` group.
23+
- Promoted [`useIndexOf`](https://biomejs.dev/linter/rules/use-index-of) to the `complexity` group.
24+
- Promoted [`noGlobalDirnameFilename`](https://biomejs.dev/linter/rules/no-global-dirname-filename) to the `correctness` group.
25+
- Promoted [`noNestedComponentDefinitions`](https://biomejs.dev/linter/rules/no-nested-component-definitions) to the `correctness` group.
26+
- Promoted [`noProcessGlobal`](https://biomejs.dev/linter/rules/no-process-global) to the `correctness` group.
27+
- Promoted [`noReactPropAssignments`](https://biomejs.dev/linter/rules/no-react-prop-assignments) to the `correctness` group.
28+
- Promoted [`noRestrictedElements`](https://biomejs.dev/linter/rules/no-restricted-elements) to the `correctness` group.
29+
- Promoted [`noSolidDestructuredProps`](https://biomejs.dev/linter/rules/no-solid-destructured-props) to the `correctness` group.
30+
- Promoted [`useJsonImportAttributes`](https://biomejs.dev/linter/rules/use-json-import-attributes) to the `correctness` group.
31+
- Promoted [`useParseIntRadix`](https://biomejs.dev/linter/rules/use-parse-int-radix) to the `correctness` group.
32+
- Promoted [`useSingleJsDocAsterisk`](https://biomejs.dev/linter/rules/use-single-js-doc-asterisk) to the `correctness` group.
33+
- Promoted [`useUniqueElementIds`](https://biomejs.dev/linter/rules/use-unique-element-ids) to the `correctness` group.
34+
- Promoted [`noAwaitInLoops`](https://biomejs.dev/linter/rules/no-await-in-loops) to the `performance` group.
35+
- Promoted [`noUnwantedPolyfillio`](https://biomejs.dev/linter/rules/no-unwanted-polyfillio) to the `performance` group.
36+
- Promoted [`useGoogleFontPreconnect`](https://biomejs.dev/linter/rules/use-google-font-preconnect) to the `performance` group.
37+
- Promoted [`useSolidForComponent`](https://biomejs.dev/linter/rules/use-solid-for-component) to the `performance` group.
38+
- Promoted [`noMagicNumbers`](https://biomejs.dev/linter/rules/no-magic-numbers) to the `style` group.
39+
- Promoted [`useConsistentObjectDefinitions`](https://biomejs.dev/linter/rules/use-consistent-object-definitions) to the `style` group.
40+
- Promoted [`useExportsLast`](https://biomejs.dev/linter/rules/use-exports-last) to the `style` group.
41+
- Promoted [`useGroupedAccessorPairs`](https://biomejs.dev/linter/rules/use-grouped-accessor-pairs) to the `style` group.
42+
- Promoted [`useNumericSeparators`](https://biomejs.dev/linter/rules/use-numeric-separators) to the `style` group.
43+
- Promoted [`useObjectSpread`](https://biomejs.dev/linter/rules/use-object-spread) to the `style` group.
44+
- Promoted [`useReadonlyClassProperties`](https://biomejs.dev/linter/rules/use-readonly-class-properties) to the `style` group.
45+
- Promoted [`useSymbolDescription`](https://biomejs.dev/linter/rules/use-symbol-description) to the `style` group.
46+
- Promoted [`useUnifiedTypeSignatures`](https://biomejs.dev/linter/rules/use-unified-type-signatures) to the `style` group.
47+
- Promoted [`noBitwiseOperators`](https://biomejs.dev/linter/rules/no-bitwise-operators) to the `suspicious` group.
48+
- Promoted [`noConstantBinaryExpressions`](https://biomejs.dev/linter/rules/no-constant-binary-expressions) to the `suspicious` group.
49+
- Promoted [`noTsIgnore`](https://biomejs.dev/linter/rules/no-ts-ignore) to the `suspicious` group.
50+
- Promoted [`noUnassignedVariables`](https://biomejs.dev/linter/rules/no-unassigned-variables) to the `suspicious` group.
51+
- Promoted [`noUselessRegexBackrefs`](https://biomejs.dev/linter/rules/no-useless-regex-backrefs) to the `suspicious` group.
52+
- Promoted [`noUselessStringEscapes`](https://biomejs.dev/linter/rules/no-useless-string-escapes) to the `suspicious` group.
53+
- Promoted [`useConsistentIterableCallbackReturnValues`](https://biomejs.dev/linter/rules/use-consistent-iterable-callback-return-values) to the `suspicious` group.
54+
- Promoted [`useStaticResponseMethods`](https://biomejs.dev/linter/rules/use-static-response-methods) to the `suspicious` group.
55+
56+
#### Renamed rules
57+
58+
The following rules have been renamed during promotion. The migration tool will automatically update your configuration:
59+
60+
- Renamed `noAwaitInLoop` to [`noAwaitInLoops`](https://biomejs.dev/linter/rules/no-await-in-loops).
61+
- Renamed `noConstantBinaryExpression` to [`noConstantBinaryExpressions`](https://biomejs.dev/linter/rules/no-constant-binary-expressions).
62+
- Renamed `noDestructuredProps` to [`noSolidDestructuredProps`](https://biomejs.dev/linter/rules/no-solid-destructured-props).
63+
- Renamed `noImplicitCoercion` to [`noImplicitCoercions`](https://biomejs.dev/linter/rules/no-implicit-coercions).
64+
- Renamed `noReactPropAssign` to [`noReactPropAssignments`](https://biomejs.dev/linter/rules/no-react-prop-assignments).
65+
- Renamed `noUnknownAtRule` to [`noUnknownAtRules`](https://biomejs.dev/linter/rules/no-unknown-at-rules).
66+
- Renamed `noUselessBackrefInRegex` to [`noUselessRegexBackrefs`](https://biomejs.dev/linter/rules/no-useless-regex-backrefs).
67+
- Renamed `useAdjacentGetterSetter` to [`useGroupedAccessorPairs`](https://biomejs.dev/linter/rules/use-grouped-accessor-pairs).
68+
- Renamed `useConsistentObjectDefinition` to [`useConsistentObjectDefinitions`](https://biomejs.dev/linter/rules/use-consistent-object-definitions).
69+
- Renamed `useConsistentResponse` to [`useStaticResponseMethods`](https://biomejs.dev/linter/rules/use-static-response-methods).
70+
- Renamed `useForComponent` to [`useSolidForComponent`](https://biomejs.dev/linter/rules/use-solid-for-component).
71+
- Renamed `useJsonImportAttribute` to [`useJsonImportAttributes`](https://biomejs.dev/linter/rules/use-json-import-attributes).
72+
- Renamed `useNamedOperation` to [`useGraphqlNamedOperations`](https://biomejs.dev/linter/rules/use-graphql-named-operations).
73+
- Renamed `useNamingConvention` to [`useGraphqlNamingConvention`](https://biomejs.dev/linter/rules/use-graphql-naming-convention).
74+
- Renamed `useUnifiedTypeSignature` to [`useUnifiedTypeSignatures`](https://biomejs.dev/linter/rules/use-unified-type-signatures).
75+
76+
Configuration files using the old rule names will need to be updated. Use the migration tool to automatically update your configuration:
77+
78+
```bash
79+
biome migrate --write
80+
```

.changeset/proud-olives-exist.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
"@biomejs/biome": minor
3+
---
4+
5+
Added the new rule `noBiomeFirstException`. This rule prevents the incorrect usage of patterns inside `files.includes`.
6+
7+
This rule catches if the first element of the array contains `!`. This mistake will cause Biome to analyze no files:
8+
9+
```json5
10+
// biome.json
11+
{
12+
"files": {
13+
"includes": ["!dist/**"] // this is an error
14+
}
15+
}
16+
```

.changeset/ripe-eyes-fix.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@biomejs/biome": minor
3+
---
4+
5+
Added Qwik Domain to Biome
6+
7+
This release introduces **Qwik domain support** in Biome, enabling Qwik developers to use Biome as a linter and formatter for their projects.
8+
9+
- Added the Qwik domain infrastructure to Biome.
10+
- Enabled the following rules for Qwik:
11+
- [`useJsxKeyInIterable`](https://biomejs.dev/linter/rules/use-jsx-key-in-iterable)
12+
- [`noReactSpecificProps`](https://biomejs.dev/linter/rules/no-react-specific-props)

0 commit comments

Comments
 (0)