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/tools/doc.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'cli/tools') diff --git a/cli/tools/doc.rs b/cli/tools/doc.rs index 7b06dce05..5e9f32a8f 100644 --- a/cli/tools/doc.rs +++ b/cli/tools/doc.rs @@ -1,6 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -use crate::args::CliOptions; use crate::args::DocFlags; use crate::args::DocHtmlFlag; use crate::args::DocSourceFileFlag; @@ -28,17 +27,15 @@ use indexmap::IndexMap; use std::collections::BTreeMap; use std::path::PathBuf; use std::rc::Rc; -use std::sync::Arc; async fn generate_doc_nodes_for_builtin_types( doc_flags: DocFlags, - cli_options: &Arc, parser: &dyn ModuleParser, analyzer: &dyn ModuleAnalyzer, ) -> Result>, AnyError> { let source_file_specifier = ModuleSpecifier::parse("internal://lib.deno.d.ts").unwrap(); - let content = get_types_declaration_file_text(cli_options.unstable()); + let content = get_types_declaration_file_text(); let mut loader = deno_graph::source::MemoryLoader::new( vec![( source_file_specifier.to_string(), @@ -86,7 +83,6 @@ pub async fn doc(flags: Flags, doc_flags: DocFlags) -> Result<(), AnyError> { DocSourceFileFlag::Builtin => { generate_doc_nodes_for_builtin_types( doc_flags.clone(), - cli_options, &capturing_parser, &analyzer, ) @@ -156,7 +152,6 @@ pub async fn doc(flags: Flags, doc_flags: DocFlags) -> Result<(), AnyError> { let deno_ns = if doc_flags.source_files != DocSourceFileFlag::Builtin { let deno_ns = generate_doc_nodes_for_builtin_types( doc_flags.clone(), - cli_options, &capturing_parser, &analyzer, ) -- cgit v1.2.3