Skip to content

Commit

Permalink
fix: typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
bradzacher committed Mar 3, 2020
1 parent f5bd0fe commit 4f10ca3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
5 changes: 1 addition & 4 deletions packages/eslint-plugin/src/rules/no-unsafe-call.ts
@@ -1,7 +1,4 @@
import {
TSESTree,
AST_NODE_TYPES,
} from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/experimental-utils';
import * as util from '../util';

type MessageIds = 'unsafeCall' | 'unsafeNew';
Expand Down
23 changes: 0 additions & 23 deletions packages/eslint-plugin/src/util/types.ts
Expand Up @@ -473,26 +473,3 @@ export function getContextualType(

return checker.getContextualType(node);
}

export const enum AnyType {
Any,
AnyArray,
Safe,
}
/**
* @returns `AnyType.Any` if the type is `any`, `AnyType.AnyArray` if the type is `any[]` or `readonly any[]`,
* otherwise it returns `AnyType.Safe`.
*/
export function isAnyOrAnyArrayTypeDiscriminated(
node: ts.Node,
checker: ts.TypeChecker,
): AnyType {
const type = checker.getTypeAtLocation(node);
if (isTypeAnyType(type)) {
return AnyType.Any;
}
if (isTypeAnyArrayType(type, checker)) {
return AnyType.AnyArray;
}
return AnyType.Safe;
}

0 comments on commit 4f10ca3

Please sign in to comment.