diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2024-01-14 18:29:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-14 18:29:17 +0100 |
commit | 0d51c1f90ecc3d276e17564c2471604b6dc1f2bd (patch) | |
tree | 60664f2442272fbd3feb2605ce604e2e97390613 /cli/tools/doc.rs | |
parent | f3bb0a1a0e5ee3335d3c45db2be285791c7516cf (diff) |
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.
Diffstat (limited to 'cli/tools/doc.rs')
-rw-r--r-- | cli/tools/doc.rs | 7 |
1 files changed, 1 insertions, 6 deletions
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<CliOptions>, parser: &dyn ModuleParser, analyzer: &dyn ModuleAnalyzer, ) -> Result<IndexMap<ModuleSpecifier, Vec<doc::DocNode>>, 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, ) |