From 8db853514caae431a0ce91360d854c1b7f3c405f Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 11 Mar 2023 11:43:45 -0500 Subject: fix(check): regression where config "types" entries caused type checking errors (#18124) Closes #18117 Closes #18121 (this is just over 10ms faster in a directory one up from the root folder) cc @nayeemrmn --- cli/args/config_file.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'cli/args') diff --git a/cli/args/config_file.rs b/cli/args/config_file.rs index 3ba88c680..b5ee8c50a 100644 --- a/cli/args/config_file.rs +++ b/cli/args/config_file.rs @@ -185,10 +185,16 @@ fn parse_compiler_options( for (key, value) in compiler_options.iter() { let key = key.as_str(); - if IGNORED_COMPILER_OPTIONS.contains(&key) { - items.push(key.to_string()); - } else { - filtered.insert(key.to_string(), value.to_owned()); + // We don't pass "types" entries to typescript via the compiler + // options and instead provide those to tsc as "roots". This is + // because our "types" behavior is at odds with how TypeScript's + // "types" works. + if key != "types" { + if IGNORED_COMPILER_OPTIONS.contains(&key) { + items.push(key.to_string()); + } else { + filtered.insert(key.to_string(), value.to_owned()); + } } } let value = serde_json::to_value(filtered)?; -- cgit v1.2.3