summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-03-29 03:48:29 +0200
committerGitHub <noreply@github.com>2022-03-29 03:48:29 +0200
commit381d565acf974b0eab2a9b7fdcf8f9372cad0c33 (patch)
treee6183cfdb613b7a20cdaf285744e6cba0273f467 /cli/main.rs
parent5a6a1eeb3918985ab003fd8d87faebb76410a242 (diff)
refactor(flags): rename CheckFlag to TypecheckMode (#14111)
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs20
1 files changed, 14 insertions, 6 deletions
diff --git a/cli/main.rs b/cli/main.rs
index 49ad7f519..0435775ad 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -43,7 +43,6 @@ use crate::file_watcher::ResolutionResult;
use crate::flags::BenchFlags;
use crate::flags::BundleFlags;
use crate::flags::CacheFlags;
-use crate::flags::CheckFlag;
use crate::flags::CompileFlags;
use crate::flags::CompletionsFlags;
use crate::flags::CoverageFlags;
@@ -59,6 +58,7 @@ use crate::flags::ReplFlags;
use crate::flags::RunFlags;
use crate::flags::TaskFlags;
use crate::flags::TestFlags;
+use crate::flags::TypecheckMode;
use crate::flags::UninstallFlags;
use crate::flags::UpgradeFlags;
use crate::flags::VendorFlags;
@@ -677,10 +677,14 @@ async fn create_graph_and_maybe_check(
.as_ref()
.map(|cf| cf.get_check_js())
.unwrap_or(false);
- graph_valid(&graph, ps.flags.check != CheckFlag::None, check_js)?;
+ graph_valid(
+ &graph,
+ ps.flags.typecheck_mode != TypecheckMode::None,
+ check_js,
+ )?;
graph_lock_or_exit(&graph);
- if ps.flags.check != CheckFlag::None {
+ if ps.flags.typecheck_mode != TypecheckMode::None {
let lib = if ps.flags.unstable {
emit::TypeLib::UnstableDenoWindow
} else {
@@ -704,7 +708,7 @@ async fn create_graph_and_maybe_check(
Arc::new(RwLock::new(graph.as_ref().into())),
&mut cache,
emit::CheckOptions {
- check: ps.flags.check.clone(),
+ typecheck_mode: ps.flags.typecheck_mode.clone(),
debug,
emit_with_diagnostics: false,
maybe_config_specifier,
@@ -735,7 +739,7 @@ fn bundle_module_graph(
ps.maybe_config_file.as_ref(),
None,
)?;
- if flags.check == CheckFlag::None {
+ if flags.typecheck_mode == TypecheckMode::None {
if let Some(ignored_options) = maybe_ignored_options {
eprintln!("{}", ignored_options);
}
@@ -1004,7 +1008,11 @@ async fn run_with_watch(flags: Flags, script: String) -> Result<i32, AnyError> {
.as_ref()
.map(|cf| cf.get_check_js())
.unwrap_or(false);
- graph_valid(&graph, ps.flags.check != flags::CheckFlag::None, check_js)?;
+ graph_valid(
+ &graph,
+ ps.flags.typecheck_mode != flags::TypecheckMode::None,
+ check_js,
+ )?;
// Find all local files in graph
let mut paths_to_watch: Vec<PathBuf> = graph