diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-10-24 17:43:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-24 21:43:19 +0000 |
commit | 59a5fe530f92e4207cc30be24158c0a809e37e5b (patch) | |
tree | aeb392146e7f24c5a0a712e1fe3014f8c63ce36a /cli/graph_util.rs | |
parent | a7bd0cf7a890eff0133242d09e71b2783350fd23 (diff) |
refactor: upgrade to deno_ast 0.31 and deno_graph 0.59 (#20965)
Diffstat (limited to 'cli/graph_util.rs')
-rw-r--r-- | cli/graph_util.rs | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/cli/graph_util.rs b/cli/graph_util.rs index a7c230e17..9a2b805fd 100644 --- a/cli/graph_util.rs +++ b/cli/graph_util.rs @@ -92,15 +92,23 @@ pub fn graph_valid( .errors() .flat_map(|error| { let is_root = match &error { - ModuleGraphError::ResolutionError(_) => false, + ModuleGraphError::ResolutionError(_) + | ModuleGraphError::TypesResolutionError(_) => false, ModuleGraphError::ModuleError(error) => { roots.contains(error.specifier()) } }; - let mut message = if let ModuleGraphError::ResolutionError(err) = &error { - enhanced_resolution_error_message(err) - } else { - format!("{error}") + let mut message = match &error { + ModuleGraphError::ResolutionError(resolution_error) => { + enhanced_resolution_error_message(resolution_error) + } + ModuleGraphError::TypesResolutionError(resolution_error) => { + format!( + "Failed resolving types. {}", + enhanced_resolution_error_message(resolution_error,) + ) + } + ModuleGraphError::ModuleError(_) => format!("{error}"), }; if let Some(range) = error.maybe_range() { @@ -125,14 +133,18 @@ pub fn graph_valid( } // ignore invalid downgrades and invalid local imports when vendoring - if let ModuleGraphError::ResolutionError(err) = &error { - if matches!( - err, - ResolutionError::InvalidDowngrade { .. } - | ResolutionError::InvalidLocalImport { .. } - ) { - return None; + match &error { + ModuleGraphError::ResolutionError(err) + | ModuleGraphError::TypesResolutionError(err) => { + if matches!( + err, + ResolutionError::InvalidDowngrade { .. } + | ResolutionError::InvalidLocalImport { .. } + ) { + return None; + } } + ModuleGraphError::ModuleError(_) => {} } } |