From 878384aefaafacb2dc875ba1d7ea9d4af01d2cf0 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 1 Mar 2024 10:54:46 -0500 Subject: [PATCH] fix(unstable/publish): repect `--no-check` in no-slow-types (#22653) --- cli/tools/check.rs | 3 +-- cli/tools/registry/mod.rs | 4 +--- tests/testdata/publish/successful_no_check.out | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cli/tools/check.rs b/cli/tools/check.rs index 68bf9716ee..ec44900177 100644 --- a/cli/tools/check.rs +++ b/cli/tools/check.rs @@ -99,8 +99,7 @@ impl TypeChecker { mut graph: ModuleGraph, options: CheckOptions, ) -> Result<(Arc, Diagnostics), AnyError> { - debug_assert_ne!(options.type_check_mode, TypeCheckMode::None); - if graph.roots.is_empty() { + if !options.type_check_mode.is_true() || graph.roots.is_empty() { return Ok((graph.into(), Default::default())); } diff --git a/cli/tools/registry/mod.rs b/cli/tools/registry/mod.rs index dfbfd7ab2a..dcfde2297a 100644 --- a/cli/tools/registry/mod.rs +++ b/cli/tools/registry/mod.rs @@ -30,7 +30,6 @@ use crate::args::jsr_url; use crate::args::CliOptions; use crate::args::Flags; use crate::args::PublishFlags; -use crate::args::TypeCheckMode; use crate::cache::LazyGraphSourceParser; use crate::cache::ParsedSourceCache; use crate::factory::CliFactory; @@ -860,8 +859,7 @@ async fn build_and_check_graph_for_publish( lib: cli_options.ts_type_lib_window(), log_ignored_options: false, reload: cli_options.reload_flag(), - // force type checking this - type_check_mode: TypeCheckMode::Local, + type_check_mode: cli_options.type_check_mode(), }, ) .await?; diff --git a/tests/testdata/publish/successful_no_check.out b/tests/testdata/publish/successful_no_check.out index 1dd6168eb0..01c53a9ba7 100644 --- a/tests/testdata/publish/successful_no_check.out +++ b/tests/testdata/publish/successful_no_check.out @@ -1,5 +1,4 @@ Checking for slow types in the public API... -Check file:///[WILDCARD]/publish/successful/mod.ts Publishing @foo/bar@1.0.0 ... Successfully published @foo/bar@1.0.0 Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details