1
- import fs = require ( 'fs' ) ;
1
+ import * as fs from 'fs' ;
2
2
import endsWith = require( 'lodash.endswith' ) ;
3
- import path = require ( 'path' ) ;
4
- import ts = require ( 'typescript' ) ;
5
- import tslintTypes = require ( 'tslint' ) ; // Imported for types alone; actual requires take place in methods below
6
- import FilesRegister = require ( './FilesRegister' ) ;
7
- import FilesWatcher = require ( './FilesWatcher' ) ;
8
- import WorkSet = require ( './WorkSet' ) ;
9
- import NormalizedMessage = require ( './NormalizedMessage' ) ;
10
- import CancellationToken = require ( './CancellationToken' ) ;
11
- import minimatch = require ( 'minimatch' ) ;
12
- import VueProgram = require ( './VueProgram' ) ;
3
+ import * as path from 'path' ;
4
+ import * as ts from 'typescript' ;
5
+ import { Configuration , Linter } from 'tslint' ; // Imported for types alone; actual requires take place in methods below
6
+ import { FilesRegister } from './FilesRegister' ;
7
+ import { FilesWatcher } from './FilesWatcher' ;
8
+ import { WorkSet } from './WorkSet' ;
9
+ import { NormalizedMessage } from './NormalizedMessage' ;
10
+ import { CancellationToken } from './CancellationToken' ;
11
+ import * as minimatch from 'minimatch' ;
12
+ import { VueProgram } from './VueProgram' ;
13
13
14
14
// Need some augmentation here - linterOptions.exclude is not (yet) part of the official
15
15
// types for tslint.
16
- interface ConfigurationFile extends tslintTypes . Configuration . IConfigurationFile {
16
+ interface ConfigurationFile extends Configuration . IConfigurationFile {
17
17
linterOptions ?: {
18
18
typeCheck ?: boolean ;
19
19
exclude ?: string [ ] ;
20
20
} ;
21
21
}
22
22
23
- class IncrementalChecker {
23
+ export class IncrementalChecker {
24
24
programConfigFile : string ;
25
25
linterConfigFile : string | false ;
26
26
watchPaths : string [ ] ;
@@ -29,7 +29,7 @@ class IncrementalChecker {
29
29
checkSyntacticErrors : boolean ;
30
30
files : FilesRegister ;
31
31
32
- linter : tslintTypes . Linter ;
32
+ linter : Linter ;
33
33
linterConfig : ConfigurationFile ;
34
34
linterExclusions : minimatch . IMinimatch [ ] ;
35
35
@@ -78,7 +78,7 @@ class IncrementalChecker {
78
78
}
79
79
80
80
static loadLinterConfig ( configFile : string ) : ConfigurationFile {
81
- const tslint : typeof tslintTypes = require ( 'tslint' ) ;
81
+ const tslint = require ( 'tslint' ) ;
82
82
83
83
return tslint . Configuration . loadConfigurationFromPath ( configFile ) as ConfigurationFile ;
84
84
}
@@ -124,7 +124,7 @@ class IncrementalChecker {
124
124
}
125
125
126
126
static createLinter ( program : ts . Program ) {
127
- const tslint : typeof tslintTypes = require ( 'tslint' ) ;
127
+ const tslint = require ( 'tslint' ) ;
128
128
129
129
return new tslint . Linter ( { fix : false } , program ) ;
130
130
}
@@ -279,5 +279,3 @@ class IncrementalChecker {
279
279
) ;
280
280
}
281
281
}
282
-
283
- export = IncrementalChecker ;
0 commit comments