Skip to content

Commit

Permalink
feat: remove cyclic dependency on experimental-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
bradzacher committed May 18, 2020
1 parent 8efcb97 commit 34a36dc
Show file tree
Hide file tree
Showing 61 changed files with 80 additions and 85 deletions.
3 changes: 1 addition & 2 deletions packages/scope-manager/package.json
Expand Up @@ -36,12 +36,11 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@typescript-eslint/experimental-utils": "2.33.0"
"@typescript-eslint/typescript-estree": "2.33.0"
},
"devDependencies": {
"@types/jest-specific-snapshot": "^0.5.4",
"@types/mkdirp": "^1.0.0",
"@typescript-eslint/typescript-estree": "2.33.0",
"glob": "^7.1.6",
"jest-specific-snapshot": "^3.0.0",
"make-dir": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/ScopeManager.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { assert } from './assert';
import {
BlockScope,
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/Variable.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { Definition } from './definition';
import { createIdGenerator } from './ID';
import { Reference } from './referencer/Reference';
Expand Down
6 changes: 3 additions & 3 deletions packages/scope-manager/src/analyze.ts
@@ -1,8 +1,8 @@
import {
TSESLint,
TSESTree,
EcmaVersion,
visitorKeys,
} from '@typescript-eslint/experimental-utils';
} from '@typescript-eslint/typescript-estree';
import { Referencer, ReferencerOptions } from './referencer';
import { ScopeManager } from './ScopeManager';

Expand All @@ -26,7 +26,7 @@ interface AnalyzeOptions {
/**
* Which ECMAScript version is considered
*/
ecmaVersion?: TSESLint.EcmaVersion;
ecmaVersion?: EcmaVersion;

/**
* Known visitor keys.
Expand Down
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { DefinitionType } from './DefinitionType';
import { DefinitionBase } from './DefinitionBase';

Expand Down
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { DefinitionType } from './DefinitionType';
import { DefinitionBase } from './DefinitionBase';

Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/definition/DefinitionBase.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { DefinitionType } from './DefinitionType';
import { createIdGenerator } from '../ID';

Expand Down
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { DefinitionType } from './DefinitionType';
import { DefinitionBase } from './DefinitionBase';

Expand Down
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { DefinitionType } from './DefinitionType';
import { DefinitionBase } from './DefinitionBase';

Expand Down
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { DefinitionType } from './DefinitionType';
import { DefinitionBase } from './DefinitionBase';

Expand Down
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { DefinitionType } from './DefinitionType';
import { DefinitionBase } from './DefinitionBase';

Expand Down
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { DefinitionType } from './DefinitionType';
import { DefinitionBase } from './DefinitionBase';

Expand Down
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { DefinitionType } from './DefinitionType';
import { DefinitionBase } from './DefinitionBase';

Expand Down
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { DefinitionType } from './DefinitionType';
import { DefinitionBase } from './DefinitionBase';

Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/definition/TypeDefinition.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { DefinitionType } from './DefinitionType';
import { DefinitionBase } from './DefinitionBase';

Expand Down
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { DefinitionType } from './DefinitionType';
import { DefinitionBase } from './DefinitionBase';

Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/referencer/ImportVisitor.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { ImportBindingDefinition } from '../definition';
import { Referencer } from './Referencer';
import { Visitor } from './Visitor';
Expand Down
5 changes: 1 addition & 4 deletions packages/scope-manager/src/referencer/PatternVisitor.ts
@@ -1,7 +1,4 @@
import {
TSESTree,
AST_NODE_TYPES,
} from '@typescript-eslint/experimental-utils';
import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import { VisitorBase, VisitorOptions } from './Visitor';

type PatternVisitorCallback = (
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/referencer/Reference.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { createIdGenerator } from '../ID';
import { Scope } from '../scope';
import { Variable } from '../Variable';
Expand Down
5 changes: 1 addition & 4 deletions packages/scope-manager/src/referencer/Referencer.ts
@@ -1,7 +1,4 @@
import {
TSESTree,
AST_NODE_TYPES,
} from '@typescript-eslint/experimental-utils';
import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import { ImportVisitor } from './ImportVisitor';
import { PatternVisitor } from './PatternVisitor';
import { ReferenceFlag, ReferenceImplicitGlobal } from './Reference';
Expand Down
5 changes: 1 addition & 4 deletions packages/scope-manager/src/referencer/TypeVisitor.ts
@@ -1,7 +1,4 @@
import {
TSESTree,
AST_NODE_TYPES,
} from '@typescript-eslint/experimental-utils';
import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import { Referencer } from './Referencer';
import { Visitor } from './Visitor';
import { ParameterDefinition, TypeDefinition } from '../definition';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/referencer/Visitor.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { VisitorBase, VisitorOptions } from './VisitorBase';
import {
PatternVisitor,
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/referencer/VisitorBase.ts
Expand Up @@ -2,7 +2,7 @@ import {
TSESTree,
AST_NODE_TYPES,
visitorKeys,
} from '@typescript-eslint/experimental-utils';
} from '@typescript-eslint/typescript-estree';

interface VisitorKeys {
readonly [type: string]: ReadonlyArray<string> | undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/scope/BlockScope.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/scope/CatchScope.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/scope/ClassScope.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/scope/ConditionalTypeScope.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/scope/ForScope.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
import { Scope } from './Scope';
Expand Down
5 changes: 1 addition & 4 deletions packages/scope-manager/src/scope/FunctionScope.ts
@@ -1,7 +1,4 @@
import {
TSESTree,
AST_NODE_TYPES,
} from '@typescript-eslint/experimental-utils';
import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/scope/FunctionTypeScope.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
5 changes: 1 addition & 4 deletions packages/scope-manager/src/scope/GlobalScope.ts
@@ -1,7 +1,4 @@
import {
TSESTree,
AST_NODE_TYPES,
} from '@typescript-eslint/experimental-utils';
import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/scope/MappedTypeScope.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/scope/ModuleScope.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
5 changes: 1 addition & 4 deletions packages/scope-manager/src/scope/ScopeBase.ts
@@ -1,7 +1,4 @@
import {
TSESTree,
AST_NODE_TYPES,
} from '@typescript-eslint/experimental-utils';
import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import { FunctionScope } from './FunctionScope';
import { GlobalScope } from './GlobalScope';
import { ScopeType } from './ScopeType';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/scope/SwitchScope.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/scope/TSEnumScope.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/scope/TSModuleScope.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/scope/TypeScope.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/src/scope/WithScope.ts
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { Scope } from './Scope';
import { ScopeBase } from './ScopeBase';
import { ScopeType } from './ScopeType';
Expand Down
@@ -1,4 +1,4 @@
import { TSESTree } from '@typescript-eslint/experimental-utils';
import { TSESTree } from '@typescript-eslint/typescript-estree';
import { parse } from '../util';
import { analyze } from '../../src/analyze';

Expand Down
@@ -1,4 +1,4 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import {
expectToBeFunctionScope,
expectToBeGlobalScope,
Expand Down
@@ -1,4 +1,4 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import {
expectToBeBlockScope,
expectToBeCatchScope,
Expand Down
@@ -1,4 +1,4 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import {
expectToBeClassScope,
expectToBeFunctionScope,
Expand Down
@@ -1,4 +1,4 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import { expectToBeFunctionScope, parseAndAnalyze } from '../util';

describe('ES6 new.target', () => {
Expand Down
@@ -1,4 +1,4 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import {
expectToBeFunctionScope,
expectToBeGlobalScope,
Expand Down
@@ -1,4 +1,4 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import {
expectToBeFunctionScope,
expectToBeGlobalScope,
Expand Down
@@ -1,4 +1,4 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import {
expectToBeGlobalScope,
expectToBeSwitchScope,
Expand Down
@@ -1,4 +1,4 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import {
expectToBeFunctionScope,
expectToBeGlobalScope,
Expand Down
Expand Up @@ -2,7 +2,7 @@ import {
AST_NODE_TYPES,
TSESTree,
simpleTraverse,
} from '@typescript-eslint/experimental-utils';
} from '@typescript-eslint/typescript-estree';
import { parse } from '../util/parse';
import { analyze } from '../../src/analyze';

Expand Down
@@ -1,4 +1,4 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import {
expectToBeGlobalScope,
expectToBeFunctionScope,
Expand Down
@@ -1,4 +1,4 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import {
expectToBeFunctionScope,
expectToBeGlobalScope,
Expand Down
@@ -1,4 +1,4 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import {
expectToBeFunctionScope,
expectToBeGlobalScope,
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/tests/types/reference-type.test.ts
@@ -1,4 +1,4 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import { getSpecificNode, parseAndAnalyze } from '../util';

describe('referencing a type - positive', () => {
Expand Down
@@ -1,4 +1,4 @@
import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
import { AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import { getSpecificNode, parseAndAnalyze } from '../util';

describe('variable definition', () => {
Expand Down
5 changes: 1 addition & 4 deletions packages/scope-manager/tests/util/expect.ts
@@ -1,7 +1,4 @@
import {
TSESTree,
AST_NODE_TYPES,
} from '@typescript-eslint/experimental-utils';
import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
import {
CatchClauseDefinition,
ClassNameDefinition,
Expand Down
4 changes: 2 additions & 2 deletions packages/scope-manager/tests/util/getSpecificNode.ts
@@ -1,8 +1,8 @@
import {
simpleTraverse,
AST_NODE_TYPES,
TSESTree,
} from '@typescript-eslint/experimental-utils';
simpleTraverse,
} from '@typescript-eslint/typescript-estree';

function getSpecificNode<
TSelector extends AST_NODE_TYPES,
Expand Down

0 comments on commit 34a36dc

Please sign in to comment.