Skip to content

Commit f79e645

Browse files
Merge pull request #26870 from ajafff/composite-files-check
better condition for file include exhaustiveness check
2 parents 69f91b5 + 239a7b9 commit f79e645

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/compiler/program.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2430,12 +2430,14 @@ namespace ts {
24302430
}
24312431

24322432
// List of collected files is complete; validate exhautiveness if this is a project with a file list
2433-
if (options.composite && rootNames.length < files.length) {
2434-
const normalizedRootNames = rootNames.map(r => normalizePath(r).toLowerCase());
2435-
const sourceFiles = files.filter(f => !f.isDeclarationFile).map(f => normalizePath(f.path).toLowerCase());
2436-
for (const file of sourceFiles) {
2437-
if (normalizedRootNames.every(r => r !== file)) {
2438-
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern, file));
2433+
if (options.composite) {
2434+
const sourceFiles = files.filter(f => !f.isDeclarationFile);
2435+
if (rootNames.length < sourceFiles.length) {
2436+
const normalizedRootNames = rootNames.map(r => normalizePath(r).toLowerCase());
2437+
for (const file of sourceFiles.map(f => normalizePath(f.path).toLowerCase())) {
2438+
if (normalizedRootNames.indexOf(file) === -1) {
2439+
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern, file));
2440+
}
24392441
}
24402442
}
24412443
}

0 commit comments

Comments
 (0)