From 8cdb309ffd6686b2f3c4a2126d927fd5770be34d Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 25 Sep 2024 09:04:57 -0400 Subject: fix(check): properly surface dependency errors in types file of js file (#25860) We weren't surfacing dependency errors in types files of js files. --- cli/graph_util.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'cli/graph_util.rs') diff --git a/cli/graph_util.rs b/cli/graph_util.rs index cd98c3824..1add83eb9 100644 --- a/cli/graph_util.rs +++ b/cli/graph_util.rs @@ -55,7 +55,7 @@ use std::sync::Arc; #[derive(Clone, Copy)] pub struct GraphValidOptions { pub check_js: bool, - pub follow_type_only: bool, + pub kind: GraphKind, pub is_vendoring: bool, /// Whether to exit the process for lockfile errors. /// Otherwise, surfaces lockfile errors as errors. @@ -84,7 +84,7 @@ pub fn graph_valid( roots.iter(), deno_graph::WalkOptions { check_js: options.check_js, - follow_type_only: options.follow_type_only, + kind: options.kind, follow_dynamic: options.is_vendoring, prefer_fast_check_graph: false, }, @@ -708,7 +708,11 @@ impl ModuleGraphBuilder { roots, GraphValidOptions { is_vendoring: false, - follow_type_only: self.options.type_check_mode().is_true(), + kind: if self.options.type_check_mode().is_true() { + GraphKind::All + } else { + GraphKind::CodeOnly + }, check_js: self.options.check_js(), exit_lockfile_errors: true, }, @@ -928,7 +932,7 @@ pub fn has_graph_root_local_dependent_changed( std::iter::once(root), deno_graph::WalkOptions { follow_dynamic: true, - follow_type_only: true, + kind: GraphKind::All, prefer_fast_check_graph: true, check_js: true, }, -- cgit v1.2.3