[WIP] Make allowJs and declaration options work together#27478
[WIP] Make allowJs and declaration options work together#27478ahocevar wants to merge 2 commits into
Conversation
|
Does/will this enable project references with JS files ( |
|
@ajafff No, the scope of this effort is limited to making |
|
So... this probably isn't what you wanna hear; but you probably want to use a completely separate transformer for JS files, when compared to the TS one. Because of how JS declarations are merged/inferred in a piecewise fashion, what you probably want to do is something along the lines of iterating over all the exported symbols (rather than the declarations in the file) and attempting to rebuild them from typechecker information, rather than their (potentially non-.d.ts-compatible) original declaration sites. For example, we have an upcoming PR to recognize |
|
Thanks for the explanations @weswigham. This sounds like a ton of work indeed, requiring more time than I'm able to spend on it. I'm closing this pull request, but won't delete my branch in case anyone else wants to pick it up from here. |
Not ready for review yet!
This is work in progress, and a follow-up on recently closed #21455. I'm pretty stuck already in early stages of this pull request, so if anyone is able and willing to help I'll be glad to give access to my branch and coordinate the effort.
I think the best way to address this is to add helper utilities to TypeScript that convert nodes from
*.jsfiles with JSDoc types to nodes that look exactly as if the types were defined in*.tscode. Any guidance or ideas about different approaches would be much appreciated.'Bug' or 'help wanted' or is in the Community milestone
masterbranchjake runtestslocallyFixes #7546