diff --git a/.changeset/add_new_option_javascriptjsxeverywhere.md b/.changeset/add_new_option_javascriptjsxeverywhere.md new file mode 100644 index 000000000000..dd4844604b6f --- /dev/null +++ b/.changeset/add_new_option_javascriptjsxeverywhere.md @@ -0,0 +1,9 @@ +--- +"@biomejs/biome": minor +--- + +Add new option `javascript.parser.jsxEverywhere`. This new option allows to control whether Biome should expect JSX syntax in `.js`/`.ts` files. + +When `jsxEverywhere` is set to `false`, having JSX syntax like `
` inside `.js`/`.ts` files will result in a **parsing error**. + +This option defaults to `true`. diff --git a/.changeset/add_the_new_rule_nofloatingpromises.md b/.changeset/add_the_new_rule_nofloatingpromises.md new file mode 100644 index 000000000000..3a80e6da2c43 --- /dev/null +++ b/.changeset/add_the_new_rule_nofloatingpromises.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": minor +--- + +Add the new rule [`noFloatingPromises`](https://biomejs.dev/linter/rules/no-floating-promises). diff --git a/.changeset/add_the_new_rule_noimportcycles.md b/.changeset/add_the_new_rule_noimportcycles.md new file mode 100644 index 000000000000..b0296c588606 --- /dev/null +++ b/.changeset/add_the_new_rule_noimportcycles.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": minor +--- + +Add the new rule [`noImportCycles`](https://biomejs.dev/linter/rules/no-import-cycles). diff --git a/.changeset/add_the_new_rule_notsignorehttps.md b/.changeset/add_the_new_rule_notsignorehttps.md new file mode 100644 index 000000000000..6999a8a84732 --- /dev/null +++ b/.changeset/add_the_new_rule_notsignorehttps.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": minor +--- + +Add the new rule [`noTsIgnore`](https://biomejs.dev/linter/rules/no-ts-ignore). diff --git a/.changeset/add_the_new_rule_nounwantedpolyfillio.md b/.changeset/add_the_new_rule_nounwantedpolyfillio.md new file mode 100644 index 000000000000..e8fe8d8c1ce9 --- /dev/null +++ b/.changeset/add_the_new_rule_nounwantedpolyfillio.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": minor +--- + +Add the new rule [`noUnwantedPolyfillio`](https://biomejs.dev/linter/rules/no-unwanted-polyfillio). diff --git a/.changeset/add_whitespace_after_css_selecters_preceded_by_comment.md b/.changeset/add_whitespace_after_css_selecters_preceded_by_comment.md new file mode 100644 index 000000000000..ff9ad381b107 --- /dev/null +++ b/.changeset/add_whitespace_after_css_selecters_preceded_by_comment.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": patch +--- + +Fix [#5001](https://github.com/biomejs/biome/issues/5001), where the CSS formatter removes whitespace from selector preceded by a comment diff --git a/.changeset/added_a_json_format_option_expandslists.md b/.changeset/added_a_json_format_option_expandslists.md new file mode 100644 index 000000000000..67f1081bbaf5 --- /dev/null +++ b/.changeset/added_a_json_format_option_expandslists.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": minor +--- + +Added a JSON format option `expand`. The option `json.formatter.expand` allows to enforce the formatting of arrays and objects on multiple lines, regardless of their length. diff --git a/.changeset/better_control_over_linter_groups.md b/.changeset/better_control_over_linter_groups.md new file mode 100644 index 000000000000..367420e91364 --- /dev/null +++ b/.changeset/better_control_over_linter_groups.md @@ -0,0 +1,30 @@ +--- +"@biomejs/biome": minor +--- + +Linter groups now accept new options to enable/disable all rules that belong to a group, and control the severity +of the rules that belong to those groups. + +For example, you can downgrade the severity of rules that belong to `"style"` to emit `"info"` diagnostics: + +```json +{ + "linter": { + "rules": { + "style": "info" + } + } +} +``` + +You can also enable all rules that belong to a group using the default severity of the rule using the `"on"` option: + +```json +{ + "linter": { + "rules": { + "complexity": "on" + } + } +} +``` diff --git a/.changeset/biome_assist.md b/.changeset/biome_assist.md new file mode 100644 index 000000000000..97cd20cd5b71 --- /dev/null +++ b/.changeset/biome_assist.md @@ -0,0 +1,53 @@ +--- +"@biomejs/biome": minor +--- + +Biome assist is a new feature of the Biome analyzer. The assist is meant to provide **actions**. Actions differ from linter rules in that they aren't meant to signal errors. + +The assist will provide code actions that users can opt into via configuration or via IDEs/editors, using the Language Server Protocol. + +The assist **is enabled by default**. However, you can turn if off via configuration: + +```json +{ + "assist": { + "enabled": false + } +} +``` + +You can turn on the actions that you want to use in your configuration. For example, you can enable the `useSortedKeys` action like this: + +```json +{ + "assist": { + "actions": { + "source": { + "useSortedKeys": "on" + } + } + } +} +``` + +Alternatively, IDE/editor users can decide which action to apply on save *directly from the editor settings*, as long as the assist is enabled. + +For example, in VS Code you can apply the `useSortedKeys` action when saving a file by adding the following snippet in `settings.json`: + +```json +{ + "editor.codeActionsOnSave": { + "source.biome.useSortedKeys": "explicit" + } +} +``` + +In Zed, you can achieve the same by adding the following snippet in `~/.config/zed/settings.json`: + +```json +{ + "code_actions_on_format": { + "source.biome.useSortedKeys": true + } +} +``` diff --git a/.changeset/biome_logs_a_warning_in_case_a_folder_contains_biomejson_and_biomejsonc_and_it_will_use_biomejson_by_default.md b/.changeset/biome_logs_a_warning_in_case_a_folder_contains_biomejson_and_biomejsonc_and_it_will_use_biomejson_by_default.md new file mode 100644 index 000000000000..ac4d506100b2 --- /dev/null +++ b/.changeset/biome_logs_a_warning_in_case_a_folder_contains_biomejson_and_biomejsonc_and_it_will_use_biomejson_by_default.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": patch +--- + +Biome logs a warning in case a folder contains `biome.json` and `biome.jsonc`, and it will use `biome.json` by default. diff --git a/.changeset/biome_migrate_eslint_rule_overriding.md b/.changeset/biome_migrate_eslint_rule_overriding.md new file mode 100644 index 000000000000..91fc475b789f --- /dev/null +++ b/.changeset/biome_migrate_eslint_rule_overriding.md @@ -0,0 +1,38 @@ +--- +"@biomejs/biome": minor +--- + +Biome migrate eslint outputs a better overriding behavior. + +A Biome rule can have multiple ESLint equivalent rules. +For example, [useLiteralKeys](https://biomejs.dev/linter/rules/use-literal-keys/) has two ESLint equivalent rules: [dot-notation](https://eslint.org/docs/latest/rules/dot-notation) and [@typescript-eslint/dot-notation](https://typescript-eslint.io/rules/dot-notation/). + +Previously, Biome wouldn't always enable a Biome rule even if one of its equivalent rules was enabled. +Now Biome uses the higher severity level of all the equivalent ESLint rules to set the severity level of the Biome rule. + +The following ESLint configuration... + +```json +{ + "rules": { + "@typescript-eslint/dot-notation": "error", + "dot-notation": "off" + } +} +``` + +...is now migrated to... + +```json +{ + "linter": { + "rules": { + "complexity": { + "useLiteralKeys": "error" + } + } + } +} +``` + +...because `error` is higher than `off`. diff --git a/.changeset/biome_now_resolves_globs_and_paths_from_the_configuration_before_paths_and_globs_were_resolved_from_the_working_directory.md b/.changeset/biome_now_resolves_globs_and_paths_from_the_configuration_before_paths_and_globs_were_resolved_from_the_working_directory.md new file mode 100644 index 000000000000..1e653d38b4a8 --- /dev/null +++ b/.changeset/biome_now_resolves_globs_and_paths_from_the_configuration_before_paths_and_globs_were_resolved_from_the_working_directory.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": major +--- + +Biome now resolves globs and paths from the configuration. Before, paths and globs were resolved from the working directory. diff --git a/.changeset/blazing-fires-burn.md b/.changeset/blazing-fires-burn.md new file mode 100644 index 000000000000..ade2bf9f8772 --- /dev/null +++ b/.changeset/blazing-fires-burn.md @@ -0,0 +1,13 @@ +--- +"@biomejs/biome": patch +--- +[noUndeclaredVariables](https://biomejs.dev/linter/rules/no-undeclared-variables/) is now able to bind read of value to a type-only import in ambient contexts ([#4526](https://github.com/biomejs/biome/issues/4526)). + +In the following code, `A` is now correctly bound to the type-only import. +Previously, `A` was reported as an undeclared variable. + +```ts +import type { A } from "mod"; + +declare class B extends A {} +``` diff --git a/.changeset/blue-skies-fly.md b/.changeset/blue-skies-fly.md new file mode 100644 index 000000000000..0ef0c5adac85 --- /dev/null +++ b/.changeset/blue-skies-fly.md @@ -0,0 +1,13 @@ +--- +"@biomejs/biome": patch +--- + +Fix [#4317](https://github.com/biomejs/biome/issues/4317), setter parameter can contain a trailing comma, the following example will now parsed correctly: + +```ts +export class DummyClass { + set input( + value: string, + ) {} +} +``` diff --git a/.changeset/breezy-horses-fetch.md b/.changeset/breezy-horses-fetch.md new file mode 100644 index 000000000000..30718b890d9f --- /dev/null +++ b/.changeset/breezy-horses-fetch.md @@ -0,0 +1,6 @@ +--- +"@biomejs/biome": minor +--- + +Add a new lint rule `noConstantBinaryExpression`. +This rule is inspired from ESLint's [no-constant-binary-expression](https://eslint.org/docs/latest/rules/no-constant-binary-expression) rule. diff --git a/.changeset/bright-stars-shine.md b/.changeset/bright-stars-shine.md new file mode 100644 index 000000000000..3b95e8d9b9d8 --- /dev/null +++ b/.changeset/bright-stars-shine.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": patch +--- + +Fix [#4575](https://github.com/biomejs/biome/issues/4575), don't wrap selector indentation after css comments. diff --git a/.changeset/bright-sun-shines.md b/.changeset/bright-sun-shines.md new file mode 100644 index 000000000000..29bcd067699e --- /dev/null +++ b/.changeset/bright-sun-shines.md @@ -0,0 +1,4 @@ +--- +"@biomejs/biome": patch +--- +Fix [#4258](https://github.com/biomejs/biome/issues/4258), where fixed css parse error with @-moz-document url-prefix(). diff --git a/.changeset/bright-trees-dance.md b/.changeset/bright-trees-dance.md new file mode 100644 index 000000000000..03018f445f27 --- /dev/null +++ b/.changeset/bright-trees-dance.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": patch +--- + +Don't parse the files that don't end with the json extension as JSON files in the `.vscode` directory ([#4391](https://github.com/biomejs/biome/issues/4391)) diff --git a/.changeset/broken-dreams-fade.md b/.changeset/broken-dreams-fade.md new file mode 100644 index 000000000000..ba8a0bb29fd2 --- /dev/null +++ b/.changeset/broken-dreams-fade.md @@ -0,0 +1,11 @@ +--- +"@biomejs/biome": minor +--- + +`noUnusedImports` now reports empty named imports and suggests its removal ([#3574](https://github.com/biomejs/biome/issues/3574)). + +The rule now suggests the removal of empty named imports such as: + +```diff +- import {} from "mod"; +``` diff --git a/.changeset/calm-forests-grow.md b/.changeset/calm-forests-grow.md new file mode 100644 index 000000000000..a54c77c9d05c --- /dev/null +++ b/.changeset/calm-forests-grow.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": patch +--- + +`biome migrate eslint` now correctly resolves scoped package named `eslint-config` with a path. diff --git a/.changeset/calm-winds-blow.md b/.changeset/calm-winds-blow.md new file mode 100644 index 000000000000..33267a933cf3 --- /dev/null +++ b/.changeset/calm-winds-blow.md @@ -0,0 +1,11 @@ +--- +"@biomejs/biome": patch +--- + +Fix [#3836](https://github.com/biomejs/biome/issues/3836), css parser allow multiple semicolons after a declaration, the following example will now parsed correctly: + +```css +.foo { + color: red;; +} +``` diff --git a/.changeset/clean-floors-shine.md b/.changeset/clean-floors-shine.md new file mode 100644 index 000000000000..ba9a7de30771 --- /dev/null +++ b/.changeset/clean-floors-shine.md @@ -0,0 +1,18 @@ +--- +"@biomejs/biome": patch +--- +Fix [#4553](https://github.com/biomejs/biome/issues/4553), `noUselessFragments` fix result has invalid syntax for JSX attribute, the follow code will fix: + +```jsx +🐈 😂
-