fix jest-haste-map-types#7951
Conversation
| }); | ||
| return Runtime.createContext(config, {maxWorkers, watchman: false}).then( | ||
| (hasteMap: any) => { | ||
| (runtimeContext: any) => { |
There was a problem hiding this comment.
This was never actually a HasteMap instance lol, HasteMaps don't even have a .resolver property 😄
SimenB
left a comment
There was a problem hiding this comment.
This is fantastic, thank you so much for fixing it!
|
:) do any other locations where we could get rid of |
Yeah, |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
jest-haste-mapwants to do bothexport = HasteMapand multipleexport type SomeType. Until we migrate it over to use a proper ESM default export, the way to do this in TypeScript is namespaces - see this StackOverflow answer. This fixes ourjest-haste-map/build/index.d.ts:Diff
@babel/plugin-transform-typescriptdoes not support namespaces (because it's not possible to really support them), but we only want to put a few types in them, so I wrote a Babel plugin that strips them away in those simple cases. This way,yarn buildworks andjest-haste-map/build/index.jsis unchanged.Test plan
Manual inspection of
jest-haste-map/build/index.{js,d.ts}