Skip to content

Commit ceb2d32

Browse files
mikeharderbradzacher
authored andcommitted
fix(eslint-plugin): remove imports from typescript-estree (#706)
Fixes #705
1 parent 9836fb7 commit ceb2d32

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

packages/eslint-plugin/src/rules/prefer-readonly.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import * as tsutils from 'tsutils';
22
import ts from 'typescript';
33
import * as util from '../util';
44
import { typeIsOrHasBaseType } from '../util';
5-
import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/typescript-estree';
5+
import {
6+
TSESTree,
7+
AST_NODE_TYPES,
8+
} from '@typescript-eslint/experimental-utils';
69

710
type MessageIds = 'preferReadonly';
811

packages/eslint-plugin/src/rules/prefer-regexp-exec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TSESTree } from '@typescript-eslint/typescript-estree';
1+
import { TSESTree } from '@typescript-eslint/experimental-utils';
22
import { createRule, getParserServices, getTypeName } from '../util';
33
import { getStaticValue } from 'eslint-utils';
44

packages/eslint-plugin/src/rules/triple-slash-reference.ts

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
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';
83

94
type Options = [
105
{
@@ -55,14 +50,14 @@ export default util.createRule<Options, MessageIds>({
5550
},
5651
],
5752
create(context, [{ lib, path, types }]) {
58-
let programNode: Node;
53+
let programNode: TSESTree.Node;
5954
const sourceCode = context.getSourceCode();
6055
const references: ({
6156
comment: TSESTree.Comment;
6257
importName: string;
6358
})[] = [];
6459

65-
function hasMatchingReference(source: Literal) {
60+
function hasMatchingReference(source: TSESTree.Literal) {
6661
references.forEach(reference => {
6762
if (reference.importName === source.value) {
6863
context.report({
@@ -78,14 +73,14 @@ export default util.createRule<Options, MessageIds>({
7873
return {
7974
ImportDeclaration(node) {
8075
if (programNode) {
81-
const source = node.source as Literal;
76+
const source = node.source as TSESTree.Literal;
8277
hasMatchingReference(source);
8378
}
8479
},
8580
TSImportEqualsDeclaration(node) {
8681
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;
8984
hasMatchingReference(source);
9085
}
9186
},

0 commit comments

Comments
 (0)