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
This commit is contained in:
David Sherret 2023-03-11 11:43:45 -05:00 committed by GitHub
parent e4430400ce
commit 8db853514c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 170 additions and 174 deletions

View file

@ -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)?;