diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/args/mod.rs | 9 | ||||
-rw-r--r-- | cli/factory.rs | 2 | ||||
-rw-r--r-- | cli/tools/bundle.rs | 2 | ||||
-rw-r--r-- | cli/tools/compile.rs | 2 | ||||
-rw-r--r-- | cli/tools/repl/session.rs | 2 |
5 files changed, 9 insertions, 8 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 6c84abac2..aa3622d09 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -150,9 +150,10 @@ pub fn jsr_api_url() -> &'static Url { pub fn ts_config_to_transpile_and_emit_options( config: deno_config::TsConfig, -) -> (deno_ast::TranspileOptions, deno_ast::EmitOptions) { +) -> Result<(deno_ast::TranspileOptions, deno_ast::EmitOptions), AnyError> { let options: deno_config::EmitConfigOptions = - serde_json::from_value(config.0).unwrap(); + serde_json::from_value(config.0) + .context("Failed to parse compilerOptions")?; let imports_not_used_as_values = match options.imports_not_used_as_values.as_str() { "preserve" => deno_ast::ImportsNotUsedAsValues::Preserve, @@ -174,7 +175,7 @@ pub fn ts_config_to_transpile_and_emit_options( } else { SourceMapOption::None }; - ( + Ok(( deno_ast::TranspileOptions { use_ts_decorators: options.experimental_decorators, use_decorators_proposal: !options.experimental_decorators, @@ -195,7 +196,7 @@ pub fn ts_config_to_transpile_and_emit_options( keep_comments: false, source_map, }, - ) + )) } /// Indicates how cached source files should be handled. diff --git a/cli/factory.rs b/cli/factory.rs index 2d685ce76..1a0584eea 100644 --- a/cli/factory.rs +++ b/cli/factory.rs @@ -563,7 +563,7 @@ impl CliFactory { let (transpile_options, emit_options) = crate::args::ts_config_to_transpile_and_emit_options( ts_config_result.ts_config, - ); + )?; Ok(Arc::new(Emitter::new( self.emit_cache()?.clone(), self.parsed_source_cache().clone(), diff --git a/cli/tools/bundle.rs b/cli/tools/bundle.rs index e8b9076ea..7701b6024 100644 --- a/cli/tools/bundle.rs +++ b/cli/tools/bundle.rs @@ -147,7 +147,7 @@ fn bundle_module_graph( let (transpile_options, emit_options) = crate::args::ts_config_to_transpile_and_emit_options( ts_config_result.ts_config, - ); + )?; deno_emit::bundle_graph( graph, deno_emit::BundleOptions { diff --git a/cli/tools/compile.rs b/cli/tools/compile.rs index 75572cd42..7f31b9035 100644 --- a/cli/tools/compile.rs +++ b/cli/tools/compile.rs @@ -76,7 +76,7 @@ pub async fn compile( let (transpile_options, emit_options) = crate::args::ts_config_to_transpile_and_emit_options( ts_config_for_emit.ts_config, - ); + )?; let parser = parsed_source_cache.as_capturing_parser(); let eszip = eszip::EszipV2::from_graph( graph, diff --git a/cli/tools/repl/session.rs b/cli/tools/repl/session.rs index 8aa632949..671dad4b5 100644 --- a/cli/tools/repl/session.rs +++ b/cli/tools/repl/session.rs @@ -255,7 +255,7 @@ impl ReplSession { let (transpile_options, _) = crate::args::ts_config_to_transpile_and_emit_options( ts_config_for_emit.ts_config, - ); + )?; let experimental_decorators = transpile_options.use_ts_decorators; let mut repl_session = ReplSession { npm_resolver, |