diff --git a/crates/oxc_linter/src/service/runtime.rs b/crates/oxc_linter/src/service/runtime.rs index 2e012b455cfe2f..0c832e07878207 100644 --- a/crates/oxc_linter/src/service/runtime.rs +++ b/crates/oxc_linter/src/service/runtime.rs @@ -11,7 +11,7 @@ use oxc_allocator::Allocator; use oxc_diagnostics::{DiagnosticSender, DiagnosticService, Error, OxcDiagnostic}; use oxc_parser::{ParseOptions, Parser}; use oxc_resolver::Resolver; -use oxc_semantic::SemanticBuilder; +use oxc_semantic::{ModuleRecord, SemanticBuilder}; use oxc_span::{SourceType, VALID_EXTENSIONS}; use rayon::{iter::ParallelBridge, prelude::ParallelIterator}; use rustc_hash::FxHashSet; @@ -199,6 +199,7 @@ impl Runtime { .parse(); if !ret.errors.is_empty() { + self.modules.add_resolved_module(path, Arc::new(ModuleRecord::default())); return if ret.is_flow_language { vec![] } else {