File tree 1 file changed +2
-5
lines changed
packages/@angular/cli/tasks
1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import * as ts from 'typescript';
9
9
// @ignoreDep tslint - used only for type information
10
10
import * as tslint from 'tslint' ;
11
11
import { requireProjectModule } from '../utilities/require-project-module' ;
12
+ import { stripBom } from '../utilities/strip-bom' ;
12
13
13
14
const SilentError = require ( 'silent-error' ) ;
14
15
const Task = require ( '../ember-cli/lib/models/task' ) ;
@@ -167,14 +168,10 @@ function getFilesToLint(
167
168
}
168
169
169
170
function getFileContents ( file : string ) : string {
170
- let contents : string ;
171
-
172
171
// NOTE: The tslint CLI checks for and excludes MPEG transport streams; this does not.
173
172
try {
174
- contents = fs . readFileSync ( file , 'utf8' ) ;
173
+ return stripBom ( fs . readFileSync ( file , 'utf-8' ) ) ;
175
174
} catch ( e ) {
176
175
throw new SilentError ( `Could not read file "${ file } ".` ) ;
177
176
}
178
-
179
- return contents ;
180
177
}
You can’t perform that action at this time.
0 commit comments