Skip to content

Commit 597b90f

Browse files
committed
Final touches
1 parent ba4cb25 commit 597b90f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/rules/no-discarded-pure-expression.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default createRule({
3939
pipe(
4040
pureDataPrefixes,
4141
array.some((prefix) =>
42-
t.symbol.escapedName.toString().startsWith(prefix)
42+
t.symbol?.escapedName.toString().startsWith(prefix)
4343
)
4444
)
4545
);

src/utils.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,11 @@ export const contextUtils = <
399399
}
400400

401401
function parserServices(): Option<ParserServices> {
402-
return pipe(context.parserServices, option.fromNullable);
402+
return pipe(
403+
context.parserServices,
404+
option.fromNullable,
405+
option.filter((parserServices) => parserServices.hasFullTypeInformation)
406+
);
403407
}
404408

405409
function typeOfNode(node: TSESTree.Node): Option<ts.Type> {

0 commit comments

Comments
 (0)