diff --git a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts index a4d4f92f6ddd..5586d9c6f767 100644 --- a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts +++ b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts @@ -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 @@ -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; @@ -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 && diff --git a/packages/experimental-utils/src/eslint-utils/isTypeReadonly.ts b/packages/experimental-utils/src/eslint-utils/isTypeReadonly.ts index cdaa2797d5cf..454482043325 100644 --- a/packages/experimental-utils/src/eslint-utils/isTypeReadonly.ts +++ b/packages/experimental-utils/src/eslint-utils/isTypeReadonly.ts @@ -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 */