diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2021-05-10 18:16:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-10 18:16:39 +0200 |
commit | ce48b32979b007c35130321ed0f91d8ffdb6d593 (patch) | |
tree | 6cab6a1349fb9541eac0324efbfc563625d5e656 /cli/ast.rs | |
parent | 7fc211e62752dddd4f70f8feef24dbcea795c1eb (diff) |
refactor(cli): replace loading file for --config flag with generic structure (#10481)
Currently file passed to --config file is parsed using TsConfig structure
that does multiple things when loading the file. Instead of relying on that
structure I've introduced ConfigFile structure that can be updated to
sniff out more fields from the config file in the future.
Diffstat (limited to 'cli/ast.rs')
-rw-r--r-- | cli/ast.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/ast.rs b/cli/ast.rs index f76bf5e9a..d282e0ee7 100644 --- a/cli/ast.rs +++ b/cli/ast.rs @@ -1,7 +1,7 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. +use crate::config_file; use crate::media_type::MediaType; -use crate::tsc_config; use deno_core::error::AnyError; use deno_core::resolve_url_or_path; @@ -229,9 +229,9 @@ impl Default for EmitOptions { } } -impl From<tsc_config::TsConfig> for EmitOptions { - fn from(config: tsc_config::TsConfig) -> Self { - let options: tsc_config::EmitConfigOptions = +impl From<config_file::TsConfig> for EmitOptions { + fn from(config: config_file::TsConfig) -> Self { + let options: config_file::EmitConfigOptions = serde_json::from_value(config.0).unwrap(); let imports_not_used_as_values = match options.imports_not_used_as_values.as_str() { |