Reuse type nodes from optional parameters even when not written as a union with undefined
#48605
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #47849 as much as we're going to fix it, at least for now. I did a lot of exploration in #48491 into doing more to find the type alias, but didn't feel confident in the approach. @weswigham suggested that an alternative would be to bind type aliases of entity names as actual aliases, which we could explore in the future. But ultimately it’s hard to argue that writing an ImportType for something exported from a module is a bug per se. I talked to @justinlnx and the real issue with the ImportType declaration was that the module specifier being emitted was problematic for a number of configuration-specific reasons, and if needed, we would be happy to look at module specifier resolution bugs separately.