diff --git a/CHANGELOG.md b/CHANGELOG.md index f97e3eed9915..fad0a944e1c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,6 +79,10 @@ our [guidelines for writing a good changelog entry](https://github.com/biomejs/b Contributed by @Conaclos +#### Enhancements + +- `useExportType` and `useImportType` now ignore TypeScript declaration files ([#4416](https://github.com/biomejs/biome/pull/4416)). Contributed by @Conaclos + ### Parser #### Bug fixes diff --git a/crates/biome_js_analyze/src/lint/style/use_export_type.rs b/crates/biome_js_analyze/src/lint/style/use_export_type.rs index d47077b45120..08d71641ac84 100644 --- a/crates/biome_js_analyze/src/lint/style/use_export_type.rs +++ b/crates/biome_js_analyze/src/lint/style/use_export_type.rs @@ -79,7 +79,7 @@ impl Rule for UseExportType { fn run(ctx: &RuleContext) -> Self::Signals { let source_type = ctx.source_type::(); - if !source_type.language().is_typescript() { + if !source_type.language().is_typescript() || source_type.language().is_definition_file() { return None; } let export_named_clause = ctx.query(); diff --git a/crates/biome_js_analyze/src/lint/style/use_import_type.rs b/crates/biome_js_analyze/src/lint/style/use_import_type.rs index 3bf082d239af..cea7adaadc36 100644 --- a/crates/biome_js_analyze/src/lint/style/use_import_type.rs +++ b/crates/biome_js_analyze/src/lint/style/use_import_type.rs @@ -128,7 +128,7 @@ impl Rule for UseImportType { fn run(ctx: &RuleContext) -> Self::Signals { let source_type = ctx.source_type::(); - if !source_type.language().is_typescript() { + if !source_type.language().is_typescript() || source_type.language().is_definition_file() { return None; } let import = ctx.query();