diff options
Diffstat (limited to 'cli/tools')
-rw-r--r-- | cli/tools/bench.rs | 8 | ||||
-rw-r--r-- | cli/tools/bundle.rs | 3 | ||||
-rw-r--r-- | cli/tools/compile.rs | 7 | ||||
-rw-r--r-- | cli/tools/test.rs | 8 |
4 files changed, 6 insertions, 20 deletions
diff --git a/cli/tools/bench.rs b/cli/tools/bench.rs index 6461e544f..a7b75d8be 100644 --- a/cli/tools/bench.rs +++ b/cli/tools/bench.rs @@ -2,7 +2,6 @@ use crate::args::BenchOptions; use crate::args::CliOptions; -use crate::args::TypeCheckMode; use crate::colors; use crate::display::write_json_to_stdout; use crate::factory::CliFactory; @@ -31,7 +30,6 @@ use deno_core::task::spawn; use deno_core::task::spawn_blocking; use deno_core::v8; use deno_core::ModuleSpecifier; -use deno_graph::GraphKind; use deno_runtime::permissions::Permissions; use deno_runtime::permissions::PermissionsContainer; use deno_runtime::tokio_util::create_and_run_current_thread; @@ -694,11 +692,7 @@ pub async fn run_benchmarks_with_watch( // file would have impact on other files, which is undesirable. let permissions = Permissions::from_options(&cli_options.permissions_options())?; - let type_check = cli_options.type_check_mode() != TypeCheckMode::None; - let graph_kind = match type_check { - true => GraphKind::All, - false => GraphKind::CodeOnly, - }; + let graph_kind = cli_options.type_check_mode().as_graph_kind(); let resolver = |changed: Option<Vec<PathBuf>>| { let paths_to_watch = bench_options.files.include.clone(); diff --git a/cli/tools/bundle.rs b/cli/tools/bundle.rs index 759882c83..f38948776 100644 --- a/cli/tools/bundle.rs +++ b/cli/tools/bundle.rs @@ -12,7 +12,6 @@ use crate::args::BundleFlags; use crate::args::CliOptions; use crate::args::Flags; use crate::args::TsConfigType; -use crate::args::TypeCheckMode; use crate::factory::CliFactory; use crate::graph_util::error_for_any_npm_specifier; use crate::util; @@ -157,7 +156,7 @@ fn bundle_module_graph( let ts_config_result = cli_options.resolve_ts_config_for_emit(TsConfigType::Bundle)?; - if cli_options.type_check_mode() == TypeCheckMode::None { + if !cli_options.type_check_mode().is_true() { if let Some(ignored_options) = ts_config_result.maybe_ignored_options { log::warn!("{}", ignored_options); } diff --git a/cli/tools/compile.rs b/cli/tools/compile.rs index 540c23fc8..c53ae4e02 100644 --- a/cli/tools/compile.rs +++ b/cli/tools/compile.rs @@ -2,7 +2,6 @@ use crate::args::CompileFlags; use crate::args::Flags; -use crate::args::TypeCheckMode; use crate::factory::CliFactory; use crate::standalone::is_standalone_binary; use crate::util::path::path_has_trailing_slash; @@ -50,15 +49,15 @@ pub async fn compile( .await?, ) .unwrap(); - let graph = if cli_options.type_check_mode() == TypeCheckMode::None { - graph - } else { + let graph = if cli_options.type_check_mode().is_true() { // In this case, the previous graph creation did type checking, which will // create a module graph with types information in it. We don't want to // store that in the eszip so create a code only module graph from scratch. module_graph_builder .create_graph(GraphKind::CodeOnly, module_roots) .await? + } else { + graph }; let parser = parsed_source_cache.as_capturing_parser(); diff --git a/cli/tools/test.rs b/cli/tools/test.rs index bc8f68599..ebe4deb9a 100644 --- a/cli/tools/test.rs +++ b/cli/tools/test.rs @@ -3,7 +3,6 @@ use crate::args::CliOptions; use crate::args::FilesConfig; use crate::args::TestOptions; -use crate::args::TypeCheckMode; use crate::colors; use crate::display; use crate::factory::CliFactory; @@ -39,7 +38,6 @@ use deno_core::task::spawn_blocking; use deno_core::url::Url; use deno_core::v8; use deno_core::ModuleSpecifier; -use deno_graph::GraphKind; use deno_runtime::deno_io::Stdio; use deno_runtime::deno_io::StdioPipe; use deno_runtime::fmt_errors::format_js_error; @@ -1707,11 +1705,7 @@ pub async fn run_tests_with_watch( // file would have impact on other files, which is undesirable. let permissions = Permissions::from_options(&cli_options.permissions_options())?; - let type_check = cli_options.type_check_mode() != TypeCheckMode::None; - let graph_kind = match type_check { - true => GraphKind::All, - false => GraphKind::CodeOnly, - }; + let graph_kind = cli_options.type_check_mode().as_graph_kind(); let log_level = cli_options.log_level(); let resolver = |changed: Option<Vec<PathBuf>>| { |