10000 fix: correct issues with circular imports (#4140) · dotJack/typescript-eslint@4c87b24 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4c87b24

Browse files
authored
fix: correct issues with circular imports (typescript-eslint#4140)
1 parent 87cfc6a commit 4c87b24

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

packages/eslint-plugin/src/rules/no-restricted-imports.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { TSESTree } from '@typescript-eslint/experimental-utils';
2-
import {
2+
import type {
33
ArrayOfStringOrObject,
44
ArrayOfStringOrObjectPatterns,
55
} from 'eslint/lib/rules/no-restricted-imports';

packages/eslint-plugin/src/util/collectUnusedVariables.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import {
22
AST_NODE_TYPES,
33
TSESLint,
4+
ASTUtils,
45
TSESTree,
56
} from '@typescript-eslint/experimental-utils';
67
import { ImplicitLibVariable } from '@typescript-eslint/scope-manager';
78
import { Visitor } from '@typescript-eslint/scope-manager/dist/referencer/Visitor';
8-
import * as util from '.';
9+
import { nullThrows } from './nullThrows';
910

1011
class UnusedVarsVisitor<
1112
TMessageIds extends string,
@@ -24,7 +25,7 @@ class UnusedVarsVisitor<
2425
visitChildrenEvenIfSelectorExists: true,
2526
});
2627

27-
this.#scopeManager = util.nullThrows(
28+
this.#scopeManager = nullThrows(
2829
context.getSourceCode().scopeManager,
2930
'Missing required scope manager',
3031
);
@@ -545,11 +546,11 @@ function isUsedVariable(variable: TSESLint.Scope.Variable): boolean {
545546
function isInLoop(node: TSESTree.Node): boolean {
546547
let currentNode: TSESTree.Node | undefined = node;
547548
while (currentNode) {
548-
if (util.isFunction(currentNode)) {
549+
if (ASTUtils.isFunction(currentNode)) {
549550
break;
550551
}
551552

552-
if (util.isLoop(currentNode)) {
553+
if (ASTUtils.isLoop(currentNode)) {
553554
return true;
554555
}
555556

@@ -620,7 +621,7 @@ function isUsedVariable(variable: TSESLint.Scope.Variable): boolean {
620621
function getUpperFunction(node: TSESTree.Node): TSESTree.Node | null {
621622
let currentNode: TSESTree.Node | undefined = node;
622623
while (currentNode) {
623-
if (util.isFunction(currentNode)) {
624+
if (ASTUtils.isFunction(currentNode)) {
624625
return currentNode;
625626
}
626627
currentNode = currentNode.parent;

packages/eslint-plugin/src/util/isTypeReadonly.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
isSymbolFlagSet,
88
} from 'tsutils';
99
import * as ts from 'typescript';
10-
import { getTypeOfPropertyOfType, nullThrows, NullThrowsReasons } from '.';
10+
import { nullThrows, NullThrowsReasons } from './nullThrows';
11+
import { getTypeOfPropertyOfType } from './propertyTypes';
1112

1213
const enum Readonlyness {
1314
/** the type cannot be handled by the function */

packages/scope-manager/src/referencer/PatternVisitor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/types';
2-
import { VisitorBase, VisitorOptions } from './Visitor';
2+
import { VisitorBase, VisitorOptions } from './VisitorBase';
33

44
type PatternVisitorCallback = (
55
pattern: TSESTree.Identifier,

0 commit comments

Comments
 (0)
0