mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-13 04:57:55 -06:00
Include only files that can be emitted into the source file directory check for composite projects
Fixes #31181
This commit is contained in:
parent
3df65a7a85
commit
a58fdf2b35
@ -2768,10 +2768,8 @@ namespace ts {
|
||||
if (options.composite) {
|
||||
const rootPaths = rootNames.map(toPath);
|
||||
for (const file of files) {
|
||||
// Ignore declaration files
|
||||
if (file.isDeclarationFile) continue;
|
||||
// Ignore json file thats from project reference
|
||||
if (isJsonSourceFile(file) && getResolvedProjectReferenceToRedirect(file.fileName)) continue;
|
||||
// Ignore file that is not emitted
|
||||
if (!sourceFileMayBeEmitted(file, options, isSourceFileFromExternalLibrary, getResolvedProjectReferenceToRedirect)) continue;
|
||||
if (rootPaths.indexOf(file.path) === -1) {
|
||||
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern, file.fileName));
|
||||
}
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
error TS6307: File '/foo/node_modules/myModule/index.ts' is not in project file list. Projects must list all files or use an 'include' pattern.
|
||||
|
||||
|
||||
!!! error TS6307: File '/foo/node_modules/myModule/index.ts' is not in project file list. Projects must list all files or use an 'include' pattern.
|
||||
==== /foo/tsconfig.json (0 errors) ====
|
||||
{
|
||||
"compilerOptions": { "composite": true },
|
||||
"exclude": [ "node_modules" ]
|
||||
}
|
||||
|
||||
==== /foo/test.ts (0 errors) ====
|
||||
import myModule = require("myModule");
|
||||
new myModule.c();
|
||||
|
||||
|
||||
==== /foo/node_modules/myModule/index.ts (0 errors) ====
|
||||
export class c { }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user