1
1
import * as fs from 'fs' ;
2
- import endsWith = require( 'lodash/endsWith' ) ;
3
2
import * as path from 'path' ;
4
3
import * as ts from 'typescript' ;
5
4
import { Configuration , Linter , RuleFailure } from 'tslint' ; // Imported for types alone; actual requires take place in methods below
@@ -21,15 +20,15 @@ interface ConfigurationFile extends Configuration.IConfigurationFile {
21
20
}
22
21
23
22
export class IncrementalChecker {
24
- private programConfigFile : string ;
25
- private compilerOptions : object ;
26
- private linterConfigFile : string | false ;
27
- private linterAutoFix : boolean ;
28
- private watchPaths : string [ ] ;
29
- private workNumber : number ;
30
- private workDivision : number ;
31
- private checkSyntacticErrors : boolean ;
32
- private files : FilesRegister ;
23
+ programConfigFile : string ;
24
+ compilerOptions : object ;
25
+ linterConfigFile : string | false ;
26
+ linterAutoFix : boolean ;
27
+ watchPaths : string [ ] ;
28
+ workNumber : number ;
29
+ workDivision : number ;
30
+ checkSyntacticErrors : boolean ;
31
+ files : FilesRegister ;
33
32
34
33
linter ?: Linter ;
35
34
linterConfig ?: ConfigurationFile ;
@@ -155,7 +154,7 @@ export class IncrementalChecker {
155
154
linterExclusions : minimatch . IMinimatch [ ]
156
155
) : boolean {
157
156
return (
158
- endsWith ( filePath , '.d.ts' ) ||
157
+ filePath . endsWith ( '.d.ts' ) ||
159
158
linterExclusions . some ( matcher => matcher . match ( filePath ) )
160
159
) ;
161
160
}
@@ -304,7 +303,7 @@ export class IncrementalChecker {
304
303
cancellationToken . throwIfCancellationRequested ( ) ;
305
304
306
305
try {
307
- this . linter ! . lint ( fileName , undefined , this . linterConfig ) ;
306
+ this . linter ! . lint ( fileName , undefined ! , this . linterConfig ) ; // REVIEW: this shouldn't work?
308
307
} catch ( e ) {
309
308
if (
310
309
fs . existsSync ( fileName ) &&
0 commit comments