Skip to content

💅 biome check --write --unsafe hangs with useConsistentTypeDefinitions rule #8759

@dqunbp

Description

@dqunbp

Environment

  • Biome CLI version: 2.3.11
  • OS: macOS Darwin 25.2.0 (Apple Silicon)
  • Node.js: v22.x

Description

Running biome check --write --unsafe causes Biome to hang indefinitely when the useConsistentTypeDefinitions rule is enabled and there are files with empty type aliases like type Foo = {}.

The issue does NOT occur with:

  • biome check (without flags) - works fine
  • biome check --write (without --unsafe) - works fine

Only --unsafe flag causes the hang.

Minimal Reproduction

test.tsx:

type EmptyProps = {}

function Component({}: EmptyProps) {
	return <div>test</div>
}

biome.json:

{
	"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
	"linter": {
		"enabled": true,
		"rules": {
			"style": {
				"useConsistentTypeDefinitions": "error"
			}
		}
	}
}

Command:

biome check --write --unsafe test.tsx
# Hangs indefinitely

Expected Behavior

Biome should apply the unsafe fix (converting type to interface or vice versa) and exit.

Actual Behavior

Biome hangs indefinitely, consuming CPU. The process never exits and must be killed manually.

Workaround

Disable the useConsistentTypeDefinitions rule:

{
	"linter": {
		"rules": {
			"style": {
				"useConsistentTypeDefinitions": "off"
			}
		}
	}
}

Related Issues

Metadata

Metadata

Assignees

Labels

A-LinterArea: linterL-JavaScriptLanguage: JavaScript and super languagesS-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