diff --git a/.changeset/based-bears-brawl.md b/.changeset/based-bears-brawl.md new file mode 100644 index 000000000000..1b77fc3ef71f --- /dev/null +++ b/.changeset/based-bears-brawl.md @@ -0,0 +1,28 @@ +--- +"@biomejs/biome": minor +--- + +Biome's resolver now supports `baseUrl` if specified in `tsconfig.json`. + +#### Example + +Given the following file structure: + +**`tsconfig.json`** +```json +{ + "compilerOptions": { + "baseUrl": "./src", + } +} +``` + +**`src/foo.ts`** +```ts +export function foo() {} +``` + +In this scenario, `import { foo } from "foo";` should work regardless of the +location of the file containing the `import` statement. + +Fixes [#6432](https://github.com/biomejs/biome/issues/6432). diff --git a/.changeset/breezy-suns-leave.md b/.changeset/breezy-suns-leave.md new file mode 100644 index 000000000000..84f3fc9d48d9 --- /dev/null +++ b/.changeset/breezy-suns-leave.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": minor +--- + +Added `ignore` option to `noUnknownAtRules`. If an unknown at-rule matches any of the items provided in `ignore`, a diagnostic won't be emitted. diff --git a/.changeset/busy-pens-send.md b/.changeset/busy-pens-send.md new file mode 100644 index 000000000000..e0b837916a97 --- /dev/null +++ b/.changeset/busy-pens-send.md @@ -0,0 +1,26 @@ +--- +"@biomejs/biome": minor +--- + +Enhanced the `init` command. The `init` command now checks if the existing project contains known ignore files and known generated folders. + +If Biome finds `.gitignore` or `.ignore` files, it will add the following configuration to `biome.json`: +```diff +{ ++ "vcs": { ++ "enabled": true, ++ "clientKind": "git", ++ "useIgnoreFile": true ++ } +} +``` + +If Biome finds a `dist/` folder, it will exclude it automatically using the double-exclude syntax: + +```diff +{ ++ "files": { ++ "includes": ["**", "!!**/dist"] ++ } +} +``` diff --git a/.changeset/crazy-steaks-mix.md b/.changeset/crazy-steaks-mix.md new file mode 100644 index 000000000000..cb34a19d8f09 --- /dev/null +++ b/.changeset/crazy-steaks-mix.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": minor +--- + +The rules in a domain are no longer enabled automatically by the installed dependencies unless the rule is recommended. diff --git a/.changeset/css-parse-modules-flag.md b/.changeset/css-parse-modules-flag.md new file mode 100644 index 000000000000..4b4996043911 --- /dev/null +++ b/.changeset/css-parse-modules-flag.md @@ -0,0 +1,14 @@ +--- +"@biomejs/biome": minor +--- + +Added `--css-parse-css-modules` CLI flag to control whether CSS Modules syntax is enabled. + +You can now enable or disable CSS Modules parsing directly from the command line: + +```shell +biome check --css-parse-css-modules=true file.module.css +biome format --css-parse-css-modules=true file.module.css +biome lint --css-parse-css-modules=true file.module.css +biome ci --css-parse-css-modules=true file.module.css +``` diff --git a/.changeset/css-parse-tailwind-flag.md b/.changeset/css-parse-tailwind-flag.md new file mode 100644 index 000000000000..b2464c9049c9 --- /dev/null +++ b/.changeset/css-parse-tailwind-flag.md @@ -0,0 +1,14 @@ +--- +"@biomejs/biome": minor +--- + +Added `--css-parse-tailwind-directives` CLI flag to control whether Tailwind CSS 4.0 directives and functions are enabled. + +You can now enable or disable Tailwind CSS 4.0 directive parsing directly from the command line: + +```shell +biome check --css-parse-tailwind-directives=true file.css +biome format --css-parse-tailwind-directives=true file.css +biome lint --css-parse-tailwind-directives=true file.css +biome ci --css-parse-tailwind-directives=true file.css +``` diff --git a/.changeset/dull-drinks-switch.md b/.changeset/dull-drinks-switch.md new file mode 100644 index 000000000000..4b81c869e8db --- /dev/null +++ b/.changeset/dull-drinks-switch.md @@ -0,0 +1,12 @@ +--- +"@biomejs/biome": minor +--- + +Updated the formatting of `.svelte` and `.vue` files. Now the indentation of the JavaScript blocks matches Prettier's: + +```diff + +``` diff --git a/.changeset/eager-suns-smoke.md b/.changeset/eager-suns-smoke.md new file mode 100644 index 000000000000..76dabb768b5d --- /dev/null +++ b/.changeset/eager-suns-smoke.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": patch +--- + +Fixed an issue where the JUnit reporter returned a zero-based location. Now the location returned is one-based. diff --git a/.changeset/few-bees-reply.md b/.changeset/few-bees-reply.md new file mode 100644 index 000000000000..b56a6b94778e --- /dev/null +++ b/.changeset/few-bees-reply.md @@ -0,0 +1,24 @@ +--- +"@biomejs/biome": minor +--- + +Implemented the `indentScriptAndStyle` option for vue and svelte files, with the default set to `false` to match [Prettier's `vueIndentScriptAndStyle` option](https://prettier.io/docs/options#vue-files-script-and-style-tags-indentation). When enabled, this option indents the content within ` +``` diff --git a/.changeset/forced-files-forget.md b/.changeset/forced-files-forget.md new file mode 100644 index 000000000000..186e5add6ba4 --- /dev/null +++ b/.changeset/forced-files-forget.md @@ -0,0 +1,44 @@ +--- +"@biomejs/biome": minor +--- + +Deprecated the option `files.experimentalScannerIgnores` in favour of **force-ignore** syntax in `files.includes`. + +`files.includes` supports ignoring files by prefixing globs with an exclamation mark (`!`). With this change, it also supports _force_-ignoring globs by prefixing them with a double exclamation mark (`!!`). + +The effect of force-ignoring is that the scanner will not index files matching the glob, even in project mode, even if those files are imported by other files, and even if they are files that receive special treatment by Biome, such as nested `biome.json` files. + +#### Example + +Let's take the following configuration: + +```json +{ + "files": { + "includes": [ + "**", + "!**/generated", + "!!**/dist", + "fixtures/example/dist/*.js" + ] + }, + "linter": { + "domains": { + "project": "all" + } + } +} +``` + +This configuration achieves the following: + +- Because the [project domain](https://biomejs.dev/linter/domains/#project) is enabled, all supported files in the project are indexed _and_ processed by the linter, _except_: +- Files inside a `generated` folder are not processed by the linter, but they will get indexed _if_ a file outside a `generated` folder imports them. +- Files inside a `dist` folder are never indexed nor processed, not even if they are imported for any purpose, _except_: +- When the `dist` folder is inside `fixtures/example/`, its `.js` files _do_ get both indexed and processed. + +In general, we now recommend using the force-ignore syntax for any folders that contain _output_ files, such as `build/` and `dist/`. For such folders, it is highly unlikely that indexing has any useful benefits. For folders containing generated files, you may wish to use the regular ignore syntax so that type information can still be extracted from the files. + +`experimentalScannerIgnores` will continue to work for now, but you'll see a deprecation warning if you still use it. + +Run the `biome migrate --write` command to automatically update the configuration file. diff --git a/.changeset/gentle-pots-hunt.md b/.changeset/gentle-pots-hunt.md new file mode 100644 index 000000000000..d8582ffb6f74 --- /dev/null +++ b/.changeset/gentle-pots-hunt.md @@ -0,0 +1,64 @@ +--- +"@biomejs/biome": minor +--- + +Added a new reporter named `rdjson`. This reporter prints diagnostics following the [RDJSON format](https://deepwiki.com/reviewdog/reviewdog/3.2-reviewdog-diagnostic-format): + +The following command: + +```shell +biome check --reporter=rdjson +``` + +Will emit diagnostics in the following format: + +```json +{ + "source": { + "name": "Biome", + "url": "https://biomejs.dev" + }, + "diagnostics": [ + { + "code": { + "url": "https://biomejs.dev/linter/rules/no-unused-imports", + "value": "lint/correctness/noUnusedImports" + }, + "location": { + "path": "index.ts", + "range": { + "end": { + "column": 11, + "line": 0 + }, + "start": { + "column": 7, + "line": 0 + } + } + }, + "message": "This import is unused." + }, + { + "code": { + "url": "https://biomejs.dev/linter/rules/no-unused-imports", + "value": "lint/correctness/noUnusedImports" + }, + "location": { + "path": "index.ts", + "range": { + "end": { + "column": 10, + "line": 1 + }, + "start": { + "column": 9, + "line": 1 + } + } + }, + "message": "Several of these imports are unused." + } + ] +} +``` diff --git a/.changeset/icy-views-lick.md b/.changeset/icy-views-lick.md new file mode 100644 index 000000000000..17839a23bddf --- /dev/null +++ b/.changeset/icy-views-lick.md @@ -0,0 +1,14 @@ +--- +"@biomejs/biome": minor +--- + +The `formatWithErrors` option can now be set via CLI using the `--format-with-errors` flag. + +This flag was previously only available in the configuration file. It allows formatting to proceed on files with syntax errors, which is useful during development when you want to auto-format code while fixing syntax issues. + +#### Example + +```shell +biome format --format-with-errors=true --write file.js +``` + diff --git a/.changeset/json-parse-comments-flag.md b/.changeset/json-parse-comments-flag.md new file mode 100644 index 000000000000..d2f3bf48608a --- /dev/null +++ b/.changeset/json-parse-comments-flag.md @@ -0,0 +1,14 @@ +--- +"@biomejs/biome": minor +--- + +Added `--json-parse-allow-comments` CLI flag to control whether comments are allowed in JSON files. + +You can now enable or disable comment parsing in JSON files directly from the command line: + +```shell +biome check --json-parse-allow-comments=true file.json +biome format --json-parse-allow-comments=true file.json +biome lint --json-parse-allow-comments=true file.json +biome ci --json-parse-allow-comments=true file.json +``` diff --git a/.changeset/json-parse-trailing-commas-flag.md b/.changeset/json-parse-trailing-commas-flag.md new file mode 100644 index 000000000000..1135b8771ecf --- /dev/null +++ b/.changeset/json-parse-trailing-commas-flag.md @@ -0,0 +1,14 @@ +--- +"@biomejs/biome": minor +--- + +Added `--json-parse-allow-trailing-commas` CLI flag to control whether trailing commas are allowed in JSON files. + +You can now enable or disable trailing comma parsing in JSON files directly from the command line: + +```shell +biome check --json-parse-allow-trailing-commas=true file.json +biome format --json-parse-allow-trailing-commas=true file.json +biome lint --json-parse-allow-trailing-commas=true file.json +biome ci --json-parse-allow-trailing-commas=true file.json +``` diff --git a/.changeset/large-lands-brush.md b/.changeset/large-lands-brush.md new file mode 100644 index 000000000000..f8202e29e017 --- /dev/null +++ b/.changeset/large-lands-brush.md @@ -0,0 +1,13 @@ +--- +"@biomejs/biome": minor +--- + +Promoted new lint rules: +- Promoted `noNonNullAssertedOptionalChain` to the suspicious group +- Promoted `useReactFunctionComponents` to the `style` group +- Promoted `useImageSize` to the `correctness` group +- Promoted `useConsistentTypeDefinitions` to the `style` group +- Promoted `useQwikClasslist` to the `correctness` group +- Promoted `noSecrets` to the `security` group + +Removed the lint rule `useAnchorHref`, because its use case is covered by `useValidAnchor`. diff --git a/.changeset/light-women-live.md b/.changeset/light-women-live.md new file mode 100644 index 000000000000..70201706760e --- /dev/null +++ b/.changeset/light-women-live.md @@ -0,0 +1,39 @@ +--- +"@biomejs/biome": minor +--- + +Added the new `checkstyle` reporter. When `--reporter=checkstyle` is passed to the CLI, Biome will emit diagnostics for [Checkstyle format](https://checkstyle.org/): + +```xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` diff --git a/.changeset/max-managers-mandate.md b/.changeset/max-managers-mandate.md new file mode 100644 index 000000000000..0e97ba306344 --- /dev/null +++ b/.changeset/max-managers-mandate.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": patch +--- + +Fixed an issue with the `files.maxSize` setting. Previously the setting would always be looked up in the root settings, even in monorepos where a closer `biome.json` is available. It now correctly uses the nearest configuration. diff --git a/.changeset/new-signs-tie.md b/.changeset/new-signs-tie.md new file mode 100644 index 000000000000..7f6bdc21533d --- /dev/null +++ b/.changeset/new-signs-tie.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": minor +--- + +Added "@rbxts/react" as an alias for "react" for handling the reactClassic jsxRuntime. diff --git a/.changeset/polite-pets-serve.md b/.changeset/polite-pets-serve.md new file mode 100644 index 000000000000..e7a6ffab67e8 --- /dev/null +++ b/.changeset/polite-pets-serve.md @@ -0,0 +1,5 @@ +--- +"@biomejs/biome": minor +--- + +Added `.oxlintrc.json` to well-known files. diff --git a/.changeset/seven-beans-cough.md b/.changeset/seven-beans-cough.md new file mode 100644 index 000000000000..6fda8245ed2b --- /dev/null +++ b/.changeset/seven-beans-cough.md @@ -0,0 +1,12 @@ +--- +"@biomejs/biome": minor +--- + +The following rules are now a part of the `react` domain, and they won't be enabled automatically unless you enabled the domain, or Biome detects `react` as a dependency of your closest `package.json`: + +- [`lint/correctness/noChildrenProp`](https://biomejs.dev/linter/rules/no-children-prop/) (recommended) +- [`lint/correctness/noReactPropAssignments`](https://biomejs.dev/linter/rules/no-react-prop-assignments/) +- [`lint/security/noDangerouslySetInnerHtml`](https://biomejs.dev/linter/rules/no-dangerously-set-inner-html/) (recommended) +- [`lint/security/noDangerouslySetInnerHtmlWithChildren`](https://biomejs.dev/linter/rules/no-dangerously-set-inner-html-with-children/) (recommended) +- [`lint/style/useComponentExportOnlyModules`](https://biomejs.dev/linter/rules/use-component-export-only-modules/) +- [`lint/suspicious/noArrayIndexKey`](https://biomejs.dev/linter/rules/no-array-index-key/) (recommended) diff --git a/.changeset/social-hornets-wait.md b/.changeset/social-hornets-wait.md new file mode 100644 index 000000000000..c485403a2d81 --- /dev/null +++ b/.changeset/social-hornets-wait.md @@ -0,0 +1,12 @@ +--- +"@biomejs/biome": minor +--- + +Added the ability to show severity `Information` diagnostics in reporter outputs. + +If one or more rules are triggered, and they are configured to emit an `Information` diagnostic, now they're counted in the final output: + +```bash +Checked 1 file in