1
1
import * as util from '../util' ;
2
- import {
3
- Literal ,
4
- Node ,
5
- TSExternalModuleReference ,
6
- } from '@typescript-eslint/typescript-estree/dist/ts-estree/ts-estree' ;
7
- import { TSESTree } from '@typescript-eslint/typescript-estree' ;
2
+ import { TSESTree } from '@typescript-eslint/experimental-utils' ;
8
3
9
4
type Options = [
10
5
{
@@ -55,14 +50,14 @@ export default util.createRule<Options, MessageIds>({
55
50
} ,
56
51
] ,
57
52
create ( context , [ { lib, path, types } ] ) {
58
- let programNode : Node ;
53
+ let programNode : TSESTree . Node ;
59
54
const sourceCode = context . getSourceCode ( ) ;
60
55
const references : ( {
61
56
comment : TSESTree . Comment ;
62
57
importName : string ;
63
58
} ) [ ] = [ ] ;
64
59
65
- function hasMatchingReference ( source : Literal ) {
60
+ function hasMatchingReference ( source : TSESTree . Literal ) {
66
61
references . forEach ( reference => {
67
62
if ( reference . importName === source . value ) {
68
63
context . report ( {
@@ -78,14 +73,14 @@ export default util.createRule<Options, MessageIds>({
78
73
return {
79
74
ImportDeclaration ( node ) {
80
75
if ( programNode ) {
81
- const source = node . source as Literal ;
76
+ const source = node . source as TSESTree . Literal ;
82
77
hasMatchingReference ( source ) ;
83
78
}
84
79
} ,
85
80
TSImportEqualsDeclaration ( node ) {
86
81
if ( programNode ) {
87
- const source = ( node . moduleReference as TSExternalModuleReference )
88
- . expression as Literal ;
82
+ const source = ( node . moduleReference as TSESTree . TSExternalModuleReference )
83
+ . expression as TSESTree . Literal ;
89
84
hasMatchingReference ( source ) ;
90
85
}
91
86
} ,
0 commit comments