summaryrefslogtreecommitdiff
path: root/cli/config_file.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/config_file.rs')
-rw-r--r--cli/config_file.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/cli/config_file.rs b/cli/config_file.rs
index 5cd76eaca..a254d074d 100644
--- a/cli/config_file.rs
+++ b/cli/config_file.rs
@@ -499,6 +499,18 @@ impl ConfigFile {
})
}
+ /// Returns true if the configuration indicates that JavaScript should be
+ /// type checked, otherwise false.
+ pub fn get_check_js(&self) -> bool {
+ self
+ .json
+ .compiler_options
+ .as_ref()
+ .map(|co| co.get("checkJs").map(|v| v.as_bool()).flatten())
+ .flatten()
+ .unwrap_or(false)
+ }
+
/// Parse `compilerOptions` and return a serde `Value`.
/// The result also contains any options that were ignored.
pub fn to_compiler_options(