Biome formatter does not sort imports #5024

Closed
opened 2026-02-16 17:47:49 -05:00 by yindo · 0 comments
Owner

Originally created by @kynnyhsap on GitHub (Jan 12, 2026).

Originally assigned to: @thdxr on GitHub.

Description

The biome formatter is configured to use biome format --write which only formats code but does not sort imports. When using the edit tool, this causes errors like The imports and exports are not sorted. because biome format does not handle import sorting.

Using biome check --write would format AND sort imports, fixing this issue.

And here is a fix: https://github.com/anomalyco/opencode/pull/8057

Plugins

biome formatter

OpenCode version

1.1.14

Steps to reproduce

  1. Run opencode in a project with biome.json and this configuration:
{
  "assist": {
    "enabled": true,
    "actions": {
      "source": {
        "organizeImports": "on"
      }
    }
  }
}
  1. Use the edit tool to make changes to a file with unsorted imports
  2. See the error: The imports and exports are not sorted.

Operating System

macOS 26.1

Terminal

ghostty

Originally created by @kynnyhsap on GitHub (Jan 12, 2026). Originally assigned to: @thdxr on GitHub. ## Description The biome formatter is configured to use `biome format --write` which only formats code but does not sort imports. When using the edit tool, this causes errors like `The imports and exports are not sorted.` because biome format does not handle import sorting. Using `biome check --write` would format AND sort imports, fixing this issue. And here is a fix: https://github.com/anomalyco/opencode/pull/8057 ## Plugins biome formatter ## OpenCode version 1.1.14 ## Steps to reproduce 1. Run opencode in a project with biome.json and this configuration: ```json { "assist": { "enabled": true, "actions": { "source": { "organizeImports": "on" } } } } ``` 2. Use the `edit` tool to make changes to a file with unsorted imports 3. See the error: `The imports and exports are not sorted.` ## Operating System macOS 26.1 ## Terminal ghostty
yindo closed this issue 2026-02-16 17:47:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#5024