Skip to content

refactor(organizeImports): improve diagnostics#9574

Merged
Conaclos merged 10 commits into
mainfrom
conaclos/organizeImports-improve-diagnostic
May 5, 2026
Merged

refactor(organizeImports): improve diagnostics#9574
Conaclos merged 10 commits into
mainfrom
conaclos/organizeImports-improve-diagnostic

Conversation

@Conaclos

@Conaclos Conaclos commented Mar 21, 2026

Copy link
Copy Markdown
Member

Summary

Fix #9530 (comment)

This PR adds detailed diagnostics for the issues reported by the organizeImports.
I personally find it a bit too verbose. Any opinion?

Note I didn't change Rule::text_range to keep the current behavior for biome-ignore comments: they have to be placed on the first import or export that appears in the file.

  • changelog entry

Test Plan

I updated the snapshot.

Docs

Nochange.

@changeset-bot

This comment was marked as outdated.

@Conaclos Conaclos changed the base branch from main to next March 21, 2026 16:59
@Conaclos Conaclos marked this pull request as draft March 21, 2026 16:59
@github-actions github-actions Bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Mar 21, 2026
@Conaclos Conaclos changed the title Conaclos/organize imports improve diagnostic refactor(organizeImports): improve diagnostics Mar 21, 2026
Comment thread crates/biome_js_analyze/src/assist/source/organize_imports.rs
@coderabbitai

This comment was marked as outdated.

@Conaclos Conaclos force-pushed the conaclos/organizeImports-improve-diagnostic branch from 4215aaf to fc1cf35 Compare May 3, 2026 10:31
@Conaclos Conaclos changed the base branch from next to main May 3, 2026 10:31
@Conaclos Conaclos force-pushed the conaclos/organizeImports-improve-diagnostic branch 2 times, most recently from 91a73f2 to 84da77c Compare May 3, 2026 10:43
@codspeed-hq

codspeed-hq Bot commented May 3, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 58 untouched benchmarks
⏩ 196 skipped benchmarks1


Comparing conaclos/organizeImports-improve-diagnostic (e61f398) with main (a1339fd)

Open in CodSpeed

Footnotes

  1. 196 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Conaclos Conaclos force-pushed the conaclos/organizeImports-improve-diagnostic branch 3 times, most recently from a6a292e to eda07fe Compare May 3, 2026 11:10
