From 4a0a412d7cd077ff519b4da8f6ffd1247c6375a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 13 Jun 2022 23:13:16 +0200 Subject: feat: no type-check by default (#14691) This commit changes default default behavior of type checking for several subcommands. Instead of type checking and reporting type errors only for local files, the type checking is skipped entirely. Type checking can still be enabled using the "--check" flag. Following subcomands are affected: - deno cache - deno install - deno eval - deno run --- cli/tools/installer.rs | 37 +++++++++++++------------------------ cli/tools/standalone.rs | 4 ---- 2 files changed, 13 insertions(+), 28 deletions(-) (limited to 'cli/tools') diff --git a/cli/tools/installer.rs b/cli/tools/installer.rs index bf39abc65..962f16ce3 100644 --- a/cli/tools/installer.rs +++ b/cli/tools/installer.rs @@ -513,12 +513,11 @@ mod tests { println!("this is the file path {:?}", content); if cfg!(windows) { assert!(content.contains( - r#""run" "--check" "--unstable" "http://localhost:4545/echo_server.ts""# + r#""run" "--unstable" "http://localhost:4545/echo_server.ts""# )); } else { - assert!(content.contains( - r#"run --check --unstable 'http://localhost:4545/echo_server.ts'"# - )); + assert!(content + .contains(r#"run --unstable 'http://localhost:4545/echo_server.ts'"#)); } } @@ -539,7 +538,7 @@ mod tests { assert_eq!(shim_data.name, "echo_server"); assert_eq!( shim_data.args, - vec!["run", "--check", "http://localhost:4545/echo_server.ts",] + vec!["run", "http://localhost:4545/echo_server.ts",] ); } @@ -560,7 +559,7 @@ mod tests { assert_eq!(shim_data.name, "subdir"); assert_eq!( shim_data.args, - vec!["run", "--check", "http://localhost:4545/subdir/main.ts",] + vec!["run", "http://localhost:4545/subdir/main.ts",] ); } @@ -581,7 +580,7 @@ mod tests { assert_eq!(shim_data.name, "echo_test"); assert_eq!( shim_data.args, - vec!["run", "--check", "http://localhost:4545/echo_server.ts",] + vec!["run", "http://localhost:4545/echo_server.ts",] ); } @@ -640,12 +639,7 @@ mod tests { assert_eq!( shim_data.args, - vec![ - "run", - "--check", - "--no-prompt", - "http://localhost:4545/echo_server.ts", - ] + vec!["run", "--no-prompt", "http://localhost:4545/echo_server.ts",] ); } @@ -668,12 +662,7 @@ mod tests { assert_eq!( shim_data.args, - vec![ - "run", - "--allow-all", - "--check", - "http://localhost:4545/echo_server.ts", - ] + vec!["run", "--allow-all", "http://localhost:4545/echo_server.ts",] ); } @@ -836,8 +825,9 @@ mod tests { if cfg!(windows) { // TODO: see comment above this test } else { - assert!(content - .contains(r#"run --check 'http://localhost:4545/echo_server.ts' '"'"#)); + assert!( + content.contains(r#"run 'http://localhost:4545/echo_server.ts' '"'"#) + ); } } @@ -956,10 +946,9 @@ mod tests { } assert!(file_path.exists()); - let mut expected_string = format!("run --check '{}'", &file_module_string); + let mut expected_string = format!("run '{}'", &file_module_string); if cfg!(windows) { - expected_string = - format!("\"run\" \"--check\" \"{}\"", &file_module_string); + expected_string = format!("\"run\" \"{}\"", &file_module_string); } let content = fs::read_to_string(file_path).unwrap(); diff --git a/cli/tools/standalone.rs b/cli/tools/standalone.rs index 3a8faa8a3..e29545b2f 100644 --- a/cli/tools/standalone.rs +++ b/cli/tools/standalone.rs @@ -4,7 +4,6 @@ use crate::deno_dir::DenoDir; use crate::flags::CompileFlags; use crate::flags::DenoSubcommand; use crate::flags::Flags; -use crate::flags::FutureTypeCheckMode; use crate::flags::RunFlags; use crate::flags::TypeCheckMode; use crate::fs_util; @@ -275,10 +274,7 @@ pub fn compile_to_runtime_flags( lock_write: false, lock: None, log_level: flags.log_level, - has_no_check_flag: false, - has_check_flag: false, type_check_mode: TypeCheckMode::Local, - future_type_check_mode: FutureTypeCheckMode::None, compat: flags.compat, unsafely_ignore_certificate_errors: flags .unsafely_ignore_certificate_errors -- cgit v1.2.3