diff options
author | Luca Casonato <hello@lcas.dev> | 2024-04-30 20:12:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-30 18:12:35 +0000 |
commit | 6cdf81db7c4a41d036eefc17e41ffb8db0cf54a1 (patch) | |
tree | 6e21e240c12d8fc9856fbc342aab3d986e338e70 /cli/lsp/config.rs | |
parent | 8c3f8ba13605d1c69eba4272179bce5ca0d10fe3 (diff) |
feat(cli): add support for jsxImportSourceTypes (#23419)
Co-authored-by: David Sherret <dsherret@gmail.com>
Diffstat (limited to 'cli/lsp/config.rs')
-rw-r--r-- | cli/lsp/config.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cli/lsp/config.rs b/cli/lsp/config.rs index e5703a21a..ec209e0e6 100644 --- a/cli/lsp/config.rs +++ b/cli/lsp/config.rs @@ -1071,8 +1071,14 @@ impl LspTsConfig { let import_map = import_map?; let referrer = &config_file?.specifier; let compiler_options = ts_config.inner.0.as_object_mut()?; - let jsx_import_source = - compiler_options.get("jsxImportSource")?.as_str()?; + let jsx_import_source = compiler_options + .get("jsxImportSourceTypes") + .and_then(|v| v.as_str()) + .or_else(|| { + compiler_options + .get("jsxImportSource") + .and_then(|v| v.as_str()) + })?; let jsx_import_source = import_map.resolve(jsx_import_source, referrer).ok()?; compiler_options |