diff --git a/CHANGELOG.md b/CHANGELOG.md index c119249d6fbd..6845459b1f73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ Read our [guidelines to categorize a change](https://biomejs.dev/internals/versi New entries must be placed in a section entitled `Unreleased`. Read our [guidelines for writing a good changelog entry](https://github.com/biomejs/biome/blob/main/CONTRIBUTING.md#changelog). -## Unreleased +## 1.5.0 Biome now scores 97% compatibility with Prettier and features more than 180 linter rules. @@ -22,9 +22,15 @@ Biome now scores 97% compatibility with Prettier and features more than 180 lint - The command `biome migrate` now updates the `$schema` if there's an outdated version. -- The commands `format`, `lint`, `check` and `ci` now accepts two new arguments: `--changed` and `--since`. - Use these options when the VCS integration is enabled to process only the files that were changed. - Contributed by @simonxabris +- The CLI now takes in consideration the `.gitignore` in the home directory of the user, if it exists. Contributed by @ematipico +- The `biome ci` command is now able to print [GitHub Workflow Commands](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions) when there are diagnostics in our code. Contributed by @nikeee + This will **might** require setting the proper permissions on your GitHub action: + ```yaml + permissions: + pull-requests: write + ``` +- The commands `format`, `lint`, `check` and `ci` now accepts two new arguments: `--changed` and `--since`. Use these options when the VCS integration + is enabled to process only the files that were changed. Contributed by @simonxabris ```shell biome format --write --changed @@ -69,7 +75,7 @@ Biome now scores 97% compatibility with Prettier and features more than 180 lint "files": { "ignore": [ "node_modules/**", - "!**/dist/**" // this is now accepted and allow list files inside the `dist` folder + "!**/dist/**" // this is now accepted and allow files inside the `dist` folder ] } } @@ -88,6 +94,22 @@ Biome now scores 97% compatibility with Prettier and features more than 180 lint #### Bug fixes - Fix [#1169](https://github.com/biomejs/biome/issues/1169). Account for escaped strings when computing layout for assignments. Contributed by @kalleep +- Fix [#851](https://github.com/biomejs/biome/issues/851). Allow regular function expressions to group and break as call arguments, just like arrow function expressions. [#1003](https://github.com/biomejs/biome/issues/1003) Contributed by @faultyserver +- Fix [#914](https://github.com/biomejs/biome/issues/914). Only parenthesize type-casted function expressions as default exports. [#1023](https://github.com/biomejs/biome/issues/1023) Contributed by @faultyserver +- Fix [#1112](https://github.com/biomejs/biome/issues/1112). Break block bodies in case clauses onto their own lines and preserve trailing fallthrough comments. [#1035](https://github.com/biomejs/biome/pull/1035) Contributed by @faultyserver +- Fix `RemoveSoftLinesBuffer` behavior to also removed conditional expanded content, ensuring no accidental, unused line breaks are included [#1032](https://github.com/biomejs/biome/pull/1032) Contributed by @faultyserver +- Fix [#1024](https://github.com/biomejs/biome/issues/1024). Allow JSX expressions to nestle in arrow chains [#1033](https://github.com/biomejs/biome/pull/1033) Contributed by @faultyserver +- Fix incorrect breaking on the left side of assignments by always using fluid assignment. [#1021](https://github.com/biomejs/biome/pull/1021) Contributed by @faultyserver +- Fix breaking strategy for nested object patterns in function parameters [#1054](https://github.com/biomejs/biome/pull/1054) Contributed by @faultyserver +- Fix over-indention of arrow chain expressions by simplifying the way each chain is grouped [#1036](https://github.com/biomejs/biome/pull/1036), [#1136](https://github.com/biomejs/biome/pull/1136), and [#1162](https://github.com/biomejs/biome/pull/1162) Contributed by @faultyserver. +- Fix "simple" checks for calls and member expressions to correctly handle array accesses, complex arguments to single-argument function calls, and multiple-argument function calls. [#1057](https://github.com/biomejs/biome/pull/1057) Contributed by @faultyserver +- Fix text wrapping and empty line handling for JSX Text elements to match Prettier's behavior. [#1075](https://github.com/biomejs/biome/pull/1075) Contributed by @faultyserver +- Fix leading comments in concisely-printed arrays to prevent unwanted line breaks. [#1135](https://github.com/biomejs/biome/pull/1135) Contributed by @faultyserver +- Fix `best_fitting` and interned elements preventing expansion propagation from sibling elements. [#1141](https://github.com/biomejs/biome/pull/1141) Contributed by @faultyserver +- Fix heuristic for grouping function parameters when type parameters with constraints are present. [#1153](https://github.com/biomejs/biome/pull/1153). Contributed by @faultyserver. +- Fix binary-ish and type annotation handling for grouping call arguments in function expressions and call signatures. [#1152](https://github.com/biomejs/biome/pull/1152) and [#1160](https://github.com/biomejs/biome/pull/1160) Contributed by @faultyserver +- Fix handling of nestled JSDoc comments to preserve behavior for overloads. [#1195](https://github.com/biomejs/biome/pull/1195) Contributed by @faultyserver +- Fix [#1208](https://github.com/biomejs/biome/issues/1208). Fix extraction of inner types when checking for simple type annotations in call arguments. [#1195](https://github.com/biomejs/biome/pull/1195) Contributed by @faultyserver - Fix [#1220](https://github.com/biomejs/biome/issues/1220). Avoid duplicating comments in type unions for mapped, empty object, and empty tuple types. [#1240](https://github.com/biomejs/biome/pull/1240) Contributed by @faultyserver diff --git a/crates/biome_js_parser/src/syntax/stmt.rs b/crates/biome_js_parser/src/syntax/stmt.rs index e6575173f928..86b2e18485d5 100644 --- a/crates/biome_js_parser/src/syntax/stmt.rs +++ b/crates/biome_js_parser/src/syntax/stmt.rs @@ -1472,22 +1472,22 @@ fn parse_variable_declarator( ) { let err = p - .err_builder("Object and Array patterns require initializers", id_range) + .err_builder("Object and Array patterns require initializers.", id_range) .with_hint( - "this pattern is declared, but it is not given an initialized value", + "This pattern is declared, but it is not given an initialized value.", ); p.error(err); } else if initializer.is_none() && context.is_const() && !p.state().in_ambient_context() { let err = p - .err_builder("Const declarations must have an initialized value", id_range) - .with_hint( "this variable needs to be initialized"); + .err_builder("Const declarations must have an initialized value.", id_range) + .with_hint( "This variable needs to be initialized."); p.error(err); } else if initializer.is_none() && context.is_using() { let err = p - .err_builder("Using declarations must have an initialized value", id_range) - .with_hint( "this variable needs to be initialized"); + .err_builder("Using declarations must have an initialized value.", id_range) + .with_hint( "This variable needs to be initialized."); p.error(err); } diff --git a/crates/biome_js_parser/test_data/inline/err/array_binding_err.rast b/crates/biome_js_parser/test_data/inline/err/array_binding_err.rast index 6a72d4a5bc98..8824f582df9a 100644 --- a/crates/biome_js_parser/test_data/inline/err/array_binding_err.rast +++ b/crates/biome_js_parser/test_data/inline/err/array_binding_err.rast @@ -344,7 +344,7 @@ array_binding_err.js:4:15 parse ━━━━━━━━━━━━━━━━ -- array_binding_err.js:4:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Object and Array patterns require initializers + × Object and Array patterns require initializers. 2 │ let [="default"] = [1, 2]; 3 │ let ["default"] = [1, 2]; @@ -352,7 +352,7 @@ array_binding_err.js:4:5 parse ━━━━━━━━━━━━━━━━ │ ^^^^^^^^^^ 5 │ - i this pattern is declared, but it is not given an initialized value + i This pattern is declared, but it is not given an initialized value. -- let [a b] = [1, 2]; diff --git a/crates/biome_js_parser/test_data/inline/err/export_variable_clause_error.rast b/crates/biome_js_parser/test_data/inline/err/export_variable_clause_error.rast index be55fe7a3d09..1459909572f4 100644 --- a/crates/biome_js_parser/test_data/inline/err/export_variable_clause_error.rast +++ b/crates/biome_js_parser/test_data/inline/err/export_variable_clause_error.rast @@ -154,7 +154,7 @@ export_variable_clause_error.js:1:16 parse ━━━━━━━━━━━━ -- export_variable_clause_error.js:2:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Const declarations must have an initialized value + × Const declarations must have an initialized value. 1 │ export let a = ; > 2 │ export const b; @@ -162,7 +162,7 @@ export_variable_clause_error.js:2:14 parse ━━━━━━━━━━━━ 3 │ export let d, c; 4 │ - i this variable needs to be initialized + i This variable needs to be initialized. -- export let a = ; diff --git a/crates/biome_js_parser/test_data/inline/err/for_stmt_err.rast b/crates/biome_js_parser/test_data/inline/err/for_stmt_err.rast index 784711d0f720..bc0ba28a6527 100644 --- a/crates/biome_js_parser/test_data/inline/err/for_stmt_err.rast +++ b/crates/biome_js_parser/test_data/inline/err/for_stmt_err.rast @@ -652,7 +652,7 @@ for_stmt_err.js:7:5 parse ━━━━━━━━━━━━━━━━━━ -- for_stmt_err.js:8:10 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Object and Array patterns require initializers + × Object and Array patterns require initializers. 6 │ for await (let a in []) {} 7 │ for await (let i = 0; i < 10; ++i) {} @@ -660,7 +660,7 @@ for_stmt_err.js:8:10 parse ━━━━━━━━━━━━━━━━━ │ ^^^ 9 │ - i this pattern is declared, but it is not given an initialized value + i This pattern is declared, but it is not given an initialized value. -- for ;; {} diff --git a/crates/biome_js_parser/test_data/inline/err/invalid_using_declarations_inside_for_statement.rast b/crates/biome_js_parser/test_data/inline/err/invalid_using_declarations_inside_for_statement.rast index 19200d33970c..8f5a5bc48d8d 100644 --- a/crates/biome_js_parser/test_data/inline/err/invalid_using_declarations_inside_for_statement.rast +++ b/crates/biome_js_parser/test_data/inline/err/invalid_using_declarations_inside_for_statement.rast @@ -132,14 +132,14 @@ JsModule { -- invalid_using_declarations_inside_for_statement.js:1:18 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Using declarations must have an initialized value + × Using declarations must have an initialized value. > 1 │ for (await using of x) {}; │ ^^ 2 │ for await (await using of x) {}; 3 │ - i this variable needs to be initialized + i This variable needs to be initialized. -- invalid_using_declarations_inside_for_statement.js:1:21 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -168,14 +168,14 @@ invalid_using_declarations_inside_for_statement.js:1:22 parse ━━━━━━ -- invalid_using_declarations_inside_for_statement.js:2:24 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Using declarations must have an initialized value + × Using declarations must have an initialized value. 1 │ for (await using of x) {}; > 2 │ for await (await using of x) {}; │ ^^ 3 │ - i this variable needs to be initialized + i This variable needs to be initialized. -- invalid_using_declarations_inside_for_statement.js:2:27 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/biome_js_parser/test_data/inline/err/object_binding_pattern.rast b/crates/biome_js_parser/test_data/inline/err/object_binding_pattern.rast index 4fb0c0c4229e..bcbe6a5b65de 100644 --- a/crates/biome_js_parser/test_data/inline/err/object_binding_pattern.rast +++ b/crates/biome_js_parser/test_data/inline/err/object_binding_pattern.rast @@ -354,14 +354,14 @@ object_binding_pattern.js:1:9 parse ━━━━━━━━━━━━━━ -- object_binding_pattern.js:1:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Object and Array patterns require initializers + × Object and Array patterns require initializers. > 1 │ let { 5 } } = { eval: "foo" }; │ ^^^^^ 2 │ let { eval } = { eval: "foo" }; 3 │ let { 5, 6 } = { eval: "foo" }; - i this pattern is declared, but it is not given an initialized value + i This pattern is declared, but it is not given an initialized value. -- object_binding_pattern.js:1:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/biome_js_parser/test_data/inline/err/using_declaration_statement_err.rast b/crates/biome_js_parser/test_data/inline/err/using_declaration_statement_err.rast index 7a7656a2fa0d..402913d30174 100644 --- a/crates/biome_js_parser/test_data/inline/err/using_declaration_statement_err.rast +++ b/crates/biome_js_parser/test_data/inline/err/using_declaration_statement_err.rast @@ -441,14 +441,14 @@ JsModule { -- using_declaration_statement_err.js:1:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Using declarations must have an initialized value + × Using declarations must have an initialized value. > 1 │ using a; │ ^ 2 │ using {b}; 3 │ using c = d, e; - i this variable needs to be initialized + i This variable needs to be initialized. -- using_declaration_statement_err.js:2:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -480,7 +480,7 @@ using_declaration_statement_err.js:2:7 parse ━━━━━━━━━━━ -- using_declaration_statement_err.js:3:14 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Using declarations must have an initialized value + × Using declarations must have an initialized value. 1 │ using a; 2 │ using {b}; @@ -489,7 +489,7 @@ using_declaration_statement_err.js:3:14 parse ━━━━━━━━━━━ 4 │ export using m = n; 5 │ await using f; - i this variable needs to be initialized + i This variable needs to be initialized. -- using_declaration_statement_err.js:4:8 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -515,7 +515,7 @@ using_declaration_statement_err.js:4:8 parse ━━━━━━━━━━━ -- using_declaration_statement_err.js:5:13 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Using declarations must have an initialized value + × Using declarations must have an initialized value. 3 │ using c = d, e; 4 │ export using m = n; @@ -524,12 +524,12 @@ using_declaration_statement_err.js:5:13 parse ━━━━━━━━━━━ 6 │ await using g = h, j; 7 │ await using [o] = p; - i this variable needs to be initialized + i This variable needs to be initialized. -- using_declaration_statement_err.js:6:20 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Using declarations must have an initialized value + × Using declarations must have an initialized value. 4 │ export using m = n; 5 │ await using f; @@ -538,7 +538,7 @@ using_declaration_statement_err.js:6:20 parse ━━━━━━━━━━━ 7 │ await using [o] = p; 8 │ export await using q = r; - i this variable needs to be initialized + i This variable needs to be initialized. -- using_declaration_statement_err.js:7:1 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ diff --git a/crates/biome_js_parser/test_data/inline/err/variable_declaration_statement_err.rast b/crates/biome_js_parser/test_data/inline/err/variable_declaration_statement_err.rast index a2e77866f214..06479a5df0c6 100644 --- a/crates/biome_js_parser/test_data/inline/err/variable_declaration_statement_err.rast +++ b/crates/biome_js_parser/test_data/inline/err/variable_declaration_statement_err.rast @@ -298,7 +298,7 @@ JsModule { -- variable_declaration_statement_err.js:3:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Const declarations must have an initialized value + × Const declarations must have an initialized value. 1 │ let a, { b } = { a: 10 } 2 │ const c = 1, { d } = { a: 10 } @@ -307,12 +307,12 @@ variable_declaration_statement_err.js:3:7 parse ━━━━━━━━━━ 4 │ let [f]; 5 │ const { g }; - i this variable needs to be initialized + i This variable needs to be initialized. -- variable_declaration_statement_err.js:4:5 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Object and Array patterns require initializers + × Object and Array patterns require initializers. 2 │ const c = 1, { d } = { a: 10 } 3 │ const e; @@ -321,12 +321,12 @@ variable_declaration_statement_err.js:4:5 parse ━━━━━━━━━━ 5 │ const { g }; 6 │ - i this pattern is declared, but it is not given an initialized value + i This pattern is declared, but it is not given an initialized value. -- variable_declaration_statement_err.js:5:7 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ - × Object and Array patterns require initializers + × Object and Array patterns require initializers. 3 │ const e; 4 │ let [f]; @@ -334,7 +334,7 @@ variable_declaration_statement_err.js:5:7 parse ━━━━━━━━━━ │ ^^^^^ 6 │ - i this pattern is declared, but it is not given an initialized value + i This pattern is declared, but it is not given an initialized value. -- let a, { b } = { a: 10 } diff --git a/packages/@biomejs/biome/package.json b/packages/@biomejs/biome/package.json index befb50e021ef..ab8ca31cac1d 100644 --- a/packages/@biomejs/biome/package.json +++ b/packages/@biomejs/biome/package.json @@ -1,6 +1,6 @@ { "name": "@biomejs/biome", - "version": "1.4.1", + "version": "1.5.0", "bin": "bin/biome", "scripts": { "postinstall": "node scripts/postinstall.js" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c0e9807edd66..6eaf62c80442 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -50,6 +50,10 @@ importers: specifier: ^0.22.0 version: 0.22.0 + packages/@biomejs/wasm-nodejs: {} + + packages/@biomejs/wasm-web: {} + website: dependencies: astro: diff --git a/website/astro.config.ts b/website/astro.config.ts index 0ef5c6313ff5..2c50839662af 100644 --- a/website/astro.config.ts +++ b/website/astro.config.ts @@ -135,6 +135,10 @@ export default defineConfig({ "pt-BR": "Integrando o Biome no seu editor", }, }, + { + label: "Integrate Biome with your VCS", + link: "/guides/integrate-in-vcs", + }, ], }, { diff --git a/website/src/assets/blog/roadmap-2024/banner-dark.png b/website/src/assets/blog/roadmap-2024/banner-dark.png new file mode 100644 index 000000000000..07cd9b926248 Binary files /dev/null and b/website/src/assets/blog/roadmap-2024/banner-dark.png differ diff --git a/website/src/assets/blog/roadmap-2024/banner-light.png b/website/src/assets/blog/roadmap-2024/banner-light.png new file mode 100644 index 000000000000..dd47c32e211d Binary files /dev/null and b/website/src/assets/blog/roadmap-2024/banner-light.png differ diff --git a/website/src/assets/blog/roadmap-2024/github-annotation.png b/website/src/assets/blog/roadmap-2024/github-annotation.png new file mode 100644 index 000000000000..fc42c77231a2 Binary files /dev/null and b/website/src/assets/blog/roadmap-2024/github-annotation.png differ diff --git a/website/src/assets/old-social-logo.png b/website/src/assets/old-social-logo.png index 7be42507dbe4..07cd9b926248 100644 Binary files a/website/src/assets/old-social-logo.png and b/website/src/assets/old-social-logo.png differ diff --git a/website/src/content/blog/annoucing-biome.mdx b/website/src/content/blog/annoucing-biome.mdx index 96a69c723be1..1a0e321a7538 100644 --- a/website/src/content/blog/annoucing-biome.mdx +++ b/website/src/content/blog/annoucing-biome.mdx @@ -7,7 +7,8 @@ authors: - core pubDate: 2023-08-29 coverImage: - src: ../../assets/old-social-logo.png + lightSrc: ../../assets/old-social-logo.png + darkSrc: ../../assets/old-social-logo.png alt: The name of the project - "Biome", with the slogan underneath that says "Toolchain of the web" socialImage: ../../assets/old-social-logo.png --- diff --git a/website/src/content/blog/biome-wins-prettier-challenge.md b/website/src/content/blog/biome-wins-prettier-challenge.md index b5fc3351ed6f..65ee7488b026 100644 --- a/website/src/content/blog/biome-wins-prettier-challenge.md +++ b/website/src/content/blog/biome-wins-prettier-challenge.md @@ -7,7 +7,8 @@ authors: - team pubDate: 2023-11-27 coverImage: - src: ../../assets/blog/prettier-challenge.png + lightSrc: ../../assets/blog/prettier-challenge.png + darkSrc: ../../assets/blog/prettier-challenge.png alt: The Prettier challenge banner, with the Biome logo over it socialImage: ../../assets/blog/prettier-challenge.png --- @@ -149,17 +150,17 @@ Biome is a linter too, and it features [177 rules](https://biomejs.dev/linter/ru ```
nursery/noDefaultExport.js:1:8 lint/nursery/noDefaultExport ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
+
⚠ Avoid default exports.
-
+
> 1 │ export default function f() {};
│ ^^^^^^^
2 │
-
+
ℹ Default exports cannot be easily discovered inside an editor and don't encourage the use of consistent names through a code base.
-
+
ℹ Use a named export instead.
-
+
- [noAriaHiddenOnFocusable](https://biomejs.dev/linter/rules/no-aria-hidden-on-focusable)
@@ -169,17 +170,17 @@ Biome is a linter too, and it features [177 rules](https://biomejs.dev/linter/ru
```
nursery/noAriaHiddenOnFocusable.js:1:1 lint/nursery/noAriaHiddenOnFocusable FIXABLE ━━━━━━━━━━━━━━
-
+
✖ Disallow aria-hidden="true" from being set on focusable elements.
-
+
> 1 │ <div aria-hidden="true" tabIndex="0" />
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2 │
-
+
ℹ aria-hidden should not be set to true on focusable elements because this can lead to confusing behavior for screen reader users.
-
+
ℹ Unsafe fix: Remove the aria-hidden attribute from the element.
-
+
1 │ <div·aria-hidden="true"·tabIndex="0"·/>
│ -------------------
@@ -192,16 +193,16 @@ Biome is a linter too, and it features [177 rules](https://biomejs.dev/linter/ru
```
nursery/noImplicitAnyLet.js:1:5 lint/nursery/noImplicitAnyLet ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
+
✖ This variable has implicitly the any type.
-
+
> 1 │ var a;
│ ^
2 │ a = 2;
3 │
-
+
ℹ Variable declarations without type annotation and initialization have implicitly the any type. Declare type or initialize the variable with some value.
-
+
- [useAwait](https://biomejs.dev/linter/rules/use-await)
@@ -214,9 +215,9 @@ Biome is a linter too, and it features [177 rules](https://biomejs.dev/linter/ru
```
nursery/useAwait.js:1:1 lint/nursery/useAwait ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
+
✖ This async function lacks an await expression.
-
+
> 1 │ async function fetchData() {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 2 │ // Missing `await` for the promise returned by `fetch`
@@ -224,9 +225,9 @@ Biome is a linter too, and it features [177 rules](https://biomejs.dev/linter/ru
> 4 │ }
│ ^
5 │
-
+
ℹ Remove this async modifier, or add an await expression in the function.
-
+
> 1 │ async function fetchData() {
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 2 │ // Missing `await` for the promise returned by `fetch`
@@ -234,9 +235,9 @@ Biome is a linter too, and it features [177 rules](https://biomejs.dev/linter/ru
> 4 │ }
│ ^
5 │
-
+
ℹ Async functions without await expressions may not need to be declared async.
-
+
- [useValidAriaRole](https://biomejs.dev/linter/rules/use-valid-aria-role)
@@ -246,18 +247,18 @@ Biome is a linter too, and it features [177 rules](https://biomejs.dev/linter/ru
```
nursery/useValidAriaRole.js:1:1 lint/nursery/useValidAriaRole FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
+
✖ Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
-
+
> 1 │ <div role="datepicker"></div>
│ ^^^^^^^^^^^^^^^^^^^^^^^
2 │
-
+
ℹ Check WAI-ARIA for valid roles or provide options accordingly.
-
+
ℹ Unsafe fix: Remove the invalid role attribute.
Check the list of all valid role attributes.
-
+
1 │ <div·role="datepicker"></div>
│ -----------------
@@ -295,17 +296,17 @@ new RegExp("abc", "u");
```
a11y/noAccessKey.js:1:22 lint/a11y/noAccessKey FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
+
✖ Avoid the accessKey attribute to reduce inconsistencies between keyboard shortcuts and screen reader keyboard comments.
-
+
> 1 │ <input type="submit" accessKey="s" value="Submit" />
│ ^^^^^^^^^^^^^
2 │
-
+
ℹ Assigning keyboard shortcuts using the accessKey attribute leads to inconsistent keyboard actions across applications.
-
+
ℹ Unsafe fix: Remove the accessKey attribute.
-
+
1 │ <input·type="submit"·accessKey="s"·value="Submit"·/>
│ --------------
@@ -317,15 +318,15 @@ new RegExp("abc", "u");
```
a11y/useHeadingContent.js:1:1 lint/a11y/useHeadingContent ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
+
✖ Provide screen reader accessible content when using heading elements.
-
+
> 1 │ <h1 />
│ ^^^^^^
2 │
-
+
ℹ All headings on a page should have content that is accessible to screen readers.
-
+
- [complexity/useSimpleNumberKeys](https://biomejs.dev/linter/use-simple-number-keys)
@@ -335,19 +336,19 @@ new RegExp("abc", "u");
```
complexity/useSimpleNumberKeys.js:1:4 lint/complexity/useSimpleNumberKeys FIXABLE ━━━━━━━━━━━━━━━━
-
+
✖ Hexadecimal number literal is not allowed here.
-
+
> 1 │ ({ 0x1: 1 });
│ ^^^
2 │
-
+
ℹ Safe fix: Replace 0x1 with 1
-
+
1 │ - ({·0x1:·1·});
1 │ + ({·1:·1·});
2 2 │
-
+
### Promoted rules
diff --git a/website/src/content/blog/roadmap-2024.md b/website/src/content/blog/roadmap-2024.md
new file mode 100644
index 000000000000..326314cd4985
--- /dev/null
+++ b/website/src/content/blog/roadmap-2024.md
@@ -0,0 +1,353 @@
+---
+title: Roadmap 2024
+description: Roadmap 2024, v1.5.0 and new logo
+summary: Roadmap 2024, v1.5.0 and new logo
+authors:
+ - ema
+ - team
+pubDate: 2024-01-06
+coverImage:
+ lightSrc: ../../assets/blog/roadmap-2024/banner-light.png
+ darkSrc: ../../assets/blog/roadmap-2024/banner-dark.png
+ alt: The Prettier challenge banner, with the Biome logo over it
+socialImage: ../../assets/social-logo.png
+---
+## Roadmap 2024
+
+We are thrilled to share what the Core Contributors and Maintainers would like to focus on in 2024.
+
+We want to remind the community that Biome is a project driven by the community, so we can't promise that all the ideas outlined below are going to be shipped.
+
+However, if you're excited about some aspects of the project, and you want to see some of them developed faster than others, you can help us in many ways:
+- [**Be involved in the project and the community**](https://github.com/biomejs). Help us to build those features.
+- [**Sponsor us**](https://opencollective.com/biome). Ask your company to sponsor us. Biome is so fast that can cut down CI times in your company, and save money. Performance is part of our mission. Plus, sponsorship is a good medium of _advertisement_ for your company.
+- [**Improve our documentation with ideas, recipes, or guides**](/guides/getting-started). Translate our documentation, help us to make Biome available to people who aren't proficient in English.
+
+
+### Preface
+
+The project is young and still can't compete against other giants such as Prettier, eslint, webpack, vite, esbuild, etc., although the recent events (sponsors, bounty challenge, Biome being a fork of Rome) showed that the users **have** interest in the project, and we showed those users that we have the tools for fulfilling a need.
+
+Moving small projects from ESLint/Prettier is easy, but moving **big** code bases is challenging and time-consuming. This is a big friction to Biome.
+
+Users have different needs though, so it will be impossible to satisfy all of them, so we want to make sure that they contribute to our project and embrace our philosophy.
+
+### Main area of focus
+
+1. Help users to move to Biome
+2. Increase Biome's languages, so Biome tools can span
+3. Deepen Biome's existing capabilities to offer more functionalities
+4. Plugins
+5. Transformations
+6. Community and content
+
+### Help users to move to Biome
+
+- Offer guides on our website to users who want to migrate from Prettier (CLI commands and configuration)
+- Offer guides on our website to users who want to migrate from ESlint (CLI commands and configuration)
+- Offer a section on our website that shows a mapping of the ESLint rules to our rules
+- Offer commands to ease the transition
+ - A command called `biome migrate prettier` that will read `.prettierrc` and `.prettierignore`, will update the `biome.json` file (or create it) with the configuration coming from the Prettier files.
+ - A command called `biome migrate eslint` that will read the JSON configuration of Eslint and the ignore file. There will be expectations and limitations.
+
+
+### Increase Biome's languages, so Biome tools can span
+
+CSS is going to be our next language of focus. HTML and Markdown will follow. Follow our [up-to-date page](/internals/language-support) to know the progress of our works.
+
+The CSS language will enable a lot of work and experimentation: CSS formatting and linting, and we will port some of the lint rules from `styelelint`. A new area of experimentation is cross-linting.
+
+The idea of cross-linting can be explained with an example: compute the CSS styles/classes defined in a project, and warn a user when said styles aren't used inside JSX/HTML files.
+
+Plus, we unlock another area of experimentation, which is embedded formatting.
+
+HTML and Markdown will be our next languages of focus. HTML will enable us to parse other variants of HTML that are popular in the frontend ecosystem: [Vue](https://vuejs.org/), [Svelte](https://svelte.dev/) and [Astro](https://astro.build/). This would require some exploration on how to represent super languages of HTML.
+
+### Deepen Biome's existing capabilities to offer more functionalities.
+
+- Project analysis and dependency resolution
+- Type system
+- CLI
+
+#### Project analysis and dependency resolution
+
+We will provide lint rules that can read the manifest and do operations over it, such as invalid licenses.
+
+With project resolution, we will be able to provide more lint rules, some of which will be able to detect unused modules.
+
+With dependency resolution, we will be able to provide to - for example - detect dependencies that aren't used inside a project.
+
+With this infrastructure, our LSP is going to be more powerful and we will able to provide more features, for example:
+- rename variables across a project;
+- auto-complete for imports;
+- in-line types
+
+#### Type system
+
+Building a full-fledged type system such as TypeScript is a massive effort, that's why we decided to take a different direction and start by building a subset of the type system that would require stricter typing. This approach would allow us to build some important lint rules that users have been asking for.
+
+This will come with a downside: relying on a stricter code, and minimal type inference from the compiler.
+
+Once we have something we can rely on, we can slowly widen the type-checking functionality.
+
+#### CLI
+
+More features for the command line tool, such as:
+- Add the `explain` command for offline documentation;
+- Allow to export the output in different formats (JSON, etc.)
+- Auto-completion for other shells such as `zsh`;
+- Implement the `--modified` argument, which allows to format - for example - only the modified lines of a document;
+- Expose metrics for Biome's operations, and being able to track down possible performance bottlenecks;
+
+### Plugins
+
+We will explore plugins, and come up with a design that fits Biome.
+Biome is different from other tools because Biome is a toolchain that has multiple tools in it, so we have to think out of the box and propose a design that might differ from the tools people are used to.
+
+We don't know yet what a Biome's plugin will look like, although we think a plugin should be able to tap all the tools that Biome offers.
+
+Some ideas that we will consider:
+- DSL
+- WASM
+- A Runtime
+
+### Transformations
+
+Transformations and code generation are going to be our first steps towards our compiler.
+
+We will provide the ability to transform TypeScript and JSX files into JavaScript files.
+
+### Community and content
+
+Biome has a growing ecosystem, with an official VSCode extension, an official IntelliJ extension, and a Discord bot. We want to grow the features provided by these tools and welcome any user who wants to help us.
+
+Our community is slowly growing, and we want to reward any person who sticks around a contributions to Biome. At Biome, **we value any type of contribution**, so you don't need to be proficient in Rust in order to help us. Even participating to discussions and help us to shape our features, or helping other people are considered *contributions*. If you think you contributed to our ecosystem, we encourage you to [candidate yourself as a maintainer of the project](https://github.com/biomejs/biome/blob/main/GOVERNANCE.md#maintainer-nomination).
+
+Recently Biome started its own [YouTube Channel](https://www.youtube.com/channel/UC6ssscaFgCSlbv1Pb6krGVw). We will use this channel to share learning content with the community.
+
+## New logo and homepage
+
+With this blog post, we also want to officially announce our new logo, homepage and rebranding of the website.
+
+With this new logo, we want to give a different meaning to the project. Biome **isn't** a fork of Rome anymore, but a self-sufficient project ready to bloom.
+
+The triangle of the logo represents the mountains - **soil** -, and the curly shape on the bottom left represents a wave of the ocean - **water**. Two elements important to create a self-sufficient ecosystem, so it can thrive and grow.
+
+
+## Version 1.5.0
+
+With the Roadmap 2024, we also publish a new version. This version has few features around the CLI and **many** fixes in our formatter. Our TypeScript, JSX and JavaScript formatting has surpassed the **97% compatibility rate** with Prettier.
+
+### New features
+
+- Process only the files that were changed.
+- The command `biome ci` now prints diagnostics in GitHub PRs.
+- A new command `biome explain`.
+- The command `biome migrate` updates the `$schema`.
+- New lint rules.
+
+#### Process only the files that were changed
+
+If you enable the integration with VCS, you can tell Biome to process only the files that were changed. As for now, this feature computes the files that were changed by using a VCS, so Biome doesn't know what's changed.
+
+This feature practically makes some utilities such as `lint-staged` obsolete.
+
+In order to take advantage of this feature, you have to tell Biome what's the default branch in the configuration file, then you'll have to pass the option `--changed` via CLI:
+
+```json title="biome.json" ins={5}
+{
+ "vcs": {
+ "enabled": true,
+ "clientKind": "git",
+ "defaultBranch": "main"
+ }
+}
+```
+
+Once you modified some files, use the new option to the command you need, for example the `format` command:
+
+```shell ins="--changed"
+biome format --changed --write
+```
+
+#### The command `biome ci` now prints diagnostics in GitHub PRs
+
+For quite some time, users were confused by the difference of the commands `check` and `ci`, because until now their behaviours are very similar. From this version, the command `ci` is able to detect the GitHub CI environment, and print annotation in the PRs.
+
+![Screenshot of a GitHub annotation printed by Biome](../../assets/blog/roadmap-2024/github-annotation.png)
+
+It's possible that you would need to change in your permissions of your workflow files, in case you don't see the annotations:
+
+```yaml title=".github/workflows/action.yml"
+permissions:
+ pull-requests: write
+```
+
+#### A new command `biome explain`
+
+This command will serve as "offline" documentation tool. In this release, the command supports the explanation of all the lint rules, for example you can request documentation for `noAccumulatingSpread`:
+
+```shell
+biome explain noAccumulatingSpread
+```
+
+Which will print the following markdown:
+
+``````markdown
+# noAccumulatingSpread
+
+No fix available.
+
+This rule is recommended.
+
+# Description
+Disallow the use of spread (`...`) syntax on accumulators.
+
+Spread syntax allows an iterable to be expanded into its individual elements.
+
+Spread syntax should be avoided on accumulators (like those in `.reduce`)
+because it causes a time complexity of `O(n^2)` instead of `O(n)`.
+
+Source: https://prateeksurana.me/blog/why-using-object-spread-with-reduce-bad-idea/
+
+## Examples
+
+### Invalid
+
+```js,expect_diagnostic
+var a = ['a', 'b', 'c'];
+a.reduce((acc, val) => [...acc, val], []);
+```
+
+```js,expect_diagnostic
+var a = ['a', 'b', 'c'];
+a.reduce((acc, val) => {return [...acc, val];}, []);
+```
+
+```js,expect_diagnostic
+var a = ['a', 'b', 'c'];
+a.reduce((acc, val) => ({...acc, [val]: val}), {});
+```
+
+## Valid
+
+```js
+var a = ['a', 'b', 'c'];
+a.reduce((acc, val) => {acc.push(val); return acc}, []);
+```
+
+``````
+
+We plan to make this output more readable for terminals, as well as provide autocompletion for this command.
+
+#### The command `biome migrate` updates the `$schema`
+
+The command `biome migrate` now updates the `$schema` value inside the configuration file `biome.json` if you avail of the online schema. Run this command as soon as you update to Biome `v1.5.0`:
+
+```json title="biome.json" ins="1.5.0" del={2} ins={3}
+{
+ "$schema": "https://biomejs.dev/schemas/1.4.1/schema.json"
+ "$schema": "https://biomejs.dev/schemas/1.5.0/schema.json"
+}
+```
+
+#### New rules
+
+##### [useExportType](https://biomejs.dev/linter/rules/use-export-type)
+
+```ts
+interface I {}
+export { I };
+```
+
+nursery/useExportType.js:2:8 lint/nursery/useExportType FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ ✖ All exports are only types and should thus use export type.
+
+ 1 │ interface I {}
+ > 2 │ export { I };
+ │ ^^^^^^
+ 3 │
+
+ ℹ Using export type allows transpilers to safely drop exports of types without looking for their definition.
+
+ ℹ Safe fix: Use a grouped export type.
+
+ 2 │ export·type·{·I·};
+ │ +++++
+
+
+##### [useFilenamingConvention](https://biomejs.dev/linter/rules/use-filenaming-convention)
+
+Enforces naming conventions for JavaScript and TypeScript filenames.
+
+##### [useNodeImportProtocol](https://biomejs.dev/linter/rules/use-node-import-protocol)
+
+```jsx
+import fs from 'fs';
+```
+
+
+nursery/useNodeImportProtocol.js:1:16 lint/nursery/useNodeImportProtocol FIXABLE ━━━━━━━━━━━━━━━━━
+
+ ⚠ Import from Node.js builtin module "fs" should use the "node:" protocol.
+
+ > 1 │ import fs from 'fs';
+ │ ^^^^
+ 2 │
+
+ ℹ Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
+
+ ℹ Unsafe fix: Change to "node:fs".
+
+ 1 │ - import·fs·from·'fs';
+ 1 │ + import·fs·from·"node:fs";
+ 2 2 │
+
+
+
+##### [noNodejsModules](https://biomejs.dev/linter/rules/no-nodejs-modules)
+
+```jsx
+import fs from "fs";
+import path from "node:path";
+```
+
+nursery/noNodejsModules.js:1:16 lint/nursery/noNodejsModules ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ ⚠ Using Node.js modules are forbidden.
+
+ > 1 │ import fs from "fs";
+ │ ^^^^
+ 2 │ import path from "node:path";
+ 3 │
+
+ ℹ Can be useful for client-side web projects that do not have access to those modules.
+
+ ℹ Remove the import module.
+
+
+
+##### [noInvalidUseBeforeDeclaration](https://biomejs.dev/linter/rules/no-invalid-use-before-declaration)
+
+```jsx
+function f() {
+ console.log(x);
+ const x;
+}
+```
+
+nursery/noInvalidUseBeforeDeclaration.js:3:11 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+
+ ✖ Const declarations must have an initialized value.
+
+ 1 │ function f() {
+ 2 │ console.log(x);
+ > 3 │ const x;
+ │ ^
+ 4 │ }
+ 5 │
+
+ ℹ This variable needs to be initialized.
+
+
diff --git a/website/src/content/config.ts b/website/src/content/config.ts
index e273f1bc0448..639fd049f01a 100644
--- a/website/src/content/config.ts
+++ b/website/src/content/config.ts
@@ -15,7 +15,8 @@ const blogSchema = (image: ImageFunction) =>
authors: z.array(z.string()),
coverImage: z
.object({
- src: image(),
+ lightSrc: image(),
+ darkSrc: image(),
caption: z.string().optional(),
alt: z.string(),
})
diff --git a/website/src/content/docs/guides/how-biome-works.mdx b/website/src/content/docs/guides/how-biome-works.mdx
index 9705def4f52e..bfb17c238848 100644
--- a/website/src/content/docs/guides/how-biome-works.mdx
+++ b/website/src/content/docs/guides/how-biome-works.mdx
@@ -1,9 +1,10 @@
---
title: How Biome works
-description: Learn how to set up a new project with Biome.
+description: Learn how Biome works, like assumptions, configuration and more.
---
import DefaultConfiguration from "@src/components/generated/DefaultConfiguration.mdx";
+This is a guide that explains how the tool works, assumptions, and internal information useful when setting up the project and the configuration file.
## Configuration
@@ -93,7 +94,7 @@ The following files are parsed as **`JSON` files** with the options `json.parse
- `.hintrc`
- `.babelrc`
-### `ignore` and `include` syntax rules
+## Syntax rules for `ignore` and `include`
The syntax and meaning of these two options loosely follow the [globset rules](https://docs.rs/globset/latest/globset/#syntax) but without the ability to set options.
@@ -116,3 +117,8 @@ The syntax and meaning of these two options loosely follow the [globset rules](h
> `[!ab]` to match any character except for `a` and `b`.
> - Metacharacters such as `*` and `?` can be escaped with character class
> notation. e.g., `[*]` matches `*`.
+
+### Ignore folders and ignore files
+
+
+
diff --git a/website/src/content/docs/guides/integrate-in-vcs.mdx b/website/src/content/docs/guides/integrate-in-vcs.mdx
new file mode 100644
index 000000000000..c9d63f0fd623
--- /dev/null
+++ b/website/src/content/docs/guides/integrate-in-vcs.mdx
@@ -0,0 +1,67 @@
+---
+title: Integrate Biome with your VCS
+description: Learn how Biome works, like assumptions, configuration and more.
+---
+
+The VCS (Version Control System) integration is meant to take advantage of **additional** features that only a VCS can provide, allowing to customise
+your development experience even further.
+
+The integration is *opt-in**, and it requires two mandatory fields. The `vcs.enabled` field, and the `vcs.clientKind` field, both in the configuration file:
+
+```json title="biome.json"
+{
+ "vcs": {
+ "enabled": true,
+ "clientKind": "git"
+ }
+}
+```
+
+This configuration doesn't do **anything per se**. You have to opt-in new features.
+
+### Use the ignore file
+
+This is a feature that allows Biome to read the ignore file of the VCS and ignore all the files and folders that were specified in it. This is an opt-in feature, and you have to enable the `vcs.useIgnoreFile` field:
+
+```json title="biome.json" ins={5}
+{
+ "vcs": {
+ "enabled": true,
+ "clientKind": "git",
+ "useIgnoreFile": true
+ }
+}
+```
+
+### Process only changed files
+
+This is a feature that is available only via CLI, and allows to process **only** the files that **changed** from one revision and another.
+
+First, you have to update your configuration file and tell Biome what's the default branch via `vcs.defaultBranch` field:
+
+```json title="biome.json" ins={6}
+{
+ "vcs": {
+ "enabled": true,
+ "clientKind": "git",
+ "useIgnoreFile": true,
+ "defaultBranch": "main"
+ }
+}
+```
+
+Then, add the `--changed` option to your command, to process only those files that your VCS acknowledged as "changed". Biome, with the help of the VCS, will determine the changed file from the branch `main` and your current revision:
+
+```shell
+biome format --changed
+```
+
+:::caution
+Biome doesn't check what's changed, this means that even adding spaces or newlines to a file, will mark this file as "changed"
+:::
+
+Alternatively, you can use the option `--since` to specify an arbitrary branch. This option **takes precedence** over the option `vcs.defaultBranch`. For example, you might want to check your changes against the `next` branch:
+
+```shell
+biome format --changed --since=next
+```
diff --git a/website/src/content/docs/index.mdx b/website/src/content/docs/index.mdx
index a6b554e73907..25f0fd37b16e 100644
--- a/website/src/content/docs/index.mdx
+++ b/website/src/content/docs/index.mdx
@@ -105,7 +105,33 @@ import Netlify from "@src/components/Netlify.astro";
+ Biome is a performant toolchain for web projects, it aims to provide developer tools to maintain the health of said projects. + + ```shell + npm install --save-dev --save-exact @biomejs/biome + ``` +
+ + **Biome is a [fast formatter](./benchmark#formatting)** for _JavaScript_, _TypeScript_, _JSX_, and _JSON_ that scores **[96% compatibility with _Prettier_](https://console.algora.io/challenges/prettier)**. + + ```shell + npx @biomejs/biome format ./src + ``` + + **Biome is a [performant linter](https://github.com/biomejs/biome/tree/main/benchmark#linting)** for _JavaScript_, _TypeScript_, and _JSX_ that features **[more than 170 rules](https://biomejs.dev/linter/rules/)** from ESLint, TypeSCript ESLint, and [other sources](https://github.com/biomejs/biome/discussions/3). + It **outputs detailed and contextualized diagnostics** that help you to improve your code and become a better programmer! + + ```shell + npx @biomejs/biome lint ./src + ``` +