diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-03-11 11:43:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-11 11:43:45 -0500 |
commit | 8db853514caae431a0ce91360d854c1b7f3c405f (patch) | |
tree | 4173976ce6c836b715af22c9aeb9f336debb8544 /cli/args/config_file.rs | |
parent | e4430400ced48529730a8752c547b613a23c76ce (diff) |
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
Diffstat (limited to 'cli/args/config_file.rs')
-rw-r--r-- | cli/args/config_file.rs | 14 |
1 files changed, 10 insertions, 4 deletions
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)?; |