Skip to content

🐛 Imports are not sorted in declare module #10038

@ricewind012

Description

@ricewind012

Environment information

Details
CLI:
  Version:                      2.4.12
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_PATH:                    unset
  BIOME_LOG_PREFIX_NAME:             unset
  BIOME_LOG_LEVEL:                   unset
  BIOME_LOG_KIND:                    unset
  BIOME_CONFIG_PATH:                 unset
  BIOME_THREADS:                     unset
  BIOME_WATCHER_KIND:                unset
  BIOME_WATCHER_POLLING_INTERVAL:    unset
  NO_COLOR:                     unset
  TERM:                         xterm-256color
  JS_RUNTIME_VERSION:           v25.9.0
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         npm/11.12.1

Biome Configuration:
  Status:                       Loaded successfully
  Path:                         biome.json
  Formatter enabled:            true
  Linter enabled:               true
  Assist enabled:               true
  VCS enabled:                  false
  HTML full support enabled:    unset

Workspace:
  Open Documents:               0

What happened?

  1. Run npx biome check --write in https://github.com/ricewind012/biome-repro-1776541185798
  2. See no errors in output

Expected result

src/index.ts should be formatted as the following:

declare module "awesome" {
	export interface AwesomeClient {}
	export interface AwesomeScreen {}
}

declare module "wibox" {
	export interface Wibox {}
}

declare module "naughty" {
	import type { AwesomeClient, AwesomeScreen } from "awesome";
	import type { Wibox } from "wibox";

	type Drawable = AwesomeClient | AwesomeScreen | Wibox;
}

The workaround is to put the imports in top level, then bring them back in declare module.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

Labels

S-Bug-confirmedStatus: report has been confirmed as a valid bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions