@@ -127,7 +127,8 @@ export class Checker {
127127 this . lintFileResult =
128128 files . map ( file => {
129129 // get content of file
130- const fileContents = this . program . getSourceFile ( file ) . getFullText ( ) ;
130+ let fileContents : any = this . program . getSourceFile ( file ) ;
131+ fileContents = fileContents ? fileContents . getFullText ( ) : '' ;
131132
132133 // create new linter using lint options and tsprogram
133134 const linter = new tslint ! . Linter ( ( < TSLintTypes . ILinterOptions > options . lintoptions ) , this . program ) ;
@@ -441,16 +442,16 @@ export class Checker {
441442 . filter ( ( fileResult : TSLintTypes . LintResult ) => fileResult . failures ) ;
442443 const errors = erroredLintFiles
443444 . map (
444- ( fileResult : TSLintTypes . LintResult ) =>
445- fileResult . failures . map ( ( failure : any ) => ( {
446- fileName : failure . fileName ,
447- line : failure . startPosition . lineAndCharacter . line ,
448- char : failure . startPosition . lineAndCharacter . character ,
449- ruleSeverity : failure . ruleSeverity . charAt ( 0 ) . toUpperCase ( ) + failure . ruleSeverity . slice ( 1 ) ,
450- ruleName : failure . ruleName ,
451- color : options . yellowOnLint ? 'yellow' : 'red' ,
452- failure : failure . failure
453- } ) ) ) . reduce ( ( acc , curr ) => acc . concat ( curr ) , [ ] ) ;
445+ ( fileResult : TSLintTypes . LintResult ) =>
446+ fileResult . failures . map ( ( failure : any ) => ( {
447+ fileName : failure . fileName ,
448+ line : failure . startPosition . lineAndCharacter . line ,
449+ char : failure . startPosition . lineAndCharacter . character ,
450+ ruleSeverity : failure . ruleSeverity . charAt ( 0 ) . toUpperCase ( ) + failure . ruleSeverity . slice ( 1 ) ,
451+ ruleName : failure . ruleName ,
452+ color : options . yellowOnLint ? 'yellow' : 'red' ,
453+ failure : failure . failure
454+ } ) ) ) . reduce ( ( acc , curr ) => acc . concat ( curr ) , [ ] ) ;
454455 return errors ;
455456 }
456457
@@ -482,9 +483,9 @@ export class Checker {
482483 color = 'red' ;
483484 }
484485 const {
485- line,
486+ line,
486487 character
487- } = diag . file . getLineAndCharacterOfPosition ( diag . start ) ;
488+ } = diag . file . getLineAndCharacterOfPosition ( diag . start ) ;
488489 return {
489490 fileName : diag . file . fileName ,
490491 line : line + 1 , // `(${line + 1},${character + 1})`,
0 commit comments