Skip to content

Commit

Permalink
refactor(useImportType,useExportType): ignore dts (#4418)
Browse files Browse the repository at this point in the history
  • Loading branch information
Conaclos authored Oct 29, 2024
1 parent f543f12 commit d780164
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_js_analyze/src/lint/style/use_export_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl Rule for UseExportType {

fn run(ctx: &RuleContext<Self>) -> Self::Signals {
let source_type = ctx.source_type::<JsFileSource>();
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();
Expand Down
2 changes: 1 addition & 1 deletion crates/biome_js_analyze/src/lint/style/use_import_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl Rule for UseImportType {

fn run(ctx: &RuleContext<Self>) -> Self::Signals {
let source_type = ctx.source_type::<JsFileSource>();
if !source_type.language().is_typescript() {
if !source_type.language().is_typescript() || source_type.language().is_definition_file() {
return None;
}
let import = ctx.query();
Expand Down

0 comments on commit d780164

Please sign in to comment.