diff --git a/cli/flags.rs b/cli/flags.rs index f6cebae469..8c24000570 100644 --- a/cli/flags.rs +++ b/cli/flags.rs @@ -476,7 +476,7 @@ fn info_parse(flags: &mut Flags, matches: &clap::ArgMatches) { ca_file_arg_parse(flags, matches); unstable_arg_parse(flags, matches); let json = matches.is_present("json"); - flags.no_check = true; + no_check_arg_parse(flags, matches); flags.subcommand = DenoSubcommand::Info { file: matches.value_of("file").map(|f| f.to_string()), json, @@ -870,10 +870,7 @@ TypeScript compiler cache: Subdirectory containing TS compiler output.", .arg(Arg::with_name("file").takes_value(true).required(false)) .arg(reload_arg().requires("file")) .arg(ca_file_arg()) - // TODO(nayeemrmn): `--no-check` has been removed for `deno info`, but it - // shouldn't cause flag parsing to fail for backward-compatibility. Remove - // this line for v2.0.0. - .arg(no_check_arg().hidden(true)) + .arg(no_check_arg()) .arg(unstable_arg()) .arg( Arg::with_name("json") @@ -1907,7 +1904,6 @@ mod tests { json: false, file: Some("script.ts".to_string()), }, - no_check: true, ..Flags::default() } ); @@ -1921,7 +1917,6 @@ mod tests { file: Some("script.ts".to_string()), }, reload: true, - no_check: true, ..Flags::default() } ); @@ -1934,7 +1929,6 @@ mod tests { json: true, file: Some("script.ts".to_string()), }, - no_check: true, ..Flags::default() } ); @@ -1947,7 +1941,6 @@ mod tests { json: false, file: None }, - no_check: true, ..Flags::default() } ); @@ -1960,7 +1953,6 @@ mod tests { json: true, file: None }, - no_check: true, ..Flags::default() } ); @@ -2683,50 +2675,6 @@ mod tests { ..Flags::default() } ); - let r = - flags_from_vec_safe(svec!["deno", "test", "--no-check", "script.ts"]); - assert_eq!( - r.unwrap(), - Flags { - subcommand: DenoSubcommand::Test { - fail_fast: false, - filter: None, - allow_none: false, - quiet: false, - include: Some(svec!["script.ts"]), - }, - no_check: true, - ..Flags::default() - } - ); - let r = - flags_from_vec_safe(svec!["deno", "cache", "--no-check", "script.ts"]); - assert_eq!( - r.unwrap(), - Flags { - subcommand: DenoSubcommand::Cache { - files: svec!["script.ts"], - }, - no_check: true, - ..Flags::default() - } - ); - // TODO(nayeemrmn): `--no-check` has been removed for `deno info`, but it - // shouldn't cause flag parsing to fail for backward-compatibility. Remove - // this test for v2.0.0. - let r = - flags_from_vec_safe(svec!["deno", "info", "--no-check", "script.ts"]); - assert_eq!( - r.unwrap(), - Flags { - subcommand: DenoSubcommand::Info { - json: false, - file: Some("script.ts".to_string()), - }, - no_check: true, - ..Flags::default() - } - ); } #[test] @@ -3066,7 +3014,6 @@ mod tests { file: Some("https://example.com".to_string()), }, ca_file: Some("example.crt".to_owned()), - no_check: true, ..Flags::default() } ); diff --git a/cli/tests/info_type_import.out b/cli/tests/info_type_import.out new file mode 100644 index 0000000000..4096090b34 --- /dev/null +++ b/cli/tests/info_type_import.out @@ -0,0 +1,7 @@ +Check [WILDCARD]info_type_import.ts +local: [WILDCARD]info_type_import.ts +type: TypeScript +compiled: [WILDCARD] +deps: +[WILDCARD]info_type_import.ts + └── [WILDCARD]type_and_code.ts diff --git a/cli/tests/info_type_import.ts b/cli/tests/info_type_import.ts new file mode 100644 index 0000000000..eeef46c89c --- /dev/null +++ b/cli/tests/info_type_import.ts @@ -0,0 +1,3 @@ +import { AnInterface as _, isAnInterface } from "./subdir/type_and_code.ts"; + +isAnInterface({}); diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index 2b7ffa26bc..4184b0b0a7 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -1446,9 +1446,8 @@ itest!(_030_eval_ts { }); itest!(_031_info_no_check { - args: "info 031_info_no_check.ts", + args: "info --no-check 031_info_no_check.ts", output: "031_info_no_check.out", - http_server: true, }); itest!(_033_import_map { @@ -1544,10 +1543,7 @@ itest!(_048_media_types_jsx { http_server: true, }); -// TODO(nayeemrmn): This hits an SWC type-stripping bug: -// `error: Unterminated regexp literal at http://localhost:4545/cli/tests/subdir/mt_video_vdn_tsx.t2.tsx:4:19` -// Re-enable once fixed. -itest_ignore!(_049_info_flag_script_jsx { +itest!(_049_info_flag_script_jsx { args: "info http://127.0.0.1:4545/cli/tests/048_media_types_jsx.ts", output: "049_info_flag_script_jsx.out", http_server: true, @@ -2284,6 +2280,11 @@ itest!(import_file_with_colon { http_server: true, }); +itest!(info_type_import { + args: "info info_type_import.ts", + output: "info_type_import.out", +}); + #[test] fn cafile_env_fetch() { use url::Url;