Skip to content

Commit

Permalink
fix: remove cyclic imports
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Sep 6, 2021
1 parent 8622ca7 commit bf547e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
21 changes: 11 additions & 10 deletions packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts
Expand Up @@ -2,15 +2,10 @@ import {
TSESTree,
AST_NODE_TYPES,
TSESLint,
ESLintUtils,
} from '@typescript-eslint/experimental-utils';
import {
isTypeAssertion,
isConstructor,
isSetter,
getFunctionHeadLoc,
nullThrows,
NullThrowsReasons,
} from '.';
import { isTypeAssertion, isConstructor, isSetter } from './astUtils';
import { getFunctionHeadLoc } from './getFunctionHeadLoc';

type FunctionExpression =
| TSESTree.ArrowFunctionExpression
Expand Down Expand Up @@ -190,7 +185,10 @@ function isTypedFunctionExpression(
node: FunctionExpression,
options: Options,
): boolean {
const parent = nullThrows(node.parent, NullThrowsReasons.MissingParent);
const parent = ESLintUtils.nullThrows(
node.parent,
ESLintUtils.NullThrowsReasons.MissingParent,
);

if (!options.allowTypedFunctionExpressions) {
return false;
Expand Down Expand Up @@ -218,7 +216,10 @@ function isValidFunctionExpressionReturnType(
return true;
}

const parent = nullThrows(node.parent, NullThrowsReasons.MissingParent);
const parent = ESLintUtils.nullThrows(
node.parent,
ESLintUtils.NullThrowsReasons.MissingParent,
);
if (
options.allowExpressions &&
parent.type !== AST_NODE_TYPES.VariableDeclarator &&
Expand Down
Expand Up @@ -3,7 +3,8 @@ import type * as tsTypes from 'typescript';

import { ts, tsutils } from '../optional-dependencies';

import { getTypeOfPropertyOfType, nullThrows, NullThrowsReasons } from '.';
import { getTypeOfPropertyOfType } from './propertyTypes';
import { nullThrows, NullThrowsReasons } from './nullThrows';

const enum Readonlyness {
/** the type cannot be handled by the function */
Expand Down

0 comments on commit bf547e1

Please sign in to comment.