@Conaclos Conaclos marked this pull request as ready for review May 3, 2026 11:11
@Conaclos Conaclos force-pushed the conaclos/organizeImports-improve-diagnostic branch from eda07fe to 7f3f2d2 Compare May 3, 2026 11:13

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.changeset/giant-radios-pay.md:
- Line 5: Fix the markdown link text by adding the missing closing backtick:
change the fragment [`organizeImports] to [`organizeImports`] so the inline code
formatting for organizeImports is correct and the link renders properly in the
.changeset entry.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3dc1d721-9dfc-4667-9991-933af2dec705

📥 Commits

Reviewing files that changed from the base of the PR and between a1339fd and 7f3f2d2.

⛔ Files ignored due to path filters (36)
  • crates/biome_js_analyze/tests/specs/source/organizeImports/chunk-with-bare-export.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/chunk_newline.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/chunks.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/custom-order-exports.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/custom-order-mixed-glob-groups.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/custom-order-sorted-imports-missing-blank-lines.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/custom-order-unsorted-imports-missing-blank-lines.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/custom-order.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/custom-sort-lexicographic.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/custom-sort-natural.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/issue-5710.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/issue5985.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/issue6211.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/issue6492.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/mergeable-bare-exports.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/mergeable-with_header.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/mergeable-with_leading_newline.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/mergeable_export.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/mergeable_imports.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/mergeable_unsorted_imports.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/one-liner.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/single-chunk-imports.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/ts-declaration.d.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/ts-module.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/type-first-groups.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/type-last-groups.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/unorganized-bare-export-specifiers.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/unorganized-export-attributes.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/unorganized-export-specifiers.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/unorganized-import-attributes.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/unorganized-import-specifiers.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/unsorted-alias.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/unsorted-imports-empty-header.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/unsorted-same-source.ts.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/unsorted-starts-with-blank-line.js.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/source/organizeImports/unsorted_export_chunk.js.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (2)
  • .changeset/giant-radios-pay.md
  • crates/biome_js_analyze/src/assist/source/organize_imports.rs

Comment thread .changeset/giant-radios-pay.md Outdated
@github-actions github-actions Bot added the A-CLI Area: CLI label May 3, 2026
@github-actions github-actions Bot added the A-LSP Area: language server protocol label May 3, 2026
@ematipico

Copy link
Copy Markdown
Member

I'm still not sure why we removed the text range.

The rule already sends a list of signals (Issue), and from there we should be able to collect the correct range for each issue. Consider that I don't know the code very much, so my suggestion comes from a place of poor knowledge

@Conaclos

Conaclos commented May 3, 2026

Copy link
Copy Markdown
Member Author

I'm still not sure why we removed the text range.

What do you mean? I didn't remove any text range?

The rule already sends a list of signals (Issue), and from there we should be able to collect the correct range for each issue. Consider that I don't know the code very much, so my suggestion comes from a place of poor knowledge

Are you talking about the following comment :

Note I didn't change Rule::text_range to keep the current behavior for biome-ignore comments: they have to be placed on the first import or export that appears in the file.

?

If I understand correctly Rule::text_range was added to correctly and consistently handle biome-ignore comments. If I remember correctly you added it in the past?
The idea was to allow ignoring import/export sorting in the entire file. Thus, we had to find a consistent place to do so.
The natural thing we did, was to choose the first import/export statement.

However, we introduced biome-ignore-all later to ignore entire file. I guess this could now fit this need. Thus, we could re-purpose "regular" biome-ignore for ignoring specific chunks of imports/exports. This is out of scope of this PR and should be treated as a breaking change.

@ematipico

ematipico commented May 4, 2026

Copy link
Copy Markdown
Member

I'm still not sure why we removed the text range.

What do you mean? I didn't remove any text range?

Check the new snapshots of the printed diagnostics and reports. They don't have a position anymore. That's a regression.

The rule already sends a list of signals (Issue), and from there we should be able to collect the correct range for each issue. Consider that I don't know the code very much, so my suggestion comes from a place of poor knowledge

Are you talking about the following comment :

Note I didn't change Rule::text_range to keep the current behavior for biome-ignore comments: they have to be placed on the first import or export that appears in the file.

?

If I understand correctly Rule::text_range was added to correctly and consistently handle biome-ignore comments. If I remember correctly you added it in the past?
The idea was to allow ignoring import/export sorting in the entire file. Thus, we had to find a consistent place to do so.

The original issue is that users weren't able to suppress the rule in certain cases. I can't recall the specifics.

The natural thing we did, was to choose the first import/export statement.

However, we introduced biome-ignore-all later to ignore entire file. I guess this could now fit this need. Thus, we could re-purpose "regular" biome-ignore for ignoring specific chunks of imports/exports. This is out of scope of this PR and should be treated as a breaking change.

Maybe let's add some suppression tests against possible regressions. A user should be able to suppress the ordering of some exports/imports, while still allowing others.


```block
src/index.js:1:1 assist/source/organizeImports FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
src/index.js assist/source/organizeImports FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the regression I was talking about

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I completely missed that.

Comment on lines -50 to -54
<testsuite name="index.ts" tests="1" disabled="0" errors="0" failures="1" package="org.biome">
<testcase name="org.biome.assist.source.organizeImports" line="1" column="1">
<failure message="The imports and exports are not sorted.">line 1, col 1, The imports and exports are not sorted.</failure>
</testcase>
</testsuite>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the other regression. We lost the action from the report

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/biome_js_analyze/src/assist/source/organize_imports.rs`:
- Around line 778-782: The variable action_range is left None when initially
None because the else branch returns the outer None instead of initializing it
with the current range; update the logic in the action range aggregation (the
block using action_range.cover(range.clone())) to set action_range =
action_range.map_or(Some(range.clone()), |ar| Some(ar.cover(range.clone()))) or
equivalent (i.e., when action_range is None assign Some(range.clone()),
otherwise assign the covered range), and apply the same fix to the two other
occurrences that follow the same pattern.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c514e049-807f-4834-ae46-f0bddd1c0461

📥 Commits

Reviewing files that changed from the base of the PR and between 98bb03c and d44cead.

⛔ Files ignored due to path filters (26)
  • crates/biome_cli/tests/snapshots/main_cases_diagnostics/diagnostic_level.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/sorts_imports_check.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_handle_svelte_files/sorts_imports_check.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_handle_vue_files/sorts_imports_check.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_checkstyle/reports_diagnostics_checkstyle_check_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_checkstyle/reports_diagnostics_checkstyle_check_command_file.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_checkstyle/reports_diagnostics_checkstyle_ci_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_github/reports_diagnostics_github_check_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_github/reports_diagnostics_github_ci_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_gitlab/reports_diagnostics_gitlab_check_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_gitlab/reports_diagnostics_gitlab_ci_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_json/reports_diagnostics_json_check_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_json/reports_diagnostics_json_check_command_file.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_json/reports_diagnostics_json_ci_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_junit/reports_diagnostics_junit_check_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_junit/reports_diagnostics_junit_check_command_file.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_junit/reports_diagnostics_junit_ci_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_rdjson/reports_diagnostics_rdjson_check_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_rdjson/reports_diagnostics_rdjson_check_command_file.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_rdjson/reports_diagnostics_rdjson_ci_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_sarif/reports_diagnostics_sarif_check_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_sarif/reports_diagnostics_sarif_ci_command.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_terminal/reports_diagnostics_check_command_verbose.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_reporter_terminal/reports_diagnostics_check_write_command_file.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_check/shows_organize_imports_diff_on_check_when_enforced.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_ci/ci_formatter_linter_organize_imports.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (1)
  • crates/biome_js_analyze/src/assist/source/organize_imports.rs

Comment thread crates/biome_js_analyze/src/assist/source/organize_imports.rs Outdated
@Conaclos Conaclos force-pushed the conaclos/organizeImports-improve-diagnostic branch from d44cead to 25ba850 Compare May 4, 2026 19:44
coderabbitai[bot]

This comment was marked as outdated.

@Conaclos Conaclos force-pushed the conaclos/organizeImports-improve-diagnostic branch from 25ba850 to 52c23c9 Compare May 4, 2026 19:53
@Conaclos

Conaclos commented May 4, 2026

Copy link
Copy Markdown
Member Author

Maybe let's add some suppression tests against possible regressions. A user should be able to suppress the ordering of some exports/imports, while still allowing others.

I leave it for another PR.
I don't know if it is really possible or desirable. Because options like sortBareImports influence the scope of the rule.

@Conaclos Conaclos force-pushed the conaclos/organizeImports-improve-diagnostic branch 2 times, most recently from 2e72ea9 to 82d68e2 Compare May 4, 2026 20:10
@Conaclos Conaclos requested a review from ematipico May 4, 2026 20:16
@Conaclos Conaclos requested a review from ematipico May 4, 2026 21:30
@Conaclos Conaclos force-pushed the conaclos/organizeImports-improve-diagnostic branch 2 times, most recently from 8f20cc9 to 9fd718f Compare May 4, 2026 22:15
Comment thread .changeset/giant-radios-pay.md Outdated
@Conaclos Conaclos merged commit 3bd2b6a into main May 5, 2026
15 of 16 checks passed
@Conaclos Conaclos deleted the conaclos/organizeImports-improve-diagnostic branch May 5, 2026 20:24
@github-actions github-actions Bot mentioned this pull request May 5, 2026
OIRNOIR pushed a commit to OIRNOIR/YouTube-Helper-Server that referenced this pull request May 12, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@biomejs/biome](https://biomejs.dev) ([source](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome)) | imports | patch | [`2.4.14` -> `2.4.15`](https://renovatebot.com/diffs/npm/@biomejs%2fbiome/2.4.14/2.4.15) |

---

### Release Notes

<details>
<summary>biomejs/biome (@&#8203;biomejs/biome)</summary>

### [`v2.4.15`](https://github.com/biomejs/biome/blob/HEAD/packages/@&#8203;biomejs/biome/CHANGELOG.md#2415)

[Compare Source](https://github.com/biomejs/biome/compare/@biomejs/biome@2.4.14...@biomejs/biome@2.4.15)

##### Patch Changes

- [#&#8203;9394](biomejs/biome#9394) [`ba3480e`](biomejs/biome@ba3480e) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added the nursery rule [`useTestHooksInOrder`](https://biomejs.dev/linter/rules/use-test-hooks-in-order) in the `test` domain. The rule enforces that Jest/Vitest lifecycle hooks (`beforeAll`, `beforeEach`, `afterEach`, `afterAll`) are declared in the order they execute, making test setup and teardown easier to reason about.

- [#&#8203;10254](biomejs/biome#10254) [`e0a54cc`](biomejs/biome@e0a54cc) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added a new nursery rule [`useVueNextTickPromise`](https://biomejs.dev/linter/rules/use-vue-next-tick-promise/), which enforces Promise syntax when using Vue `nextTick`.

  For example, the following snippet triggers the rule:

  ```js
  import { nextTick } from "vue";

  nextTick(() => {
    updateDom();
  });
  ```

- [#&#8203;10219](biomejs/biome#10219) [`64aee45`](biomejs/biome@64aee45) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added a new nursery rule [`noVueVOnNumberValues`](https://biomejs.dev/linter/rules/no-vue-v-on-number-values/), that disallows deprecated number modifiers on Vue `v-on` directives.

  For example, the following snippet triggers the rule:

  ```vue
  <input @&#8203;keyup.13="submit" />
  ```

- [#&#8203;10195](biomejs/biome#10195) [`7b8d4e1`](biomejs/biome@7b8d4e1) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added the new nursery rule [`useVueValidVFor`](https://biomejs.dev/linter/rules/use-vue-valid-v-for/), which validates Vue `v-for` directives and reports invalid aliases, missing component keys, and keys that do not use iteration variables.

- [#&#8203;10238](biomejs/biome#10238) [`1110256`](biomejs/biome@1110256) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added the recommended nursery rule [`noVueImportCompilerMacros`](https://biomejs.dev/linter/rules/no-vue-import-compiler-macros/), which disallows importing Vue compiler macros such as `defineProps` from `vue` because they are automatically available.

- [#&#8203;10201](biomejs/biome#10201) [`1a08f89`](biomejs/biome@1a08f89) Thanks [@&#8203;realknove](https://github.com/realknove)! - Fixed [#&#8203;10193](biomejs/biome#10193): `style/useReadonlyClassProperties` no longer reports class properties as readonly-able when they are assigned inside arrow callbacks nested in class property initializers.

- [#&#8203;9574](biomejs/biome#9574) [`3bd2b6a`](biomejs/biome@3bd2b6a) Thanks [@&#8203;Conaclos](https://github.com/Conaclos)! - Fixed [#&#8203;9530](biomejs/biome#9530). The diagnostics of [`organizeImports`](https://biomejs.dev/assist/actions/organize-imports/) are now more detailed and more precise. They are also better at localizing where the issue is.

- [#&#8203;10205](biomejs/biome#10205) [`a704a6c`](biomejs/biome@a704a6c) Thanks [@&#8203;Conaclos](https://github.com/Conaclos)! - Fixed [#&#8203;10185](biomejs/biome#10185). [\`organizeImports](https://biomejs.dev/assist/actions/organize-imports/) now errors when it encounters an unknown predefined group.

  The following configuration is now reported as invalid because `:INEXISTENT:` is an unknown predefined group.

  ```json
  {
    "assist": {
      "actions": {
        "source": {
          "organizeImports": { "options": { "groups": [":INEXISTENT:"] } }
        }
      }
    }
  }
  ```

- [#&#8203;10052](biomejs/biome#10052) [`b565bed`](biomejs/biome@b565bed) Thanks [@&#8203;minseong0324](https://github.com/minseong0324)! - Improved [`noMisleadingReturnType`](https://biomejs.dev/linter/rules/no-misleading-return-type/): it now flags union annotations whose extra variants are never returned, and suggests the narrower type (e.g. `string | null` → `string`).

  These functions are now reported because `null` and `number` are included in the return annotations but never returned:

  ```ts
  function getUser(): string | null {
    return "hello";
  } // null is never returned
  function getCode(): string | number {
    return "hello";
  } // number is never returned
  ```

- [#&#8203;10213](biomejs/biome#10213) [`ac30057`](biomejs/biome@ac30057) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Fixed [#&#8203;9450](biomejs/biome#9450): HTML and Vue element formatting now preserves child line breaks when an element contains another element child on its own line, instead of collapsing the child element onto the same line.

- [#&#8203;10275](biomejs/biome#10275) [`9ee6c03`](biomejs/biome@9ee6c03) Thanks [@&#8203;solithcy](https://github.com/solithcy)! - Fixed [#&#8203;10274](biomejs/biome#10274): Svelte templates with missing expressions no longer parsed as `HtmlBogusElement`

- [#&#8203;10143](biomejs/biome#10143) [`56798a7`](biomejs/biome@56798a7) Thanks [@&#8203;minseong0324](https://github.com/minseong0324)! - [`noMisleadingReturnType`](https://biomejs.dev/linter/rules/no-misleading-return-type/) now detects misleading return type annotations when object literal properties are initialized with `as const`.

  This function is now reported because the return annotation widens a property initialized with `as const`:

  ```ts
  function f(): { value: string } {
    return { value: "text" as const };
  }
  ```

- [#&#8203;10143](biomejs/biome#10143) [`56798a7`](biomejs/biome@56798a7) Thanks [@&#8203;minseong0324](https://github.com/minseong0324)! - [`noUselessTypeConversion`](https://biomejs.dev/linter/rules/no-useless-type-conversion/) now detects redundant conversions on object literal properties initialized with `as const`.

  This conversion is now reported because `message.value` is inferred as a string literal:

  ```ts
  const message = { value: "text" as const };
  String(message.value);
  ```

- [#&#8203;9807](biomejs/biome#9807) [`0ae5840`](biomejs/biome@0ae5840) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added the new nursery rule [`useThisInClassMethods`](https://biomejs.dev/linter/rules/use-this-in-class-methods/), based on ESLint's `class-methods-use-this`.

  The rule now reports instance methods, getters, setters, and function-valued instance fields that do not use `this`, and `biome migrate eslint` preserves the supported `ignoreMethods`, `ignoreOverrideMethods`, and `ignoreClassesWithImplements` options.

  **Invalid**:

  ```js
  class Foo {
    bar() {
      // does not use `this`, invalid
      console.log("Hello Biome");
    }
  }
  ```

- [#&#8203;10258](biomejs/biome#10258) [`e7b18f7`](biomejs/biome@e7b18f7) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Improved linter performance by narrowing the query nodes for several lint rules, reducing how often they are evaluated.

- [#&#8203;10273](biomejs/biome#10273) [`04e22a1`](biomejs/biome@04e22a1) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Fixed [#&#8203;10271](biomejs/biome#10271): The HTML parser now correctly parses `of` as text content when in text contexts.

- [#&#8203;9838](biomejs/biome#9838) [`83f7385`](biomejs/biome@83f7385) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added the nursery rule [`noBaseToString`](https://biomejs.dev/linter/rules/no-base-to-string/), which reports stringification sites that fall back to Object's default `"[object Object]"` formatting. The rule also supports the `ignoredTypeNames` option.

- [#&#8203;10143](biomejs/biome#10143) [`56798a7`](biomejs/biome@56798a7) Thanks [@&#8203;minseong0324](https://github.com/minseong0324)! - [`useExhaustiveSwitchCases`](https://biomejs.dev/linter/rules/use-exhaustive-switch-cases/) now checks switch statements over object literal properties initialized with `as const`.

  This switch is now reported because `status.kind` is inferred as the string literal `"ready"` but no case handles it:

  ```ts
  const status = { kind: "ready" as const };
  switch (status.kind) {
  }
  ```

- [#&#8203;10143](biomejs/biome#10143) [`56798a7`](biomejs/biome@56798a7) Thanks [@&#8203;minseong0324](https://github.com/minseong0324)! - [`useStringStartsEndsWith`](https://biomejs.dev/linter/rules/use-string-starts-ends-with/) now detects string index comparisons on object literal properties initialized with `as const`.

  This comparison is now reported because `message.value` is inferred as a string literal:

  ```ts
  const message = { value: "hello" as const };
  message.value[0] === "h";
  ```

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNzMuMyIsInVwZGF0ZWRJblZlciI6IjQzLjE3My4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://git.oirnoir.dev/OIRNOIR/YouTube-Helper-Server/pulls/12
OIRNOIR pushed a commit to OIRNOIR/YouTube-Helper-Client that referenced this pull request May 13, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@biomejs/biome](https://biomejs.dev) ([source](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome)) | imports | patch | [`2.4.14` -> `2.4.15`](https://renovatebot.com/diffs/npm/@biomejs%2fbiome/2.4.14/2.4.15) |

---

### Release Notes

<details>
<summary>biomejs/biome (@&#8203;biomejs/biome)</summary>

### [`v2.4.15`](https://github.com/biomejs/biome/blob/HEAD/packages/@&#8203;biomejs/biome/CHANGELOG.md#2415)

[Compare Source](https://github.com/biomejs/biome/compare/@biomejs/biome@2.4.14...@biomejs/biome@2.4.15)

##### Patch Changes

- [#&#8203;9394](biomejs/biome#9394) [`ba3480e`](biomejs/biome@ba3480e) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added the nursery rule [`useTestHooksInOrder`](https://biomejs.dev/linter/rules/use-test-hooks-in-order) in the `test` domain. The rule enforces that Jest/Vitest lifecycle hooks (`beforeAll`, `beforeEach`, `afterEach`, `afterAll`) are declared in the order they execute, making test setup and teardown easier to reason about.

- [#&#8203;10254](biomejs/biome#10254) [`e0a54cc`](biomejs/biome@e0a54cc) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added a new nursery rule [`useVueNextTickPromise`](https://biomejs.dev/linter/rules/use-vue-next-tick-promise/), which enforces Promise syntax when using Vue `nextTick`.

  For example, the following snippet triggers the rule:

  ```js
  import { nextTick } from "vue";

  nextTick(() => {
    updateDom();
  });
  ```

- [#&#8203;10219](biomejs/biome#10219) [`64aee45`](biomejs/biome@64aee45) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added a new nursery rule [`noVueVOnNumberValues`](https://biomejs.dev/linter/rules/no-vue-v-on-number-values/), that disallows deprecated number modifiers on Vue `v-on` directives.

  For example, the following snippet triggers the rule:

  ```vue
  <input @&#8203;keyup.13="submit" />
  ```

- [#&#8203;10195](biomejs/biome#10195) [`7b8d4e1`](biomejs/biome@7b8d4e1) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added the new nursery rule [`useVueValidVFor`](https://biomejs.dev/linter/rules/use-vue-valid-v-for/), which validates Vue `v-for` directives and reports invalid aliases, missing component keys, and keys that do not use iteration variables.

- [#&#8203;10238](biomejs/biome#10238) [`1110256`](biomejs/biome@1110256) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added the recommended nursery rule [`noVueImportCompilerMacros`](https://biomejs.dev/linter/rules/no-vue-import-compiler-macros/), which disallows importing Vue compiler macros such as `defineProps` from `vue` because they are automatically available.

- [#&#8203;10201](biomejs/biome#10201) [`1a08f89`](biomejs/biome@1a08f89) Thanks [@&#8203;realknove](https://github.com/realknove)! - Fixed [#&#8203;10193](biomejs/biome#10193): `style/useReadonlyClassProperties` no longer reports class properties as readonly-able when they are assigned inside arrow callbacks nested in class property initializers.

- [#&#8203;9574](biomejs/biome#9574) [`3bd2b6a`](biomejs/biome@3bd2b6a) Thanks [@&#8203;Conaclos](https://github.com/Conaclos)! - Fixed [#&#8203;9530](biomejs/biome#9530). The diagnostics of [`organizeImports`](https://biomejs.dev/assist/actions/organize-imports/) are now more detailed and more precise. They are also better at localizing where the issue is.

- [#&#8203;10205](biomejs/biome#10205) [`a704a6c`](biomejs/biome@a704a6c) Thanks [@&#8203;Conaclos](https://github.com/Conaclos)! - Fixed [#&#8203;10185](biomejs/biome#10185). [\`organizeImports](https://biomejs.dev/assist/actions/organize-imports/) now errors when it encounters an unknown predefined group.

  The following configuration is now reported as invalid because `:INEXISTENT:` is an unknown predefined group.

  ```json
  {
    "assist": {
      "actions": {
        "source": {
          "organizeImports": { "options": { "groups": [":INEXISTENT:"] } }
        }
      }
    }
  }
  ```

- [#&#8203;10052](biomejs/biome#10052) [`b565bed`](biomejs/biome@b565bed) Thanks [@&#8203;minseong0324](https://github.com/minseong0324)! - Improved [`noMisleadingReturnType`](https://biomejs.dev/linter/rules/no-misleading-return-type/): it now flags union annotations whose extra variants are never returned, and suggests the narrower type (e.g. `string | null` → `string`).

  These functions are now reported because `null` and `number` are included in the return annotations but never returned:

  ```ts
  function getUser(): string | null {
    return "hello";
  } // null is never returned
  function getCode(): string | number {
    return "hello";
  } // number is never returned
  ```

- [#&#8203;10213](biomejs/biome#10213) [`ac30057`](biomejs/biome@ac30057) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Fixed [#&#8203;9450](biomejs/biome#9450): HTML and Vue element formatting now preserves child line breaks when an element contains another element child on its own line, instead of collapsing the child element onto the same line.

- [#&#8203;10275](biomejs/biome#10275) [`9ee6c03`](biomejs/biome@9ee6c03) Thanks [@&#8203;solithcy](https://github.com/solithcy)! - Fixed [#&#8203;10274](biomejs/biome#10274): Svelte templates with missing expressions no longer parsed as `HtmlBogusElement`

- [#&#8203;10143](biomejs/biome#10143) [`56798a7`](biomejs/biome@56798a7) Thanks [@&#8203;minseong0324](https://github.com/minseong0324)! - [`noMisleadingReturnType`](https://biomejs.dev/linter/rules/no-misleading-return-type/) now detects misleading return type annotations when object literal properties are initialized with `as const`.

  This function is now reported because the return annotation widens a property initialized with `as const`:

  ```ts
  function f(): { value: string } {
    return { value: "text" as const };
  }
  ```

- [#&#8203;10143](biomejs/biome#10143) [`56798a7`](biomejs/biome@56798a7) Thanks [@&#8203;minseong0324](https://github.com/minseong0324)! - [`noUselessTypeConversion`](https://biomejs.dev/linter/rules/no-useless-type-conversion/) now detects redundant conversions on object literal properties initialized with `as const`.

  This conversion is now reported because `message.value` is inferred as a string literal:

  ```ts
  const message = { value: "text" as const };
  String(message.value);
  ```

- [#&#8203;9807](biomejs/biome#9807) [`0ae5840`](biomejs/biome@0ae5840) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added the new nursery rule [`useThisInClassMethods`](https://biomejs.dev/linter/rules/use-this-in-class-methods/), based on ESLint's `class-methods-use-this`.

  The rule now reports instance methods, getters, setters, and function-valued instance fields that do not use `this`, and `biome migrate eslint` preserves the supported `ignoreMethods`, `ignoreOverrideMethods`, and `ignoreClassesWithImplements` options.

  **Invalid**:

  ```js
  class Foo {
    bar() {
      // does not use `this`, invalid
      console.log("Hello Biome");
    }
  }
  ```

- [#&#8203;10258](biomejs/biome#10258) [`e7b18f7`](biomejs/biome@e7b18f7) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Improved linter performance by narrowing the query nodes for several lint rules, reducing how often they are evaluated.

- [#&#8203;10273](biomejs/biome#10273) [`04e22a1`](biomejs/biome@04e22a1) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Fixed [#&#8203;10271](biomejs/biome#10271): The HTML parser now correctly parses `of` as text content when in text contexts.

- [#&#8203;9838](biomejs/biome#9838) [`83f7385`](biomejs/biome@83f7385) Thanks [@&#8203;dyc3](https://github.com/dyc3)! - Added the nursery rule [`noBaseToString`](https://biomejs.dev/linter/rules/no-base-to-string/), which reports stringification sites that fall back to Object's default `"[object Object]"` formatting. The rule also supports the `ignoredTypeNames` option.

- [#&#8203;10143](biomejs/biome#10143) [`56798a7`](biomejs/biome@56798a7) Thanks [@&#8203;minseong0324](https://github.com/minseong0324)! - [`useExhaustiveSwitchCases`](https://biomejs.dev/linter/rules/use-exhaustive-switch-cases/) now checks switch statements over object literal properties initialized with `as const`.

  This switch is now reported because `status.kind` is inferred as the string literal `"ready"` but no case handles it:

  ```ts
  const status = { kind: "ready" as const };
  switch (status.kind) {
  }
  ```

- [#&#8203;10143](biomejs/biome#10143) [`56798a7`](biomejs/biome@56798a7) Thanks [@&#8203;minseong0324](https://github.com/minseong0324)! - [`useStringStartsEndsWith`](https://biomejs.dev/linter/rules/use-string-starts-ends-with/) now detects string index comparisons on object literal properties initialized with `as const`.

  This comparison is now reported because `message.value` is inferred as a string literal:

  ```ts
  const message = { value: "hello" as const };
  message.value[0] === "h";
  ```

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNzMuMyIsInVwZGF0ZWRJblZlciI6IjQzLjE3My4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://git.oirnoir.dev/OIRNOIR/YouTube-Helper-Client/pulls/3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Linter Area: linter A-LSP Area: language server protocol L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 organizeImports reported on first import for unsorted exports

2 participants