From 0d51c1f90ecc3d276e17564c2471604b6dc1f2bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 14 Jan 2024 18:29:17 +0100 Subject: feat: remove conditional unstable type-checking (#21825) This commit removes conditional type-checking of unstable APIs. Before this commit `deno check` (or any other type-checking command and the LSP) would error out if there was an unstable API in the code, but not `--unstable` flag provided. This situation hinders DX and makes it harder to configure Deno. Failing during runtime unless `--unstable` flag is provided is enough in this case. --- cli/tsc/mod.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'cli/tsc') diff --git a/cli/tsc/mod.rs b/cli/tsc/mod.rs index 4df841cd3..04450b8d0 100644 --- a/cli/tsc/mod.rs +++ b/cli/tsc/mod.rs @@ -78,14 +78,14 @@ pub static COMPILER_SNAPSHOT: Lazy> = Lazy::new( }, ); -pub fn get_types_declaration_file_text(unstable: bool) -> String { +pub fn get_types_declaration_file_text() -> String { let mut assets = get_asset_texts_from_new_runtime() .unwrap() .into_iter() .map(|a| (a.specifier, a.text)) .collect::>(); - let mut lib_names = vec![ + let lib_names = vec![ "deno.ns", "deno.console", "deno.url", @@ -100,12 +100,9 @@ pub fn get_types_declaration_file_text(unstable: bool) -> String { "deno.shared_globals", "deno.cache", "deno.window", + "deno.unstable", ]; - if unstable { - lib_names.push("deno.unstable"); - } - lib_names .into_iter() .map(|name| { -- cgit v1.2.3