Skip to content

Commit 23d56d0

Browse files
authored
Merge pull request #98 from arethetypeswrong/bug/96-follow-up
Fix crash from missing optional chain
2 parents d318499 + 35544c5 commit 23d56d0

File tree

4 files changed

+342
-2
lines changed

4 files changed

+342
-2
lines changed

.changeset/nervous-berries-attack.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@arethetypeswrong/core": patch
3+
---
4+
5+
Fix crash from missing optional chain

packages/core/src/internal/checks/exportDefaultDisagreement.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ export default defineCheck({
2222
const host = context.hosts.findHostForFiles([typesFileName])!;
2323
const typesSourceFile = host.getSourceFile(typesFileName)!;
2424
ts.bindSourceFile(typesSourceFile, bindOptions);
25-
const typesExports = typesSourceFile.symbol.exports;
25+
const typesExports = typesSourceFile.symbol?.exports;
2626
if (!typesExports) {
2727
return;
2828
}
2929
const implementationSourceFile = host.getSourceFile(implementationFileName)!;
3030
ts.bindSourceFile(implementationSourceFile, bindOptions);
31-
const implExports = implementationSourceFile.symbol.exports;
31+
const implExports = implementationSourceFile.symbol?.exports;
3232
if (!implExports) {
3333
return;
3434
}
5.06 KB
Binary file not shown.

0 commit comments

Comments
 (0)