Skip to content

Commit

Permalink
refactor: use isIntrinsicErrorType
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Jul 7, 2023
1 parent be42475 commit e04ca7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/type-utils/src/TypeOrValueSpecifier.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { getCanonicalFileName } from '@typescript-eslint/typescript-estree';
import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema';
import path from 'path';
import * as tsutils from 'ts-api-utils';
import type * as ts from 'typescript';

interface FileSpecifier {
Expand Down Expand Up @@ -186,8 +187,7 @@ export function typeMatchesSpecifier(
specifier: TypeOrValueSpecifier,
program: ts.Program,
): boolean {
// TODO: use `tsutils.isErrorType(type)` -- That function doesn't exists yet.
if (type.intrinsicName === 'error') {
if (tsutils.isIntrinsicErrorType(type)) {
return false;
}
if (typeof specifier === 'string') {
Expand Down

0 comments on commit e04ca7b

Please sign in to comment.