diff --git a/crates/oxc_linter/src/rules/typescript/consistent_type_imports.rs b/crates/oxc_linter/src/rules/typescript/consistent_type_imports.rs index 607643b279a45..0c29635f85a5b 100644 --- a/crates/oxc_linter/src/rules/typescript/consistent_type_imports.rs +++ b/crates/oxc_linter/src/rules/typescript/consistent_type_imports.rs @@ -1517,6 +1517,14 @@ fn test() { // ", // None, // ), + ( + "import { Bar } from './bar'; +export type { Baz } from './baz'; + +export class Foo extends Bar {} +", + None, + ), ]; let fail = vec![ diff --git a/crates/oxc_semantic/src/builder.rs b/crates/oxc_semantic/src/builder.rs index 9503630f0f2ff..3dcd0aec126d2 100644 --- a/crates/oxc_semantic/src/builder.rs +++ b/crates/oxc_semantic/src/builder.rs @@ -491,7 +491,6 @@ impl<'a> SemanticBuilder<'a> { let symbol_flags = self.symbols.get_flags(symbol_id); references.retain(|&reference_id| { let reference = &mut self.symbols.references[reference_id]; - let flags = reference.flags_mut(); // Determine the symbol whether can be referenced by this reference. @@ -1880,6 +1879,9 @@ impl<'a> Visit<'a> for SemanticBuilder<'a> { if let Some(with_clause) = &it.with_clause { self.visit_with_clause(with_clause); } + if it.source.is_some() { + mem::take(&mut self.current_reference_flags); + } self.leave_node(kind); }