Skip to content

Commit a58fdf2

Browse files
committed
Include only files that can be emitted into the source file directory check for composite projects
Fixes #31181
1 parent 3df65a7 commit a58fdf2

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

src/compiler/program.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -2768,10 +2768,8 @@ namespace ts {
27682768
if (options.composite) {
27692769
const rootPaths = rootNames.map(toPath);
27702770
for (const file of files) {
2771-
// Ignore declaration files
2772-
if (file.isDeclarationFile) continue;
2773-
// Ignore json file thats from project reference
2774-
if (isJsonSourceFile(file) && getResolvedProjectReferenceToRedirect(file.fileName)) continue;
2771+
// Ignore file that is not emitted
2772+
if (!sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect)) continue;
27752773
if (rootPaths.indexOf(file.path) === -1) {
27762774
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName));
27772775
}

tests/baselines/reference/compositeWithNodeModulesSourceFile.errors.txt

-18
This file was deleted.

0 commit comments

Comments
 (0)