Skip to content

Commit

Permalink
Merge pull request #229 from arethetypeswrong/bug/224
Browse files Browse the repository at this point in the history
Fix named exports check crash when resolution is JS-only
  • Loading branch information
andrewbranch authored Dec 6, 2024
2 parents c09df85 + def786e commit b9cf960
Show file tree
Hide file tree
Showing 4 changed files with 795 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/dry-jokes-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@arethetypeswrong/core": patch
---

Fix named exports check crash when resolution is JS-only
2 changes: 1 addition & 1 deletion packages/core/src/internal/checks/namedExports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineCheck({
name: "NamedExports",
dependencies: ({ entrypoints, subpath, resolutionKind, programInfo }) => {
const entrypoint = entrypoints[subpath].resolutions[resolutionKind];
const typesFileName = entrypoint.resolution?.fileName;
const typesFileName = entrypoint.resolution?.isTypeScript && entrypoint.resolution.fileName;
const resolutionOption = getResolutionOption(resolutionKind);
const typesModuleKind = typesFileName ? programInfo[resolutionOption].moduleKinds?.[typesFileName] : undefined;
const implementationFileName = entrypoint.implementationResolution?.fileName;
Expand Down
Binary file added packages/core/test/fixtures/[email protected]
Binary file not shown.
Loading

0 comments on commit b9cf960

Please sign in to comment.