Skip to content

Commit 2420b0b

Browse files
committed
fix(@angular/cli): lint now works with excluded files.
1 parent 3427cdc commit 2420b0b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/@angular/cli/tasks/lint.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ export default Task.extend({
4848
}, program);
4949

5050
files.forEach((file) => {
51-
const fileContents = program.getSourceFile(file).getFullText();
51+
const sourceFile = program.getSourceFile(file);
52+
if (!sourceFile) {
53+
return;
54+
}
55+
const fileContents = sourceFile.getFullText();
5256
const configLoad = Configuration.findConfiguration(config.tslintConfig, file);
5357
linter.lint(file, fileContents, configLoad.results);
5458
});

0 commit comments

Comments
 (0)