diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 157ea0ed959..ca8731a533f 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -726,7 +726,7 @@ namespace ts { // - The '--noLib' flag is used. // - A 'no-default-lib' reference comment is encountered in // processing the root files. - if (rootNames.length && !skipDefaultLib) { + if (!skipDefaultLib) { // If '--lib' is not specified, include default library file according to '--target' // otherwise, using options specified in '--lib' instead of '--target' default library file const defaultLibraryFileName = getDefaultLibraryFileName(); diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 87766f7f1ba..c4dc4b9216a 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -10521,7 +10521,12 @@ declare class TestLib { assert.deepEqual(semanticDiagnostics, []); }); const containerProject = service.configuredProjects.get(containerConfig.path)!; - checkProjectActualFiles(containerProject, [containerConfig.path]); + checkProjectActualFiles(containerProject, [containerConfig.path, libFile.path]); + const optionsDiagnostics = session.executeCommandSeq({ + command: protocol.CommandTypes.CompilerOptionsDiagnosticsFull, + arguments: { projectFileName: containerProject.projectName } + }).response; + assert.deepEqual(optionsDiagnostics, []); }); });