Skip to content

Commit

Permalink
fix: handle noSymbol scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Mar 6, 2023
1 parent 0227af2 commit 13cc585
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules/no-classes-in-command-return-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const hasOrIsClass = (tn: ts.TypeNode | ts.TypeElement, parserServices: ParserSe
if (ts.isImportSpecifier(declaration)) {
// Follow the import
const type = checker.getTypeAtLocation(declaration);
const symbolDeclarations = type.getSymbol().getDeclarations();
const symbolDeclarations = type.getSymbol()?.getDeclarations() ?? [];
return symbolDeclarations.some(
(d) => ts.isClassLike(d) || ((ts.isTypeNode(d) || ts.isTypeElement(d)) && hasOrIsClass(d, parserServices))
);
Expand Down

0 comments on commit 13cc585

Please sign in to comment.