diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 81ea3942c59ec..6784485d21cac 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -59,6 +59,7 @@ import { isJsonSourceFile, isNumber, isString, + map, mapDefinedIterator, maybeBind, noop, @@ -187,10 +188,13 @@ export const enum BuilderFileEmit { Js = 1 << 0, // emit js file JsMap = 1 << 1, // emit js.map file JsInlineMap = 1 << 2, // emit inline source map in js file - Dts = 1 << 3, // emit d.ts file - DtsMap = 1 << 4, // emit d.ts.map file + DtsErrors = 1 << 3, // emit dts errors + DtsEmit = 1 << 4, // emit d.ts file + DtsMap = 1 << 5, // emit d.ts.map file + Dts = DtsErrors | DtsEmit, AllJs = Js | JsMap | JsInlineMap, + AllDtsEmit = DtsEmit | DtsMap, AllDts = Dts | DtsMap, All = AllJs | AllDts, } @@ -283,12 +287,7 @@ export function getBuilderFileEmit(options: CompilerOptions) { return result; } -/** - * Determining what all is pending to be emitted based on previous options or previous file emit flags - * - * @internal - */ -export function getPendingEmitKind( +function getPendingEmitKind( optionsOrEmitKind: CompilerOptions | BuilderFileEmit, oldOptionsOrEmitKind: CompilerOptions | BuilderFileEmit | undefined, ): BuilderFileEmit { @@ -300,8 +299,10 @@ export function getPendingEmitKind( let result = BuilderFileEmit.None; // If there is diff in Js emit, pending emit is js emit flags if (diff & BuilderFileEmit.AllJs) result = emitKind & BuilderFileEmit.AllJs; + // If dts errors pending, add dts errors flag + if (diff & BuilderFileEmit.DtsErrors) result = result | (emitKind & BuilderFileEmit.DtsErrors); // If there is diff in Dts emit, pending emit is dts emit flags - if (diff & BuilderFileEmit.AllDts) result = result | (emitKind & BuilderFileEmit.AllDts); + if (diff & BuilderFileEmit.AllDtsEmit) result = result | (emitKind & BuilderFileEmit.AllDtsEmit); return result; } @@ -689,32 +690,61 @@ function getNextAffectedFile( } } -function clearAffectedFilesPendingEmit(state: BuilderProgramState, emitOnlyDtsFiles: boolean | undefined) { +function clearAffectedFilesPendingEmit( + state: BuilderProgramState, + emitOnlyDtsFiles: boolean | undefined, + isForDtsErrors: boolean, +) { if (!state.affectedFilesPendingEmit?.size && !state.programEmitPending) return; - if (!emitOnlyDtsFiles) { + if (!emitOnlyDtsFiles && !isForDtsErrors) { state.affectedFilesPendingEmit = undefined; state.programEmitPending = undefined; } state.affectedFilesPendingEmit?.forEach((emitKind, path) => { // Mark the files as pending only if they are pending on js files, remove the dts emit pending flag - const pending = emitKind & BuilderFileEmit.AllJs; + const pending = !isForDtsErrors ? + emitKind & BuilderFileEmit.AllJs : + emitKind & (BuilderFileEmit.AllJs | BuilderFileEmit.AllDtsEmit); if (!pending) state.affectedFilesPendingEmit!.delete(path); else state.affectedFilesPendingEmit!.set(path, pending); }); // Mark the program as pending only if its pending on js files, remove the dts emit pending flag if (state.programEmitPending) { - const pending = state.programEmitPending & BuilderFileEmit.AllJs; + const pending = !isForDtsErrors ? + state.programEmitPending & BuilderFileEmit.AllJs : + state.programEmitPending & (BuilderFileEmit.AllJs | BuilderFileEmit.AllDtsEmit); if (!pending) state.programEmitPending = undefined; else state.programEmitPending = pending; } } +/** + * Determining what all is pending to be emitted based on previous options or previous file emit flags + * @internal + */ +export function getPendingEmitKindWithSeen( + optionsOrEmitKind: CompilerOptions | BuilderFileEmit, + seenOldOptionsOrEmitKind: CompilerOptions | BuilderFileEmit | undefined, + emitOnlyDtsFiles: boolean | undefined, + isForDtsErrors: boolean, +) { + let pendingKind = getPendingEmitKind(optionsOrEmitKind, seenOldOptionsOrEmitKind); + if (emitOnlyDtsFiles) pendingKind = pendingKind & BuilderFileEmit.AllDts; + if (isForDtsErrors) pendingKind = pendingKind & BuilderFileEmit.DtsErrors; + return pendingKind; +} + +function getBuilderFileEmitAllDts(isForDtsErrors: boolean) { + return !isForDtsErrors ? BuilderFileEmit.AllDts : BuilderFileEmit.DtsErrors; +} + /** * Returns next file to be emitted from files that retrieved semantic diagnostics but did not emit yet */ function getNextAffectedFilePendingEmit( state: BuilderProgramStateWithDefinedProgram, emitOnlyDtsFiles: boolean | undefined, + isForDtsErrors: boolean, ) { if (!state.affectedFilesPendingEmit?.size) return undefined; return forEachEntry(state.affectedFilesPendingEmit, (emitKind, path) => { @@ -724,13 +754,20 @@ function getNextAffectedFilePendingEmit( return undefined; } const seenKind = state.seenEmittedFiles?.get(affectedFile.resolvedPath); - let pendingKind = getPendingEmitKind(emitKind, seenKind); - if (emitOnlyDtsFiles) pendingKind = pendingKind & BuilderFileEmit.AllDts; + const pendingKind = getPendingEmitKindWithSeen( + emitKind, + seenKind, + emitOnlyDtsFiles, + isForDtsErrors, + ); if (pendingKind) return { affectedFile, emitKind: pendingKind }; }); } -function getNextPendingEmitDiagnosticsFile(state: BuilderProgramStateWithDefinedProgram) { +function getNextPendingEmitDiagnosticsFile( + state: BuilderProgramStateWithDefinedProgram, + isForDtsErrors: boolean, +) { if (!state.emitDiagnosticsPerFile?.size) return undefined; return forEachEntry(state.emitDiagnosticsPerFile, (diagnostics, path) => { const affectedFile = state.program.getSourceFileByPath(path); @@ -739,7 +776,7 @@ function getNextPendingEmitDiagnosticsFile(state: BuilderProgramStateWithDefined return undefined; } const seenKind = state.seenEmittedFiles?.get(affectedFile.resolvedPath) || BuilderFileEmit.None; - if (!(seenKind & BuilderFileEmit.AllDts)) return { affectedFile, diagnostics, seenKind }; + if (!(seenKind & getBuilderFileEmitAllDts(isForDtsErrors))) return { affectedFile, diagnostics, seenKind }; }); } @@ -1090,6 +1127,7 @@ export interface IncrementalBuildInfoBase extends BuildInfo { options: CompilerOptions | undefined; semanticDiagnosticsPerFile: IncrementalBuildInfoDiagnostic[] | undefined; emitDiagnosticsPerFile: IncrementalBuildInfoEmitDiagnostic[] | undefined; + changeFileSet: readonly IncrementalBuildInfoFileId[] | undefined; // Because this is only output file in the program, we dont need fileId to deduplicate name latestChangedDtsFile?: string | undefined; errors: true | undefined; @@ -1224,8 +1262,9 @@ function getBuildInfo(state: BuilderProgramStateWithDefinedProgram): BuildInfo { root, resolvedRoot: toResolvedRoot(), options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions), - semanticDiagnosticsPerFile: toIncrementalBuildInfoDiagnostics(), + semanticDiagnosticsPerFile: !state.changedFilesSet.size ? toIncrementalBuildInfoDiagnostics() : undefined, emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(), + changeFileSet: toChangeFileSet(), outSignature: state.outSignature, latestChangedDtsFile, pendingEmit: !state.programEmitPending ? @@ -1321,6 +1360,7 @@ function getBuildInfo(state: BuilderProgramStateWithDefinedProgram): BuildInfo { referencedMap, semanticDiagnosticsPerFile, emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(), + changeFileSet: toChangeFileSet(), affectedFilesPendingEmit, emitSignatures, latestChangedDtsFile, @@ -1427,7 +1467,7 @@ function getBuildInfo(state: BuilderProgramStateWithDefinedProgram): BuildInfo { state.fileInfos.forEach((_value, key) => { const value = state.semanticDiagnosticsPerFile.get(key); if (!value) { - result = append(result, toFileId(key)); + if (!state.changedFilesSet.has(key)) result = append(result, toFileId(key)); } else if (value.length) { result = append(result, [ @@ -1507,6 +1547,16 @@ function getBuildInfo(state: BuilderProgramStateWithDefinedProgram): BuildInfo { return result; }) || array; } + + function toChangeFileSet() { + let changeFileSet: IncrementalBuildInfoFileId[] | undefined; + if (state.changedFilesSet.size) { + for (const path of arrayFrom(state.changedFilesSet.keys()).sort(compareStringsCaseSensitive)) { + changeFileSet = append(changeFileSet, toFileId(path)); + } + } + return changeFileSet; + } } /** @internal */ @@ -1643,6 +1693,7 @@ export function createBuilderProgram( sourceFile, ); builderProgram.getSemanticDiagnostics = getSemanticDiagnostics; + builderProgram.getDeclarationDiagnostics = getDeclarationDiagnostics; builderProgram.emit = emit; builderProgram.releaseProgram = () => releaseCache(state); @@ -1680,28 +1731,42 @@ export function createBuilderProgram( * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host * in that order would be used to write the files */ - function emitNextAffectedFile( + function emitNextAffectedFileOrDtsErrors( writeFile: WriteFileCallback | undefined, cancellationToken: CancellationToken | undefined, emitOnlyDtsFiles: boolean | undefined, customTransformers: CustomTransformers | undefined, + isForDtsErrors: boolean, ): AffectedFileResult { Debug.assert(isBuilderProgramStateWithDefinedProgram(state)); let affected = getNextAffectedFile(state, cancellationToken, host); const programEmitKind = getBuilderFileEmit(state.compilerOptions); - let emitKind: BuilderFileEmit = emitOnlyDtsFiles ? - programEmitKind & BuilderFileEmit.AllDts : programEmitKind; + let emitKind: BuilderFileEmit = !isForDtsErrors ? + emitOnlyDtsFiles ? + programEmitKind & BuilderFileEmit.AllDts : + programEmitKind : + BuilderFileEmit.DtsErrors; if (!affected) { if (!state.compilerOptions.outFile) { - const pendingAffectedFile = getNextAffectedFilePendingEmit(state, emitOnlyDtsFiles); + const pendingAffectedFile = getNextAffectedFilePendingEmit( + state, + emitOnlyDtsFiles, + isForDtsErrors, + ); if (pendingAffectedFile) { // Emit pending affected file ({ affectedFile: affected, emitKind } = pendingAffectedFile); } else { - const pendingForDiagnostics = getNextPendingEmitDiagnosticsFile(state); + const pendingForDiagnostics = getNextPendingEmitDiagnosticsFile( + state, + isForDtsErrors, + ); if (pendingForDiagnostics) { - (state.seenEmittedFiles ??= new Map()).set(pendingForDiagnostics.affectedFile.resolvedPath, pendingForDiagnostics.seenKind | BuilderFileEmit.AllDts); + (state.seenEmittedFiles ??= new Map()).set( + pendingForDiagnostics.affectedFile.resolvedPath, + pendingForDiagnostics.seenKind | getBuilderFileEmitAllDts(isForDtsErrors), + ); return { result: { emitSkipped: true, diagnostics: pendingForDiagnostics.diagnostics }, affected: pendingForDiagnostics.affectedFile, @@ -1712,15 +1777,19 @@ export function createBuilderProgram( else { // Emit program if it was pending emit if (state.programEmitPending) { - emitKind = state.programEmitPending; - if (emitOnlyDtsFiles) emitKind = emitKind & BuilderFileEmit.AllDts; + emitKind = getPendingEmitKindWithSeen( + state.programEmitPending, + state.seenProgramEmit, + emitOnlyDtsFiles, + isForDtsErrors, + ); if (emitKind) affected = state.program!; } // Pending emit diagnostics if (!affected && state.emitDiagnosticsPerFile?.size) { const seenKind = state.seenProgramEmit || BuilderFileEmit.None; - if (!(seenKind & BuilderFileEmit.AllDts)) { - state.seenProgramEmit = BuilderFileEmit.AllDts | seenKind; + if (!(seenKind & getBuilderFileEmitAllDts(isForDtsErrors))) { + state.seenProgramEmit = getBuilderFileEmitAllDts(isForDtsErrors) | seenKind; const diagnostics: Diagnostic[] = []; state.emitDiagnosticsPerFile.forEach(d => addRange(diagnostics, d)); return { @@ -1733,7 +1802,7 @@ export function createBuilderProgram( if (!affected) { // Emit buildinfo if pending - if (!getBuildInfoEmitPending(state)) return undefined; + if (isForDtsErrors || !getBuildInfoEmitPending(state)) return undefined; const affected = state.program; const result = affected.emitBuildInfo( writeFile || maybeBind(host, host.writeFile), @@ -1748,15 +1817,23 @@ export function createBuilderProgram( if (emitKind & BuilderFileEmit.AllJs) emitOnly = EmitOnly.Js; if (emitKind & BuilderFileEmit.AllDts) emitOnly = emitOnly === undefined ? EmitOnly.Dts : undefined; // Actual emit without buildInfo as we want to emit it later so the state is updated - const result = state.program.emit( - affected === state.program ? undefined : affected as SourceFile, - getWriteFileCallback(writeFile, customTransformers), - cancellationToken, - emitOnly, - customTransformers, - /*forceDtsEmit*/ undefined, - /*skipBuildInfo*/ true, - ); + const result = !isForDtsErrors ? + state.program.emit( + affected === state.program ? undefined : affected as SourceFile, + getWriteFileCallback(writeFile, customTransformers), + cancellationToken, + emitOnly, + customTransformers, + /*forceDtsEmit*/ undefined, + /*skipBuildInfo*/ true, + ) : + { + emitSkipped: true, + diagnostics: state.program.getDeclarationDiagnostics( + affected === state.program ? undefined : affected as SourceFile, + cancellationToken, + ), + }; if (affected !== state.program) { // update affected files const affectedSourceFile = affected as SourceFile; @@ -1783,21 +1860,45 @@ export function createBuilderProgram( getPendingEmitKind(state.programEmitPending, emitKind) : undefined; state.seenProgramEmit = emitKind | (state.seenProgramEmit || BuilderFileEmit.None); - // Update the d.ts diagnostics since they always come with Location, skip diagnsotics without file, - // they could be semantic diagnsotic with noEmitOnError or other kind of diagnostics - let emitDiagnosticsPerFile: Map | undefined; - result.diagnostics.forEach(d => { - if (!d.file) return; // Dont cache without fileName - let diagnostics = emitDiagnosticsPerFile?.get(d.file.resolvedPath); - if (!diagnostics) (emitDiagnosticsPerFile ??= new Map()).set(d.file.resolvedPath, diagnostics = []); - diagnostics.push(d); - }); - if (emitDiagnosticsPerFile) state.emitDiagnosticsPerFile = emitDiagnosticsPerFile; + setEmitDiagnosticsPerFile(result.diagnostics); state.buildInfoEmitPending = true; } return { result, affected }; } + function setEmitDiagnosticsPerFile(diagnostics: readonly Diagnostic[]) { + // Update the d.ts diagnostics since they always come with Location, skip diagnsotics without file, + // they could be semantic diagnsotic with noEmitOnError or other kind of diagnostics + let emitDiagnosticsPerFile: Map | undefined; + diagnostics.forEach(d => { + if (!d.file) return; // Dont cache without fileName + let diagnostics = emitDiagnosticsPerFile?.get(d.file.resolvedPath); + if (!diagnostics) (emitDiagnosticsPerFile ??= new Map()).set(d.file.resolvedPath, diagnostics = []); + diagnostics.push(d); + }); + if (emitDiagnosticsPerFile) state.emitDiagnosticsPerFile = emitDiagnosticsPerFile; + } + + /** + * Emits the next affected file's emit result (EmitResult and sourceFiles emitted) or returns undefined if iteration is complete + * The first of writeFile if provided, writeFile of BuilderProgramHost if provided, writeFile of compiler host + * in that order would be used to write the files + */ + function emitNextAffectedFile( + writeFile: WriteFileCallback | undefined, + cancellationToken: CancellationToken | undefined, + emitOnlyDtsFiles: boolean | undefined, + customTransformers: CustomTransformers | undefined, + ): AffectedFileResult { + return emitNextAffectedFileOrDtsErrors( + writeFile, + cancellationToken, + emitOnlyDtsFiles, + customTransformers, + /*isForDtsErrors*/ false, + ); + } + function getWriteFileCallback( writeFile: WriteFileCallback | undefined, customTransformers: CustomTransformers | undefined, @@ -1940,16 +2041,75 @@ export function createBuilderProgram( } // In non Emit builder, clear affected files pending emit else { - clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles); + clearAffectedFilesPendingEmit( + state, + emitOnlyDtsFiles, + /*isForDtsErrors*/ false, + ); } } - return state.program.emit( + const emitResult = state.program.emit( targetSourceFile, getWriteFileCallback(writeFile, customTransformers), cancellationToken, emitOnlyDtsFiles, customTransformers, ); + handleNonEmitBuilderWithEmitOrDtsErrors( + targetSourceFile, + emitOnlyDtsFiles, + /*isForDtsErrors*/ false, + emitResult.diagnostics, + ); + return emitResult; + } + + function handleNonEmitBuilderWithEmitOrDtsErrors( + targetSourceFile: SourceFile | undefined, + emitOnlyDtsFiles: boolean | undefined, + isForDtsErrors: boolean, + diagnostics: EmitResult["diagnostics"], + ) { + if (!targetSourceFile && kind !== BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles, isForDtsErrors); + setEmitDiagnosticsPerFile(diagnostics); + } + } + + function getDeclarationDiagnostics( + sourceFile?: SourceFile, + cancellationToken?: CancellationToken, + ): readonly DiagnosticWithLocation[] { + Debug.assert(isBuilderProgramStateWithDefinedProgram(state)); + if (kind === BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram) { + assertSourceFileOkWithoutNextAffectedCall(state, sourceFile); + let affectedEmitResult: AffectedFileResult; + let diagnostics: Diagnostic[] | undefined; + while ( + affectedEmitResult = emitNextAffectedFileOrDtsErrors( + /*writeFile*/ undefined, + cancellationToken, + /*emitOnlyDtsFiles*/ undefined, + /*customTransformers*/ undefined, + /*isForDtsErrors*/ true, + ) + ) { + if (!sourceFile) diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics); + } + return ( + !sourceFile ? diagnostics : state.emitDiagnosticsPerFile?.get(sourceFile.resolvedPath) + ) as readonly DiagnosticWithLocation[] | undefined || emptyArray; + } + else { + const result = state.program.getDeclarationDiagnostics(sourceFile, cancellationToken); + handleNonEmitBuilderWithEmitOrDtsErrors( + sourceFile, + /*emitOnlyDtsFiles*/ undefined, + /*isForDtsErrors*/ true, + result, + ); + return result; + } } /** @@ -2097,6 +2257,7 @@ export function createBuilderProgramUsingIncrementalBuildInfo( let filePathsSetList: Set[] | undefined; const latestChangedDtsFile = buildInfo.latestChangedDtsFile ? toAbsolutePath(buildInfo.latestChangedDtsFile) : undefined; const fileInfos = new Map(); + const changedFilesSet = new Set(map(buildInfo.changeFileSet, toFilePath)); if (isIncrementalBundleEmitBuildInfo(buildInfo)) { buildInfo.fileInfos.forEach((fileInfo, index) => { const path = toFilePath(index + 1 as IncrementalBuildInfoFileId); @@ -2108,6 +2269,7 @@ export function createBuilderProgramUsingIncrementalBuildInfo( semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile), emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile), hasReusableDiagnostic: true, + changedFilesSet, latestChangedDtsFile, outSignature: buildInfo.outSignature, programEmitPending: buildInfo.pendingEmit === undefined ? undefined : toProgramEmitPending(buildInfo.pendingEmit, buildInfo.options), @@ -2145,6 +2307,7 @@ export function createBuilderProgramUsingIncrementalBuildInfo( semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile), emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile), hasReusableDiagnostic: true, + changedFilesSet, affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit && arrayToMap(buildInfo.affectedFilesPendingEmit, value => toFilePath(isNumber(value) ? value : value[0]), value => toBuilderFileEmit(value, fullEmitForOptions!)), latestChangedDtsFile, emitSignatures: emitSignatures?.size ? emitSignatures : undefined, @@ -2206,7 +2369,7 @@ export function createBuilderProgramUsingIncrementalBuildInfo( const semanticDiagnostics = new Map( mapDefinedIterator( fileInfos.keys(), - key => [key, emptyArray], + key => !changedFilesSet.has(key) ? [key, emptyArray] : undefined, ), ); diagnostics?.forEach(value => { diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 0b26847b20b12..cf0322c320b72 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1165,11 +1165,6 @@ function getLibFileNameFromLibReference(libReference: FileReference) { return libMap.get(libName); } -interface DiagnosticCache { - perFile?: Map; - allDiagnostics?: readonly T[]; -} - /** @internal */ export function isReferencedFile(reason: FileIncludeReason | undefined): reason is ReferencedFile { switch (reason?.kind) { @@ -1555,8 +1550,8 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg let filesWithReferencesProcessed: Set | undefined; let fileReasonsToChain: Map | undefined; let reasonToRelatedInfo: Map | undefined; - const cachedBindAndCheckDiagnosticsForFile: DiagnosticCache = {}; - const cachedDeclarationDiagnosticsForFile: DiagnosticCache = {}; + let cachedBindAndCheckDiagnosticsForFile: Map | undefined; + let cachedDeclarationDiagnosticsForFile: Map | undefined; let fileProcessingDiagnostics: FilePreprocessingDiagnostics[] | undefined; let automaticTypeDirectiveNames: string[] | undefined; @@ -2921,10 +2916,8 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg ); } - function getCachedSemanticDiagnostics(sourceFile?: SourceFile): readonly Diagnostic[] | undefined { - return sourceFile - ? cachedBindAndCheckDiagnosticsForFile.perFile?.get(sourceFile.path) - : cachedBindAndCheckDiagnosticsForFile.allDiagnostics; + function getCachedSemanticDiagnostics(sourceFile: SourceFile): readonly Diagnostic[] | undefined { + return cachedBindAndCheckDiagnosticsForFile?.get(sourceFile.path); } function getBindAndCheckDiagnostics(sourceFile: SourceFile, cancellationToken?: CancellationToken): readonly Diagnostic[] { @@ -2945,14 +2938,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg } function getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): readonly DiagnosticWithLocation[] { - const options = program.getCompilerOptions(); - // collect diagnostics from the program only once if either no source file was specified or out/outFile is set (bundled emit) - if (!sourceFile || options.outFile) { - return getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); - } - else { - return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken); - } + return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile, cancellationToken); } function getSyntacticDiagnosticsForFile(sourceFile: SourceFile): readonly DiagnosticWithLocation[] { @@ -3001,7 +2987,14 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg if (nodesToCheck) { return getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken, nodesToCheck); } - return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedBindAndCheckDiagnosticsForFile, getBindAndCheckDiagnosticsForFileNoCache); + let result = cachedBindAndCheckDiagnosticsForFile?.get(sourceFile.path); + if (!result) { + (cachedBindAndCheckDiagnosticsForFile ??= new Map()).set( + sourceFile.path, + result = getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken), + ); + } + return result; } function getBindAndCheckDiagnosticsForFileNoCache( @@ -3361,11 +3354,18 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg }); } - function getDeclarationDiagnosticsWorker(sourceFile: SourceFile | undefined, cancellationToken: CancellationToken | undefined): readonly DiagnosticWithLocation[] { - return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedDeclarationDiagnosticsForFile, getDeclarationDiagnosticsForFileNoCache); + function getDeclarationDiagnosticsWorker(sourceFile: SourceFile, cancellationToken: CancellationToken | undefined): readonly DiagnosticWithLocation[] { + let result = cachedDeclarationDiagnosticsForFile?.get(sourceFile.path); + if (!result) { + (cachedDeclarationDiagnosticsForFile ??= new Map()).set( + sourceFile.path, + result = getDeclarationDiagnosticsForFileNoCache(sourceFile, cancellationToken), + ); + } + return result; } - function getDeclarationDiagnosticsForFileNoCache(sourceFile: SourceFile | undefined, cancellationToken: CancellationToken | undefined): readonly DiagnosticWithLocation[] { + function getDeclarationDiagnosticsForFileNoCache(sourceFile: SourceFile, cancellationToken: CancellationToken | undefined): readonly DiagnosticWithLocation[] { return runWithCancellationToken(() => { const resolver = getTypeChecker().getEmitResolver(sourceFile, cancellationToken); // Don't actually write any files since we're just getting diagnostics. @@ -3373,31 +3373,8 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg }); } - function getAndCacheDiagnostics( - sourceFile: T, - cancellationToken: CancellationToken | undefined, - cache: DiagnosticCache, - getDiagnostics: (sourceFile: T, cancellationToken: CancellationToken | undefined) => readonly U[], - ): readonly U[] { - const cachedResult = sourceFile - ? cache.perFile?.get(sourceFile.path) - : cache.allDiagnostics; - - if (cachedResult) { - return cachedResult; - } - const result = getDiagnostics(sourceFile, cancellationToken); - if (sourceFile) { - (cache.perFile || (cache.perFile = new Map())).set(sourceFile.path, result); - } - else { - cache.allDiagnostics = result; - } - return result; - } - function getDeclarationDiagnosticsForFile(sourceFile: SourceFile, cancellationToken: CancellationToken | undefined): readonly DiagnosticWithLocation[] { - return sourceFile.isDeclarationFile ? [] : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); + return sourceFile.isDeclarationFile ? emptyArray : getDeclarationDiagnosticsWorker(sourceFile, cancellationToken); } function getOptionsDiagnostics(): SortedReadonlyArray { @@ -5360,8 +5337,6 @@ export function handleNoEmitOptions( ): EmitResult | undefined { const options = program.getCompilerOptions(); if (options.noEmit) { - // Cache the semantic diagnostics - program.getSemanticDiagnostics(sourceFile, cancellationToken); return sourceFile ? emitSkippedWithNoDiagnostics : program.emitBuildInfo(writeFile, cancellationToken); diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts index 14c90c911039e..97d3d4626e600 100644 --- a/src/compiler/transformers/declarations.ts +++ b/src/compiler/transformers/declarations.ts @@ -214,19 +214,24 @@ import { } from "../_namespaces/ts.js"; /** @internal */ -export function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver, file: SourceFile | undefined): DiagnosticWithLocation[] | undefined { +export function getDeclarationDiagnostics( + host: EmitHost, + resolver: EmitResolver, + file: SourceFile, +): DiagnosticWithLocation[] | undefined { const compilerOptions = host.getCompilerOptions(); const files = filter(getSourceFilesToEmit(host, file), isSourceFileNotJson); - const result = transformNodes( - resolver, - host, - factory, - compilerOptions, - file ? contains(files, file) ? [file] : emptyArray : files, - [transformDeclarations], - /*allowDtsFiles*/ false, - ); - return result.diagnostics; + return contains(files, file) ? + transformNodes( + resolver, + host, + factory, + compilerOptions, + [file], + [transformDeclarations], + /*allowDtsFiles*/ false, + ).diagnostics : + undefined; } const declarationEmitNodeBuilderFlags = NodeBuilderFlags.MultilineObjectLiterals | diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index b3bab89503dd7..7b9b398cf2d0a 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -66,7 +66,7 @@ import { getNonIncrementalBuildInfoRoots, getNormalizedAbsolutePath, getParsedCommandLineOfConfigFile, - getPendingEmitKind, + getPendingEmitKindWithSeen, getSourceFileVersionAsHashFromText, getTsBuildInfoEmitOutputFilePath, getWatchErrorSummaryDiagnosticMessage, @@ -1511,8 +1511,14 @@ function getUpToDateStatusWorker(state: SolutionBuilde // If there are errors, we need to build project again to report it if ( !project.options.noCheck && - (incrementalBuildInfo.semanticDiagnosticsPerFile?.length || - (!project.options.noEmit && getEmitDeclarations(project.options) && incrementalBuildInfo.emitDiagnosticsPerFile?.length)) + ( + incrementalBuildInfo.changeFileSet?.length || + incrementalBuildInfo.semanticDiagnosticsPerFile?.length || + ( + getEmitDeclarations(project.options) && + incrementalBuildInfo.emitDiagnosticsPerFile?.length + ) + ) ) { return { type: UpToDateStatusType.OutOfDateBuildInfoWithErrors, @@ -1523,8 +1529,11 @@ function getUpToDateStatusWorker(state: SolutionBuilde // If there are pending changes that are not emitted, project is out of date if ( !project.options.noEmit && - ((incrementalBuildInfo as IncrementalMultiFileEmitBuildInfo).affectedFilesPendingEmit?.length || - (incrementalBuildInfo as IncrementalBundleEmitBuildInfo).pendingEmit !== undefined) + ( + incrementalBuildInfo.changeFileSet?.length || + (incrementalBuildInfo as IncrementalMultiFileEmitBuildInfo).affectedFilesPendingEmit?.length || + (incrementalBuildInfo as IncrementalBundleEmitBuildInfo).pendingEmit !== undefined + ) ) { return { type: UpToDateStatusType.OutOfDateBuildInfoWithPendingEmit, @@ -1533,7 +1542,18 @@ function getUpToDateStatusWorker(state: SolutionBuilde } // Has not emitted some of the files, project is out of date - if (!project.options.noEmit && getPendingEmitKind(project.options, incrementalBuildInfo.options || {})) { + if ( + ( + !project.options.noEmit || + (project.options.noEmit && getEmitDeclarations(project.options)) + ) && + getPendingEmitKindWithSeen( + project.options, + incrementalBuildInfo.options || {}, + /*emitOnlyDtsFiles*/ undefined, + !!project.options.noEmit, + ) + ) { return { type: UpToDateStatusType.OutOfDateOptions, buildInfoFile: buildInfoPath, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 62fae4c0e57c2..508042f69bee8 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4733,7 +4733,7 @@ export interface Program extends ScriptReferenceHost { /** @internal */ getCommonSourceDirectory(): string; - /** @internal */ getCachedSemanticDiagnostics(sourceFile?: SourceFile): readonly Diagnostic[] | undefined; + /** @internal */ getCachedSemanticDiagnostics(sourceFile: SourceFile): readonly Diagnostic[] | undefined; /** @internal */ getClassifiableNames(): Set<__String>; diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 2bdeded0e6a7b..618545564c592 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -55,6 +55,7 @@ import { generateDjb2Hash, getDefaultLibFileName, getDirectoryPath, + getEmitDeclarations, getEmitScriptTarget, getLineAndCharacterOfPosition, getNameOfScriptTarget, @@ -570,7 +571,7 @@ export function emitFilesAndReportErrors( emitResult: EmitResult; diagnostics: SortedReadonlyArray; } { - const isListFilesOnly = !!program.getCompilerOptions().listFilesOnly; + const options = program.getCompilerOptions(); // First get and report any syntactic errors. const allDiagnostics = program.getConfigFileParsingDiagnostics().slice(); @@ -582,17 +583,25 @@ export function emitFilesAndReportErrors( if (allDiagnostics.length === configFileParsingDiagnosticsLength) { addRange(allDiagnostics, program.getOptionsDiagnostics(cancellationToken)); - if (!isListFilesOnly) { + if (!options.listFilesOnly) { addRange(allDiagnostics, program.getGlobalDiagnostics(cancellationToken)); if (allDiagnostics.length === configFileParsingDiagnosticsLength) { addRange(allDiagnostics, program.getSemanticDiagnostics(/*sourceFile*/ undefined, cancellationToken)); } + + if ( + options.noEmit && + getEmitDeclarations(options) && + allDiagnostics.length === configFileParsingDiagnosticsLength + ) { + addRange(allDiagnostics, program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken)); + } } } // Emit and report any errors we ran into. - const emitResult = isListFilesOnly + const emitResult = options.listFilesOnly ? { emitSkipped: true, diagnostics: emptyArray } : program.emit(/*targetSourceFile*/ undefined, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); addRange(allDiagnostics, emitResult.diagnostics); diff --git a/src/testRunner/tests.ts b/src/testRunner/tests.ts index 8b100774e33f7..9cdb432d5c53e 100644 --- a/src/testRunner/tests.ts +++ b/src/testRunner/tests.ts @@ -138,6 +138,7 @@ export * from "./unittests/tscWatch/incremental.js"; export * from "./unittests/tscWatch/libraryResolution.js"; export * from "./unittests/tscWatch/moduleResolution.js"; export * from "./unittests/tscWatch/nodeNextWatch.js"; +export * from "./unittests/tscWatch/noEmit.js"; export * from "./unittests/tscWatch/noEmitOnError.js"; export * from "./unittests/tscWatch/programUpdates.js"; export * from "./unittests/tscWatch/projectsWithReferences.js"; diff --git a/src/testRunner/unittests/helpers/baseline.ts b/src/testRunner/unittests/helpers/baseline.ts index a86bebaa591d6..7f5cc3e7390cd 100644 --- a/src/testRunner/unittests/helpers/baseline.ts +++ b/src/testRunner/unittests/helpers/baseline.ts @@ -136,10 +136,10 @@ export function generateSourceMapBaselineFiles(sys: ts.System & { writtenFiles: } export type ReadableIncrementalBuildInfoDiagnosticOfFile = [file: string, diagnostics: readonly ts.ReusableDiagnostic[]]; -export type ReadableIncrementalBuildInfoDiagnostic = [file: string, "not cached"] | ReadableIncrementalBuildInfoDiagnosticOfFile; +export type ReadableIncrementalBuildInfoDiagnostic = [file: string, "not cached or not changed"] | ReadableIncrementalBuildInfoDiagnosticOfFile; export type ReadableIncrementalBuildInfoEmitDiagnostic = ReadableIncrementalBuildInfoDiagnosticOfFile; export type ReadableBuilderFileEmit = string & { __readableBuilderFileEmit: any; }; -export type ReadableIncrementalBuilderInfoFilePendingEmit = [original: string | [string], emitKind: ReadableBuilderFileEmit]; +export type ReadableIncrementalBuilderInfoFilePendingEmit = [original: string | [file: string] | [file: string, emitKind: ts.BuilderFileEmit], emitKind: ReadableBuilderFileEmit]; export type ReadableIncrementalBuildInfoEmitSignature = string | [file: string, signature: ts.EmitSignature | []]; export type ReadableIncrementalBuildInfoFileInfo = Omit & { impliedFormat: string | undefined; @@ -161,12 +161,14 @@ export type ReadableIncrementalBuildInfoBase = | "resolvedRoot" | "semanticDiagnosticsPerFile" | "emitDiagnosticsPerFile" + | "changeFileSet" > & { root: readonly ReadableIncrementalBuildInfoRoot[]; resolvedRoot: readonly ReadableIncrementalBuildInfoResolvedRoot[] | undefined; semanticDiagnosticsPerFile: readonly ReadableIncrementalBuildInfoDiagnostic[] | undefined; emitDiagnosticsPerFile: readonly ReadableIncrementalBuildInfoEmitDiagnostic[] | undefined; + changeFileSet: readonly string[] | undefined; } & ReadableBuildInfo; export type ReadableIncrementalMultiFileEmitBuildInfo = @@ -179,6 +181,7 @@ export type ReadableIncrementalMultiFileEmitBuildInfo = | "referencedMap" | "semanticDiagnosticsPerFile" | "emitDiagnosticsPerFile" + | "changeFileSet" | "affectedFilesPendingEmit" | "emitSignatures" > @@ -199,6 +202,7 @@ export type ReadableIncrementalBundleEmitBuildInfo = | "resolvedRoot" | "semanticDiagnosticsPerFile" | "emitDiagnosticsPerFile" + | "changeFileSet" | "pendingEmit" > & ReadableIncrementalBuildInfoBase @@ -247,6 +251,7 @@ function generateBuildInfoBaseline(sys: ts.System, buildInfoPath: string, buildI resolvedRoot: buildInfo.resolvedRoot?.map(toReadableIncrementalBuildInfoResolvedRoot), semanticDiagnosticsPerFile: toReadableIncrementalBuildInfoDiagnostic(buildInfo.semanticDiagnosticsPerFile), emitDiagnosticsPerFile: toReadableIncrementalBuildInfoEmitDiagnostic(buildInfo.emitDiagnosticsPerFile), + changeFileSet: buildInfo.changeFileSet?.map(toFileName), pendingEmit: pendingEmit === undefined ? undefined : [ @@ -271,6 +276,7 @@ function generateBuildInfoBaseline(sys: ts.System, buildInfoPath: string, buildI referencedMap: toMapOfReferencedSet(buildInfo.referencedMap), semanticDiagnosticsPerFile: toReadableIncrementalBuildInfoDiagnostic(buildInfo.semanticDiagnosticsPerFile), emitDiagnosticsPerFile: toReadableIncrementalBuildInfoEmitDiagnostic(buildInfo.emitDiagnosticsPerFile), + changeFileSet: buildInfo.changeFileSet?.map(toFileName), affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit?.map(value => toReadableIncrementalBuilderInfoFilePendingEmit(value, fullEmitForOptions!)), emitSignatures: buildInfo.emitSignatures?.map(s => ts.isNumber(s) ? @@ -339,7 +345,11 @@ function generateBuildInfoBaseline(sys: ts.System, buildInfoPath: string, buildI fullEmitForOptions: ts.BuilderFileEmit, ): ReadableIncrementalBuilderInfoFilePendingEmit { return [ - ts.isNumber(value) ? toFileName(value) : [toFileName(value[0])], + ts.isNumber(value) ? + toFileName(value) : + !value[1] ? + [toFileName(value[0])] : + [toFileName(value[0]), value[1]], toReadableBuilderFileEmit(ts.toBuilderFileEmit(value, fullEmitForOptions)), ]; } @@ -350,7 +360,11 @@ function generateBuildInfoBaseline(sys: ts.System, buildInfoPath: string, buildI if (emit & ts.BuilderFileEmit.Js) addFlags("Js"); if (emit & ts.BuilderFileEmit.JsMap) addFlags("JsMap"); if (emit & ts.BuilderFileEmit.JsInlineMap) addFlags("JsInlineMap"); - if (emit & ts.BuilderFileEmit.Dts) addFlags("Dts"); + if ((emit & ts.BuilderFileEmit.Dts) === ts.BuilderFileEmit.Dts) addFlags("Dts"); + else { + if (emit & ts.BuilderFileEmit.DtsEmit) addFlags("DtsEmit"); + if (emit & ts.BuilderFileEmit.DtsErrors) addFlags("DtsErrors"); + } if (emit & ts.BuilderFileEmit.DtsMap) addFlags("DtsMap"); } return (result || "None") as ReadableBuilderFileEmit; @@ -364,7 +378,7 @@ function generateBuildInfoBaseline(sys: ts.System, buildInfoPath: string, buildI ): readonly ReadableIncrementalBuildInfoDiagnostic[] | undefined { return diagnostics?.map(d => ts.isNumber(d) ? - [toFileName(d), "not cached"] : + [toFileName(d), "not cached or not changed"] : [toFileName(d[0]), d[1]] ); } diff --git a/src/testRunner/unittests/helpers/noEmit.ts b/src/testRunner/unittests/helpers/noEmit.ts new file mode 100644 index 0000000000000..b097144ec9f0e --- /dev/null +++ b/src/testRunner/unittests/helpers/noEmit.ts @@ -0,0 +1,477 @@ +import { + CompilerOptions, + hasProperty, + ModuleKind, + noop, +} from "../../_namespaces/ts.js"; +import { dedent } from "../../_namespaces/Utils.js"; +import { jsonToReadableText } from "../helpers.js"; +import { + compilerOptionsToConfigJson, + FsContents, + libContent, +} from "./contents.js"; +import { + noChangeRun, + TestTscEdit, + verifyTsc, +} from "./tsc.js"; +import { verifyTscWatch } from "./tscWatch.js"; +import { + loadProjectFromFiles, + replaceText, +} from "./vfs.js"; +import { + createWatchedSystem, + libFile, +} from "./virtualFileSystemWithWatch.js"; + +function forEachNoEmitChangesWorker(commandType: string[], compilerOptions: CompilerOptions) { + const discrepancyExplanation = () => [ + "Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files", + "Incremental will store the past latestChangedDtsFile and emitSignatures", + ]; + const noChangeRunWithNoEmit: TestTscEdit = { + ...noChangeRun, + caption: "No Change run with noEmit", + commandLineArgs: [...commandType, "src/project", "--noEmit"], + discrepancyExplanation: compilerOptions.composite ? + discrepancyExplanation : + undefined, + }; + const noChangeRunWithEmit: TestTscEdit = { + ...noChangeRun, + caption: "No Change run with emit", + commandLineArgs: [...commandType, "src/project"], + }; + let optionsString = ""; + for (const key in compilerOptions) { + if (hasProperty(compilerOptions, key) && key !== "outFile" && key !== "module") { + optionsString += ` ${key}`; + } + } + function scenarioName(text: string) { + return `${compilerOptions.outFile ? "outFile" : "multiFile"}/${text}${optionsString}`; + } + + verifyTsc({ + scenario: "noEmit", + subScenario: scenarioName("changes"), + commandLineArgs: [...commandType, "src/project"], + fs, + edits: [ + noChangeRunWithNoEmit, + noChangeRunWithNoEmit, + { + caption: "Introduce error but still noEmit", + commandLineArgs: [...commandType, "src/project", "--noEmit"], + edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), + discrepancyExplanation: compilerOptions.composite ? + discrepancyExplanation : + undefined, + }, + { + caption: "Fix error and emit", + edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), + }, + noChangeRunWithEmit, + noChangeRunWithNoEmit, + noChangeRunWithNoEmit, + noChangeRunWithEmit, + { + caption: "Introduce error and emit", + edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), + }, + noChangeRunWithEmit, + noChangeRunWithNoEmit, + noChangeRunWithNoEmit, + noChangeRunWithEmit, + { + caption: "Fix error and no emit", + commandLineArgs: [...commandType, "src/project", "--noEmit"], + edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), + discrepancyExplanation: compilerOptions.composite ? + discrepancyExplanation : + undefined, + }, + noChangeRunWithEmit, + noChangeRunWithNoEmit, + noChangeRunWithNoEmit, + noChangeRunWithEmit, + ], + }); + + verifyTsc({ + scenario: "noEmit", + subScenario: scenarioName("changes with initial noEmit"), + commandLineArgs: [...commandType, "src/project", "--noEmit"], + fs, + edits: [ + noChangeRunWithEmit, + { + caption: "Introduce error with emit", + commandLineArgs: [...commandType, "src/project"], + edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), + }, + { + caption: "Fix error and no emit", + edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), + discrepancyExplanation: compilerOptions.composite ? + discrepancyExplanation : + undefined, + }, + noChangeRunWithEmit, + ], + }); + + function fs() { + return loadProjectFromFiles({ + "/src/project/src/class.ts": dedent` + export class classC { + prop = 1; + }`, + "/src/project/src/indirectClass.ts": dedent` + import { classC } from './class'; + export class indirectClass { + classC = new classC(); + }`, + "/src/project/src/directUse.ts": dedent` + import { indirectClass } from './indirectClass'; + new indirectClass().classC.prop;`, + "/src/project/src/indirectUse.ts": dedent` + import { indirectClass } from './indirectClass'; + new indirectClass().classC.prop;`, + "/src/project/src/noChangeFile.ts": dedent` + export function writeLog(s: string) { + }`, + "/src/project/src/noChangeFileWithEmitSpecificError.ts": dedent` + function someFunc(arguments: boolean, ...rest: any[]) { + }`, + "/src/project/tsconfig.json": jsonToReadableText({ + compilerOptions: compilerOptionsToConfigJson(compilerOptions), + }), + }); + } +} + +export function forEachNoEmitChanges(commandType: string[]) { + describe("when noEmit changes between compilation", () => { + forEachNoEmitChangesWorker(commandType, { incremental: true }); + forEachNoEmitChangesWorker(commandType, { incremental: true, declaration: true }); + forEachNoEmitChangesWorker(commandType, { composite: true }); + forEachNoEmitChangesWorker(commandType, { incremental: true, outFile: "../outFile.js", module: ModuleKind.AMD }); + forEachNoEmitChangesWorker(commandType, { incremental: true, declaration: true, outFile: "../outFile.js", module: ModuleKind.AMD }); + forEachNoEmitChangesWorker(commandType, { composite: true, outFile: "../outFile.js", module: ModuleKind.AMD }); + }); +} + +function editsForDtsChanges( + commandType: string[], + aContent: string, + incremental: boolean | undefined, + multiFile: boolean, +): TestTscEdit[] { + return [ + noChangeRun, + { + caption: "With declaration enabled noEmit - Should report errors", + edit: noop, + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit", "--declaration"], + }, + { + caption: "With declaration and declarationMap noEmit - Should report errors", + edit: noop, + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit", "--declaration", "--declarationMap"], + }, + incremental ? { + ...noChangeRun, + discrepancyExplanation: () => [ + "Clean build will not have declaration and declarationMap", + "Incremental build will have previous buildInfo so will have dts and declaration and declarationMap", + ], + } : noChangeRun, + { + caption: "Dts Emit with error", + edit: noop, + commandLineArgs: [...commandType, "/home/src/projects/project", "--declaration"], + }, + { + caption: "Fix the error", + edit: fs => fs.writeFileSync("/home/src/projects/project/a.ts", aContent.replace("private", "public")), + }, + { + caption: "With declaration enabled noEmit", + edit: noop, + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit", "--declaration"], + }, + { + caption: "With declaration and declarationMap noEmit", + edit: noop, + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit", "--declaration", "--declarationMap"], + // Multi file still needs to report error so will emit build info (for pending dtsMap) + discrepancyExplanation: incremental && !multiFile ? () => [ + "Clean build will have declaration and declarationMap", + "Incremental build will have previous buildInfo so will have declaration and declarationMap", + ] : undefined, + }, + ]; +} + +export function forEachNoEmitDtsChanges(commandType: string[]) { + describe("dts errors with declaration enable changes", () => { + if (commandType[0] !== "-b") return; // Only test non multiple file errors with -b + [false, true].forEach(asModules => + [undefined, true].forEach(incremental => + [{}, { outFile: "../outFile.js", module: asModules ? "amd" : undefined }].forEach(options => { + if (!incremental && asModules) return; // Not the interesting case + const aContent = asModules ? `export const a = class { private p = 10; };` : `const a = class { private p = 10; };`; + verifyTsc({ + scenario: "noEmit", + subScenario: `${options.outFile ? "outFile" : "multiFile"}/dts errors with declaration enable changes${incremental ? " with incremental" : ""}${asModules ? " as modules" : ""}`, + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit"], + fs: () => + loadProjectFromFiles({ + "/home/src/projects/project/a.ts": aContent, + "/home/src/projects/project/tsconfig.json": jsonToReadableText({ + compilerOptions: { ...options, incremental }, + }), + }), + modifyFs: asModules ? + fs => fs.writeFileSync("/home/src/projects/project/b.ts", `export const b = 10;`) : + undefined, + edits: editsForDtsChanges(commandType, aContent, incremental, /*multiFile*/ false), + baselinePrograms: true, + }); + }) + ) + ); + }); + + describe("dts errors with declaration enable changes with errors in multiple files", () => { + [{}, { outFile: "../outFile.js", module: "amd" }].forEach(options => { + const aContent = `export const a = class { private p = 10; };`; + verifyTsc({ + scenario: "noEmit", + subScenario: `${options.outFile ? "outFile" : "multiFile"}/dts errors with declaration enable changes with multiple files`, + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit"], + fs: () => + loadProjectFromFiles({ + "/home/src/projects/project/a.ts": aContent, + "/home/src/projects/project/b.ts": `export const b = 10;`, + "/home/src/projects/project/c.ts": aContent.replace("a", "c"), + "/home/src/projects/project/d.ts": aContent.replace("a", "d"), + "/home/src/projects/project/tsconfig.json": jsonToReadableText({ + compilerOptions: { ...options, incremental: true }, + }), + }), + edits: [ + ...editsForDtsChanges(commandType, aContent, /*incremental*/ true, /*multiFile*/ true), + { + caption: "Fix the another ", + edit: fs => fs.writeFileSync("/home/src/projects/project/c.ts", aContent.replace("a", "c").replace("private", "public")), + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit", "--declaration", "--declarationMap"], + }, + ], + baselinePrograms: true, + }); + }); + }); +} + +function forEachNoEmitAndErrorsWorker( + subScenario: string, + aTsContent: string, + additionalOptions: CompilerOptions | undefined, + action: ( + subScenario: string, + fsContents: FsContents, + aTsContent: string, + fixedATsContent: string, + compilerOptions: CompilerOptions, + ) => void, +) { + [false, true].forEach(asModules => + [undefined, true].forEach(incremental => + [{}, { outFile: "../outFile.js", module: asModules ? ModuleKind.AMD : undefined }].forEach(options => { + if (!incremental && asModules) return; // Not the interesting case + const aContent = asModules ? `export ${aTsContent}` : aTsContent; + const compilerOptions = { + ...options, + incremental, + ...additionalOptions, + }; + const fsContents: FsContents = { + "/home/src/projects/project/a.ts": aContent, + "/home/src/projects/project/tsconfig.json": jsonToReadableText({ + compilerOptions: compilerOptionsToConfigJson(compilerOptions), + }), + }; + if (asModules) fsContents["/home/src/projects/project/b.ts"] = `export const b = 10;`; + action( + `${options.outFile ? "outFile" : "multiFile"}/${subScenario}${incremental ? " with incremental" : ""}${asModules ? " as modules" : ""}`, + fsContents, + aContent, + `${asModules ? "export " : ""}const a = "hello";`, + compilerOptions, + ); + }) + ) + ); +} + +function forEachNoEmitAndErrors( + action: ( + subScenario: string, + fsContents: FsContents, + aTsContent: string, + fixedATsContent: string, + compilerOptions: CompilerOptions, + ) => void, +) { + forEachNoEmitAndErrorsWorker( + "syntax errors", + `const a = "hello`, + /*additionalOptions*/ undefined, + action, + ); + forEachNoEmitAndErrorsWorker( + "semantic errors", + `const a: number = "hello"`, + /*additionalOptions*/ undefined, + action, + ); + [{}, { declaration: true }].forEach(options => { + forEachNoEmitAndErrorsWorker( + `dts errors${!options.declaration ? " without dts enabled" : ""}`, + `const a = class { private p = 10; };`, + options, + action, + ); + }); +} + +export function forEachNoEmitTsc(commandType: string[]) { + forEachNoEmitAndErrors((subScenario, fsContents, aTsContent, fixedATsContent, compilerOptions) => + verifyTsc({ + scenario: "noEmit", + subScenario, + commandLineArgs: [...commandType, "/home/src/projects/project", "--noEmit"], + fs: () => loadProjectFromFiles(fsContents), + edits: [ + noChangeRun, + { + caption: "Fix error", + edit: fs => fs.writeFileSync("/home/src/projects/project/a.ts", fixedATsContent), + }, + noChangeRun, + { + caption: "Emit after fixing error", + edit: noop, + commandLineArgs: [...commandType, "/home/src/projects/project"], + }, + noChangeRun, + { + caption: "Introduce error", + edit: fs => fs.writeFileSync("/home/src/projects/project/a.ts", aTsContent), + discrepancyExplanation: compilerOptions.incremental && subScenario.indexOf("multiFile/syntax") !== -1 ? () => [ + "DtsSignature of ts files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version", + ] : undefined, + }, + { + caption: "Emit when error", + edit: noop, + commandLineArgs: [...commandType, "/home/src/projects/project"], + }, + compilerOptions.incremental && subScenario.indexOf("multiFile/syntax") !== -1 ? { + ...noChangeRun, + discrepancyExplanation: () => [ + "DtsSignature of files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version", + ], + } : noChangeRun, + ], + baselinePrograms: true, + }) + ); +} + +export function forEachNoEmitTscWatch(commandType: string[]) { + forEachNoEmitAndErrors((subScenario, fsContents, aTsContent, fixedATsContent, compilerOptions) => + verifyTscWatch({ + scenario: "noEmit", + subScenario, + commandLineArgs: [...commandType, "/home/src/projects/project", "-w"], + sys: () => { + fsContents["/home/src/projects/project/tsconfig.json"] = jsonToReadableText({ + compilerOptions: compilerOptionsToConfigJson({ + ...compilerOptions, + noEmit: true, + }), + }); + fsContents[libFile.path] = libContent; + return createWatchedSystem(fsContents); + }, + edits: [ + { + caption: "Fix error", + edit: sys => sys.writeFile("/home/src/projects/project/a.ts", fixedATsContent), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "Emit after fixing error", + edit: sys => + sys.writeFile( + "/home/src/projects/project/tsconfig.json", + jsonToReadableText({ + compilerOptions: compilerOptionsToConfigJson(compilerOptions), + }), + ), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "no Emit run after fixing error", + edit: sys => + sys.writeFile( + "/home/src/projects/project/tsconfig.json", + jsonToReadableText({ + compilerOptions: compilerOptionsToConfigJson({ + ...compilerOptions, + noEmit: true, + }), + }), + ), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "Introduce error", + edit: sys => sys.writeFile("/home/src/projects/project/a.ts", aTsContent), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "Emit when error", + edit: sys => + sys.writeFile( + "/home/src/projects/project/tsconfig.json", + jsonToReadableText({ + compilerOptions: compilerOptionsToConfigJson(compilerOptions), + }), + ), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "no Emit run when error", + edit: sys => + sys.writeFile( + "/home/src/projects/project/tsconfig.json", + jsonToReadableText({ + compilerOptions: compilerOptionsToConfigJson({ + ...compilerOptions, + noEmit: true, + }), + }), + ), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + ], + }) + ); +} diff --git a/src/testRunner/unittests/helpers/noEmitOnError.ts b/src/testRunner/unittests/helpers/noEmitOnError.ts index 3c7d0d2e87047..38ec1b458d9b0 100644 --- a/src/testRunner/unittests/helpers/noEmitOnError.ts +++ b/src/testRunner/unittests/helpers/noEmitOnError.ts @@ -4,9 +4,26 @@ import { FsContents, libContent, } from "./contents.js"; -import { libFile } from "./virtualFileSystemWithWatch.js"; +import { + noChangeRun, + verifyTsc, +} from "./tsc.js"; +import { + TscWatchCompileChange, + verifyTscWatch, +} from "./tscWatch.js"; +import { loadProjectFromFiles } from "./vfs.js"; +import { + createWatchedSystem, + libFile, +} from "./virtualFileSystemWithWatch.js"; -function getFsContentsForNoEmitOnError(outFile: boolean, declaration: true | undefined, incremental: true | undefined): FsContents { +function getFsContentsForNoEmitOnError( + mainErrorContent: string, + outFile: boolean, + declaration: true | undefined, + incremental: true | undefined, +): FsContents { return { "/user/username/projects/noEmitOnError/tsconfig.json": jsonToReadableText({ compilerOptions: { @@ -21,12 +38,7 @@ function getFsContentsForNoEmitOnError(outFile: boolean, declaration: true | und name: string; } `, - "/user/username/projects/noEmitOnError/src/main.ts": dedent` - import { A } from "../shared/types/db"; - const a = { - lastName: 'sdsd' - ; - `, + "/user/username/projects/noEmitOnError/src/main.ts": mainErrorContent, "/user/username/projects/noEmitOnError/src/other.ts": dedent` console.log("hi"); export { } @@ -35,26 +47,152 @@ function getFsContentsForNoEmitOnError(outFile: boolean, declaration: true | und }; } -export function forEachNoEmitOnErrorScenario( - loadFs: (contents: FsContents, currentDirectory: string, executingFilePath: string) => T, +function forEachNoEmitOnErrorScenario( + subScenario: string, action: ( - scenarioName: (scenario: string) => string, - fs: () => T, + subScenario: string, + fsContents: (mainErrorContent: string) => FsContents, ) => void, ) { for (const outFile of [false, true]) { for (const declaration of [undefined, true] as const) { for (const incremental of [undefined, true] as const) { action( - scenario => `${outFile ? "outFile" : "multiFile"}/${scenario}${declaration ? " with declaration" : ""}${incremental ? " with incremental" : ""}`, - () => - loadFs( - getFsContentsForNoEmitOnError(outFile, declaration, incremental), - "/user/username/projects/noEmitOnError", - libFile.path, + `${outFile ? "outFile" : "multiFile"}/${subScenario}${declaration ? " with declaration" : ""}${incremental ? " with incremental" : ""}`, + mainErrorContent => + getFsContentsForNoEmitOnError( + mainErrorContent, + outFile, + declaration, + incremental, ), ); } } } } + +function getNoEmitOnErrorErrorsType(): [subScenario: string, mainErrorContent: string, fixedErrorContent: string][] { + return [ + [ + "syntax errors", + dedent` + import { A } from "../shared/types/db"; + const a = { + lastName: 'sdsd' + ; + `, + dedent` + import { A } from "../shared/types/db"; + const a = { + lastName: 'sdsd' + };`, + ], + [ + "semantic errors", + dedent` + import { A } from "../shared/types/db"; + const a: string = 10;`, + dedent` + import { A } from "../shared/types/db"; + const a: string = "hello";`, + ], + [ + "dts errors", + dedent` + import { A } from "../shared/types/db"; + export const a = class { private p = 10; }; + `, + dedent` + import { A } from "../shared/types/db"; + export const a = class { p = 10; }; + `, + ], + ]; +} + +export function forEachNoEmitOnErrorScenarioTsc(commandLineArgs: string[]) { + getNoEmitOnErrorErrorsType().forEach(([subScenario, mainErrorContent, fixedErrorContent]) => + forEachNoEmitOnErrorScenario( + subScenario, + (subScenario, fsContents) => { + describe(subScenario, () => { + verifyTsc({ + scenario: "noEmitOnError", + subScenario, + fs: () => + loadProjectFromFiles( + fsContents(mainErrorContent), + { + cwd: "/user/username/projects/noEmitOnError", + executingFilePath: libFile.path, + }, + ), + commandLineArgs, + edits: [ + noChangeRun, + { + caption: "Fix error", + edit: fs => fs.writeFileSync("src/main.ts", fixedErrorContent, "utf-8"), + }, + noChangeRun, + ], + baselinePrograms: true, + }); + }); + }, + ) + ); +} + +export function forEachNoEmitOnErrorScenarioTscWatch(commandLineArgs: string[]) { + const errorTypes = getNoEmitOnErrorErrorsType(); + forEachNoEmitOnErrorScenario( + "noEmitOnError", + (subScenario, fsContents) => + verifyTscWatch({ + scenario: "noEmitOnError", + subScenario, + commandLineArgs: [...commandLineArgs, "--w"], + sys: () => + createWatchedSystem( + fsContents(errorTypes[0][1]), + { currentDirectory: "/user/username/projects/noEmitOnError" }, + ), + edits: getEdits(errorTypes), + }), + ); + + function getEdits(errorTypes: ReturnType): TscWatchCompileChange[] { + const edits: TscWatchCompileChange[] = []; + for (const [subScenario, mainErrorContent, fixedErrorContent] of errorTypes) { + if (edits.length) { + edits.push( + { + caption: subScenario, + edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, mainErrorContent), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + ); + } + edits.push( + { + caption: "No change", + edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, sys.readFile(`/user/username/projects/noEmitOnError/src/main.ts`)!), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: `Fix ${subScenario}`, + edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, fixedErrorContent), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + { + caption: "No change", + edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, sys.readFile(`/user/username/projects/noEmitOnError/src/main.ts`)!), + timeouts: sys => sys.runQueuedTimeoutCallbacks(), + }, + ); + } + return edits; + } +} diff --git a/src/testRunner/unittests/helpers/tsc.ts b/src/testRunner/unittests/helpers/tsc.ts index 92ae893bb50db..078b7bc74e131 100644 --- a/src/testRunner/unittests/helpers/tsc.ts +++ b/src/testRunner/unittests/helpers/tsc.ts @@ -298,12 +298,18 @@ function verifyTscEditDiscrepancies({ (cleanReadableBuildInfo as ReadableIncrementalMultiFileEmitBuildInfo)?.fileInfos, (key, incrementalFileInfo, cleanFileInfo) => { const dtsForKey = dtsSignaures?.get(key); - if (!incrementalFileInfo || !cleanFileInfo || incrementalFileInfo.signature !== cleanFileInfo.signature && (dtsForKey === undefined || incrementalFileInfo.signature !== dtsForKey)) { + if ( + !incrementalFileInfo || + !cleanFileInfo || + incrementalFileInfo.signature !== cleanFileInfo.signature && + incrementalFileInfo.signature !== cleanFileInfo.version && + (dtsForKey === undefined || incrementalFileInfo.signature !== dtsForKey) + ) { return [ `Incremental signature is neither dts signature nor file version for File:: ${key}`, `Incremental:: ${jsonToReadableText(incrementalFileInfo)}`, `Clean:: ${jsonToReadableText(cleanFileInfo)}`, - `Dts Signature:: $${jsonToReadableText(dtsForKey)}`, + `Dts Signature:: ${jsonToReadableText(dtsForKey)}`, ]; } }, @@ -312,32 +318,21 @@ function verifyTscEditDiscrepancies({ if (isReadableIncrementalMultiFileEmitBuildInfo(incrementalReadableBuildInfo)) { ts.Debug.assert(!isReadableIncrementalBundleEmitBuildInfo(cleanReadableBuildInfo)); // Verify that incrementally pending affected file emit are in clean build since clean build can contain more files compared to incremental depending of noEmitOnError option - if (incrementalReadableBuildInfo.affectedFilesPendingEmit) { - if ((cleanReadableBuildInfo as ReadableIncrementalMultiFileEmitBuildInfo)?.affectedFilesPendingEmit === undefined) { + incrementalReadableBuildInfo.affectedFilesPendingEmit?.forEach(([actualFileOrArray]) => { + const actualFile = ts.isString(actualFileOrArray) ? actualFileOrArray : actualFileOrArray[0]; + if ( + !ts.find( + (cleanReadableBuildInfo as ReadableIncrementalMultiFileEmitBuildInfo)?.affectedFilesPendingEmit, + ([expectedFileOrArray]) => actualFile === (ts.isString(expectedFileOrArray) ? expectedFileOrArray : expectedFileOrArray[0]), + ) + ) { addBaseline( - `Incremental build contains affectedFilesPendingEmit, clean build does not have it: ${outputFile}::`, + `Incremental build contains ${actualFile} file as pending emit, clean build does not have it: ${outputFile}::`, `Incremental buildInfoText:: ${incrementalBuildText}`, `Clean buildInfoText:: ${cleanBuildText}`, ); } - let expectedIndex = 0; - incrementalReadableBuildInfo.affectedFilesPendingEmit.forEach(([actualFileOrArray]) => { - const actualFile = ts.isString(actualFileOrArray) ? actualFileOrArray : actualFileOrArray[0]; - expectedIndex = ts.findIndex( - (cleanReadableBuildInfo as ReadableIncrementalMultiFileEmitBuildInfo)?.affectedFilesPendingEmit, - ([expectedFileOrArray]) => actualFile === (ts.isString(expectedFileOrArray) ? expectedFileOrArray : expectedFileOrArray[0]), - expectedIndex, - ); - if (expectedIndex === -1) { - addBaseline( - `Incremental build contains ${actualFile} file as pending emit, clean build does not have it: ${outputFile}::`, - `Incremental buildInfoText:: ${incrementalBuildText}`, - `Clean buildInfoText:: ${cleanBuildText}`, - ); - } - expectedIndex++; - }); - } + }); } else { ts.Debug.assert(!isReadableIncrementalMultiFileEmitBuildInfo(cleanReadableBuildInfo)); @@ -354,6 +349,20 @@ function verifyTscEditDiscrepancies({ } const readableIncrementalBuildInfo = incrementalReadableBuildInfo as ReadableIncrementalBuildInfo | undefined; const readableCleanBuildInfo = cleanReadableBuildInfo as ReadableIncrementalBuildInfo | undefined; + readableIncrementalBuildInfo?.changeFileSet?.forEach(actualFile => { + if ( + !ts.find( + readableCleanBuildInfo?.changeFileSet, + expectedFile => actualFile === expectedFile, + ) + ) { + addBaseline( + `Incremental build contains ${actualFile} file in changeFileSet, clean build does not have it: ${outputFile}::`, + `Incremental buildInfoText:: ${incrementalBuildText}`, + `Clean buildInfoText:: ${cleanBuildText}`, + ); + } + }); readableIncrementalBuildInfo?.semanticDiagnosticsPerFile?.forEach(( [actualFile, notCachedORDiagnostics], ) => { @@ -362,7 +371,17 @@ function verifyTscEditDiscrepancies({ ([expectedFile]) => actualFile === expectedFile, ); // Incremental build should have same diagnostics as clean build - if (cleanFileDiagnostics && JSON.stringify(notCachedORDiagnostics) === JSON.stringify(cleanFileDiagnostics[1])) return; + if ( + cleanFileDiagnostics && + JSON.stringify(notCachedORDiagnostics) === JSON.stringify(cleanFileDiagnostics[1]) + ) return; + // If the diagnostics are marked as not cached in incremental build, + // and clean build doesnt mark it that way because its in its change file set, its ok + if ( + !cleanFileDiagnostics && + ts.isString(notCachedORDiagnostics) && + ts.contains(readableCleanBuildInfo?.changeFileSet, actualFile) + ) return; // Otherwise marked as "not Cached" in clean build with errors in incremental build is ok if ( ts.isString(cleanFileDiagnostics?.[1]) && @@ -509,6 +528,7 @@ function getBuildInfoForIncrementalCorrectnessCheck(text: string | undefined): { emitDiagnosticsPerFile: undefined, latestChangedDtsFile: readableBuildInfo.latestChangedDtsFile ? "FakeFileName" : undefined, semanticDiagnosticsPerFile: undefined, + changeFileSet: undefined, } : undefined), size: undefined, // Size doesnt need to be equal }), diff --git a/src/testRunner/unittests/tsbuild/noEmit.ts b/src/testRunner/unittests/tsbuild/noEmit.ts index 6fb62dbaccb79..6d2b05d4eb002 100644 --- a/src/testRunner/unittests/tsbuild/noEmit.ts +++ b/src/testRunner/unittests/tsbuild/noEmit.ts @@ -1,42 +1,13 @@ -import { jsonToReadableText } from "../helpers.js"; import { - noChangeRun, - verifyTsc, -} from "../helpers/tsc.js"; -import { loadProjectFromFiles } from "../helpers/vfs.js"; + forEachNoEmitChanges, + forEachNoEmitDtsChanges, + forEachNoEmitTsc, +} from "../helpers/noEmit.js"; -describe("unittests:: tsbuild:: noEmit", () => { - function verifyNoEmitWorker(subScenario: string, aTsContent: string, commandLineArgs: readonly string[]) { - [{}, { outFile: "../outFile.js" }].forEach(options => { - verifyTsc({ - scenario: "noEmit", - subScenario: `${options?.outFile ? "outFile" : "multiFile"}/${subScenario}`, - fs: () => - loadProjectFromFiles({ - "/src/a.ts": aTsContent, - "/src/tsconfig.json": jsonToReadableText({ - compilerOptions: { ...options, noEmit: true }, - }), - }), - commandLineArgs, - edits: [ - noChangeRun, - { - caption: "Fix error", - edit: fs => fs.writeFileSync("/src/a.ts", `const a = "hello"`), - }, - noChangeRun, - ], - baselinePrograms: true, - }); - }); - } +describe("unittests:: tsbuild:: noEmit::", () => { + forEachNoEmitChanges(["-b", "-v"]); - function verifyNoEmit(subScenario: string, aTsContent: string) { - verifyNoEmitWorker(subScenario, aTsContent, ["--b", "/src/tsconfig.json", "-v"]); - verifyNoEmitWorker(`${subScenario} with incremental`, aTsContent, ["--b", "/src/tsconfig.json", "-v", "--incremental"]); - } + forEachNoEmitTsc(["--b", "--v"]); - verifyNoEmit("syntax errors", `const a = "hello`); - verifyNoEmit("semantic errors", `const a: number = "hello"`); + forEachNoEmitDtsChanges(["-b", "--v"]); }); diff --git a/src/testRunner/unittests/tsbuild/noEmitOnError.ts b/src/testRunner/unittests/tsbuild/noEmitOnError.ts index d594684a38143..d03fb4378e37c 100644 --- a/src/testRunner/unittests/tsbuild/noEmitOnError.ts +++ b/src/testRunner/unittests/tsbuild/noEmitOnError.ts @@ -1,68 +1,5 @@ -import { forEachNoEmitOnErrorScenario } from "../helpers/noEmitOnError.js"; -import { - noChangeRun, - verifyTsc, -} from "../helpers/tsc.js"; -import { loadProjectFromFiles } from "../helpers/vfs.js"; +import { forEachNoEmitOnErrorScenarioTsc } from "../helpers/noEmitOnError.js"; describe("unittests:: tsbuild - with noEmitOnError::", () => { - forEachNoEmitOnErrorScenario( - (fsContents, cwd, executingFilePath) => loadProjectFromFiles(fsContents, { cwd, executingFilePath }), - (scenarioName, fs) => { - describe(scenarioName("verify noEmitOnError"), () => { - verifyTsc({ - scenario: "noEmitOnError", - subScenario: scenarioName("syntax errors"), - fs, - commandLineArgs: ["--b", "--verbose"], - edits: [ - noChangeRun, - { - caption: "Fix error", - edit: fs => - fs.writeFileSync( - "src/main.ts", - `import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -};`, - "utf-8", - ), - }, - noChangeRun, - ], - baselinePrograms: true, - }); - - verifyTsc({ - scenario: "noEmitOnError", - subScenario: scenarioName("semantic errors"), - fs, - modifyFs: fs => - fs.writeFileSync( - "src/main.ts", - `import { A } from "../shared/types/db"; -const a: string = 10;`, - "utf-8", - ), - commandLineArgs: ["--b", "--verbose"], - edits: [ - noChangeRun, - { - caption: "Fix error", - edit: fs => - fs.writeFileSync( - "src/main.ts", - `import { A } from "../shared/types/db"; -const a: string = "hello";`, - "utf-8", - ), - }, - noChangeRun, - ], - baselinePrograms: true, - }); - }); - }, - ); + forEachNoEmitOnErrorScenarioTsc(["--b", "--verbose"]); }); diff --git a/src/testRunner/unittests/tsbuildWatch/noEmit.ts b/src/testRunner/unittests/tsbuildWatch/noEmit.ts index aca1088a73dab..113f055da343c 100644 --- a/src/testRunner/unittests/tsbuildWatch/noEmit.ts +++ b/src/testRunner/unittests/tsbuildWatch/noEmit.ts @@ -1,12 +1,13 @@ import { jsonToReadableText } from "../helpers.js"; import { libContent } from "../helpers/contents.js"; +import { forEachNoEmitTscWatch } from "../helpers/noEmit.js"; import { verifyTscWatch } from "../helpers/tscWatch.js"; import { createWatchedSystem, libFile, } from "../helpers/virtualFileSystemWithWatch.js"; -describe("unittests:: tsbuildWatch:: watchMode:: with noEmit", () => { +describe("unittests:: tsbuildWatch:: watchMode:: with noEmit::", () => { function verify(outFile?: object) { verifyTscWatch({ scenario: "noEmit", @@ -44,4 +45,6 @@ describe("unittests:: tsbuildWatch:: watchMode:: with noEmit", () => { } verify(); verify({ outFile: "../out.js" }); + + forEachNoEmitTscWatch(["-b", "-verbose"]); }); diff --git a/src/testRunner/unittests/tsbuildWatch/noEmitOnError.ts b/src/testRunner/unittests/tsbuildWatch/noEmitOnError.ts index d02ba7ced44c9..6546204ef08fd 100644 --- a/src/testRunner/unittests/tsbuildWatch/noEmitOnError.ts +++ b/src/testRunner/unittests/tsbuildWatch/noEmitOnError.ts @@ -1,56 +1,5 @@ -import { forEachNoEmitOnErrorScenario } from "../helpers/noEmitOnError.js"; -import { - TscWatchCompileChange, - verifyTscWatch, -} from "../helpers/tscWatch.js"; -import { createWatchedSystem } from "../helpers/virtualFileSystemWithWatch.js"; +import { forEachNoEmitOnErrorScenarioTscWatch } from "../helpers/noEmitOnError.js"; describe("unittests:: tsbuildWatch:: watchMode:: with noEmitOnError::", () => { - function change(caption: string, content: string): TscWatchCompileChange { - return { - caption, - edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, content), - // build project - timeouts: sys => sys.runQueuedTimeoutCallbacks(), - }; - } - - const noChange: TscWatchCompileChange = { - caption: "No change", - edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, sys.readFile(`/user/username/projects/noEmitOnError/src/main.ts`)!), - // build project - timeouts: sys => sys.runQueuedTimeoutCallbacks(), - }; - forEachNoEmitOnErrorScenario( - (fsContents, currentDirectory) => createWatchedSystem(fsContents, { currentDirectory }), - (scenarioName, sys) => - verifyTscWatch({ - scenario: "noEmitOnError", - subScenario: scenarioName("does not emit any files on error"), - commandLineArgs: ["-b", "-w", "-verbose"], - sys, - edits: [ - noChange, - change( - "Fix Syntax error", - `import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -};`, - ), - change( - "Semantic Error", - `import { A } from "../shared/types/db"; -const a: string = 10;`, - ), - noChange, - change( - "Fix Semantic Error", - `import { A } from "../shared/types/db"; -const a: string = "hello";`, - ), - noChange, - ], - }), - ); + forEachNoEmitOnErrorScenarioTscWatch(["-b", "-verbose"]); }); diff --git a/src/testRunner/unittests/tsc/noEmit.ts b/src/testRunner/unittests/tsc/noEmit.ts index 6def668433629..ef78255050319 100644 --- a/src/testRunner/unittests/tsc/noEmit.ts +++ b/src/testRunner/unittests/tsc/noEmit.ts @@ -1,154 +1,17 @@ -import * as ts from "../../_namespaces/ts.js"; -import { dedent } from "../../_namespaces/Utils.js"; import { jsonToReadableText } from "../helpers.js"; -import { compilerOptionsToConfigJson } from "../helpers/contents.js"; +import { + forEachNoEmitChanges, + forEachNoEmitDtsChanges, + forEachNoEmitTsc, +} from "../helpers/noEmit.js"; import { noChangeOnlyRuns, - noChangeRun, - TestTscEdit, verifyTsc, } from "../helpers/tsc.js"; -import { - loadProjectFromFiles, - replaceText, -} from "../helpers/vfs.js"; -describe("unittests:: tsc:: noEmit::", () => { - describe("when noEmit changes between compilation", () => { - verifyNoEmitChanges({ incremental: true }); - verifyNoEmitChanges({ incremental: true, declaration: true }); - verifyNoEmitChanges({ composite: true }); - verifyNoEmitChanges({ incremental: true, outFile: "../outFile.js", module: ts.ModuleKind.AMD }); - verifyNoEmitChanges({ incremental: true, declaration: true, outFile: "../outFile.js", module: ts.ModuleKind.AMD }); - verifyNoEmitChanges({ composite: true, outFile: "../outFile.js", module: ts.ModuleKind.AMD }); - - function verifyNoEmitChanges(compilerOptions: ts.CompilerOptions) { - const discrepancyExplanation = () => [ - "Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files", - "Incremental will store the past latestChangedDtsFile and emitSignatures", - ]; - const noChangeRunWithNoEmit: TestTscEdit = { - ...noChangeRun, - caption: "No Change run with noEmit", - commandLineArgs: ["--p", "src/project", "--noEmit"], - discrepancyExplanation: compilerOptions.composite ? - discrepancyExplanation : - undefined, - }; - const noChangeRunWithEmit: TestTscEdit = { - ...noChangeRun, - caption: "No Change run with emit", - commandLineArgs: ["--p", "src/project"], - }; - let optionsString = ""; - for (const key in compilerOptions) { - if (ts.hasProperty(compilerOptions, key) && key !== "outFile" && key !== "module") { - optionsString += ` ${key}`; - } - } - function scenarioName(text: string) { - return `${compilerOptions.outFile ? "outFile" : "multiFile"}/${text}${optionsString}`; - } - - verifyTsc({ - scenario: "noEmit", - subScenario: scenarioName("changes"), - commandLineArgs: ["--p", "src/project"], - fs, - edits: [ - noChangeRunWithNoEmit, - noChangeRunWithNoEmit, - { - caption: "Introduce error but still noEmit", - commandLineArgs: ["--p", "src/project", "--noEmit"], - edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), - discrepancyExplanation: compilerOptions.composite ? - discrepancyExplanation : - undefined, - }, - { - caption: "Fix error and emit", - edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), - }, - noChangeRunWithEmit, - noChangeRunWithNoEmit, - noChangeRunWithNoEmit, - noChangeRunWithEmit, - { - caption: "Introduce error and emit", - edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), - }, - noChangeRunWithEmit, - noChangeRunWithNoEmit, - noChangeRunWithNoEmit, - noChangeRunWithEmit, - { - caption: "Fix error and no emit", - commandLineArgs: ["--p", "src/project", "--noEmit"], - edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), - discrepancyExplanation: compilerOptions.composite ? - discrepancyExplanation : - undefined, - }, - noChangeRunWithEmit, - noChangeRunWithNoEmit, - noChangeRunWithNoEmit, - noChangeRunWithEmit, - ], - }); - - verifyTsc({ - scenario: "noEmit", - subScenario: scenarioName("changes with initial noEmit"), - commandLineArgs: ["--p", "src/project", "--noEmit"], - fs, - edits: [ - noChangeRunWithEmit, - { - caption: "Introduce error with emit", - commandLineArgs: ["--p", "src/project"], - edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop", "prop1"), - }, - { - caption: "Fix error and no emit", - edit: fs => replaceText(fs, "/src/project/src/class.ts", "prop1", "prop"), - discrepancyExplanation: compilerOptions.composite ? - discrepancyExplanation : - undefined, - }, - noChangeRunWithEmit, - ], - }); +import { loadProjectFromFiles } from "../helpers/vfs.js"; - function fs() { - return loadProjectFromFiles({ - "/src/project/src/class.ts": dedent` - export class classC { - prop = 1; - }`, - "/src/project/src/indirectClass.ts": dedent` - import { classC } from './class'; - export class indirectClass { - classC = new classC(); - }`, - "/src/project/src/directUse.ts": dedent` - import { indirectClass } from './indirectClass'; - new indirectClass().classC.prop;`, - "/src/project/src/indirectUse.ts": dedent` - import { indirectClass } from './indirectClass'; - new indirectClass().classC.prop;`, - "/src/project/src/noChangeFile.ts": dedent` - export function writeLog(s: string) { - }`, - "/src/project/src/noChangeFileWithEmitSpecificError.ts": dedent` - function someFunc(arguments: boolean, ...rest: any[]) { - }`, - "/src/project/tsconfig.json": jsonToReadableText({ - compilerOptions: compilerOptionsToConfigJson(compilerOptions), - }), - }); - } - } - }); +describe("unittests:: tsc:: noEmit::", () => { + forEachNoEmitChanges(["--p"]); verifyTsc({ scenario: "noEmit", @@ -167,4 +30,8 @@ describe("unittests:: tsc:: noEmit::", () => { edits: noChangeOnlyRuns, baselinePrograms: true, }); + + forEachNoEmitTsc(["-p"]); + + forEachNoEmitDtsChanges(["-p"]); }); diff --git a/src/testRunner/unittests/tsc/noEmitOnError.ts b/src/testRunner/unittests/tsc/noEmitOnError.ts index 4948d332b5b14..6eb7d7c2670f1 100644 --- a/src/testRunner/unittests/tsc/noEmitOnError.ts +++ b/src/testRunner/unittests/tsc/noEmitOnError.ts @@ -1,71 +1,13 @@ import { jsonToReadableText } from "../helpers.js"; -import { forEachNoEmitOnErrorScenario } from "../helpers/noEmitOnError.js"; -import { - noChangeRun, - TestTscEdit, - verifyTsc, -} from "../helpers/tsc.js"; +import { forEachNoEmitOnErrorScenarioTsc } from "../helpers/noEmitOnError.js"; +import { verifyTsc } from "../helpers/tsc.js"; import { loadProjectFromFiles, replaceText, } from "../helpers/vfs.js"; describe("unittests:: tsc:: noEmitOnError::", () => { - forEachNoEmitOnErrorScenario( - (fsContents, cwd, executingFilePath) => loadProjectFromFiles(fsContents, { cwd, executingFilePath }), - (scnearioName, fs) => { - describe(scnearioName("verify noEmitOnError"), () => { - function verifyNoEmitOnError(subScenario: string, fixModifyFs: TestTscEdit["edit"], modifyFs?: TestTscEdit["edit"]) { - verifyTsc({ - scenario: "noEmitOnError", - subScenario: scnearioName(subScenario), - fs, - commandLineArgs: [], - modifyFs, - edits: [ - noChangeRun, - { - caption: "incremental-declaration-doesnt-change", - edit: fixModifyFs, - }, - noChangeRun, - ], - baselinePrograms: true, - }); - } - verifyNoEmitOnError( - "syntax errors", - fs => - fs.writeFileSync( - "src/main.ts", - `import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -};`, - "utf-8", - ), - ); - - verifyNoEmitOnError( - "semantic errors", - fs => - fs.writeFileSync( - "src/main.ts", - `import { A } from "../shared/types/db"; -const a: string = "hello";`, - "utf-8", - ), - fs => - fs.writeFileSync( - "src/main.ts", - `import { A } from "../shared/types/db"; -const a: string = 10;`, - "utf-8", - ), - ); - }); - }, - ); + forEachNoEmitOnErrorScenarioTsc([]); verifyTsc({ scenario: "noEmitOnError", diff --git a/src/testRunner/unittests/tscWatch/noEmit.ts b/src/testRunner/unittests/tscWatch/noEmit.ts new file mode 100644 index 0000000000000..c40b2dde84e76 --- /dev/null +++ b/src/testRunner/unittests/tscWatch/noEmit.ts @@ -0,0 +1,5 @@ +import { forEachNoEmitTscWatch } from "../helpers/noEmit.js"; + +describe("unittests:: tsc-watch:: noEmit::", () => { + forEachNoEmitTscWatch(["-p"]); +}); diff --git a/src/testRunner/unittests/tscWatch/noEmitOnError.ts b/src/testRunner/unittests/tscWatch/noEmitOnError.ts index 32b154c1f58db..1d89442f176e3 100644 --- a/src/testRunner/unittests/tscWatch/noEmitOnError.ts +++ b/src/testRunner/unittests/tscWatch/noEmitOnError.ts @@ -1,56 +1,5 @@ -import { forEachNoEmitOnErrorScenario } from "../helpers/noEmitOnError.js"; -import { - TscWatchCompileChange, - verifyTscWatch, -} from "../helpers/tscWatch.js"; -import { createWatchedSystem } from "../helpers/virtualFileSystemWithWatch.js"; +import { forEachNoEmitOnErrorScenarioTscWatch } from "../helpers/noEmitOnError.js"; describe("unittests:: tsc-watch:: noEmitOnError::", () => { - function change(caption: string, content: string): TscWatchCompileChange { - return { - caption, - edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, content), - // build project - timeouts: sys => sys.runQueuedTimeoutCallbacks(), - }; - } - const noChange: TscWatchCompileChange = { - caption: "No change", - edit: sys => sys.writeFile(`/user/username/projects/noEmitOnError/src/main.ts`, sys.readFile(`/user/username/projects/noEmitOnError/src/main.ts`)!), - // build project - timeouts: sys => sys.runQueuedTimeoutCallbacks(), - }; - forEachNoEmitOnErrorScenario( - (fsContents, currentDirectory) => createWatchedSystem(fsContents, { currentDirectory }), - (scenarioName, sys) => { - verifyTscWatch({ - scenario: "noEmitOnError", - subScenario: scenarioName("noEmitOnError"), - commandLineArgs: ["--w"], - sys, - edits: [ - noChange, - change( - "Fix Syntax error", - `import { A } from "../shared/types/db"; -const a = { - lastName: 'sdsd' -};`, - ), - change( - "Semantic Error", - `import { A } from "../shared/types/db"; -const a: string = 10;`, - ), - noChange, - change( - "Fix Semantic Error", - `import { A } from "../shared/types/db"; -const a: string = "hello";`, - ), - noChange, - ], - }); - }, - ); + forEachNoEmitOnErrorScenarioTscWatch([]); }); diff --git a/tests/baselines/reference/tsbuild/amdModulesWithOut/prepend-reports-deprecation-error.js b/tests/baselines/reference/tsbuild/amdModulesWithOut/prepend-reports-deprecation-error.js index e9a403c6dba0a..f396a45bfbda3 100644 --- a/tests/baselines/reference/tsbuild/amdModulesWithOut/prepend-reports-deprecation-error.js +++ b/tests/baselines/reference/tsbuild/amdModulesWithOut/prepend-reports-deprecation-error.js @@ -294,19 +294,19 @@ sourceFile:file4.ts "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../lib/module.d.ts", - "not cached" + "not cached or not changed" ], [ "./file3.ts", - "not cached" + "not cached or not changed" ], [ "./file4.ts", - "not cached" + "not cached or not changed" ] ], "outSignature": "-23302177839-declare module \"file3\" {\n export const z = 30;\n}\ndeclare const myVar = 30;\n", diff --git a/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js b/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js index bce8eb5a8d6e4..8722ad0616b2d 100644 --- a/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js +++ b/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js @@ -369,27 +369,27 @@ export declare const g = 10; "semanticDiagnosticsPerFile": [ [ "../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./e.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/a.d.ts", - "not cached" + "not cached or not changed" ], [ "./f.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/b.d.ts", - "not cached" + "not cached or not changed" ], [ "./g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -962,27 +962,27 @@ exports.g = b_1.b; "semanticDiagnosticsPerFile": [ [ "../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./e.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/a.d.ts", - "not cached" + "not cached or not changed" ], [ "./f.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/b.d.ts", - "not cached" + "not cached or not changed" ], [ "./g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", diff --git a/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js b/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js index 7574186a74135..3cf42df1f8e07 100644 --- a/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js +++ b/tests/baselines/reference/tsbuild/commandLine/multiFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js @@ -367,27 +367,27 @@ export declare const g = 10; "semanticDiagnosticsPerFile": [ [ "../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./e.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/a.d.ts", - "not cached" + "not cached or not changed" ], [ "./f.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/b.d.ts", - "not cached" + "not cached or not changed" ], [ "./g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -920,27 +920,27 @@ export declare const aaa = 10; "semanticDiagnosticsPerFile": [ [ "../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./e.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/a.d.ts", - "not cached" + "not cached or not changed" ], [ "./f.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/b.d.ts", - "not cached" + "not cached or not changed" ], [ "./g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1270,27 +1270,27 @@ exports.g = b_1.b; "semanticDiagnosticsPerFile": [ [ "../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./e.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/a.d.ts", - "not cached" + "not cached or not changed" ], [ "./f.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/b.d.ts", - "not cached" + "not cached or not changed" ], [ "./g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -2012,27 +2012,27 @@ export declare const aaaaa = 10; "semanticDiagnosticsPerFile": [ [ "../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./e.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/a.d.ts", - "not cached" + "not cached or not changed" ], [ "./f.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/b.d.ts", - "not cached" + "not cached or not changed" ], [ "./g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -2340,27 +2340,27 @@ exports.a2 = 10; "semanticDiagnosticsPerFile": [ [ "../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./e.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/a.d.ts", - "not cached" + "not cached or not changed" ], [ "./f.ts", - "not cached" + "not cached or not changed" ], [ "../../project1/src/b.d.ts", - "not cached" + "not cached or not changed" ], [ "./g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", diff --git a/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js b/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js index 5752ed4eb3f46..fb8b51e87275a 100644 --- a/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js +++ b/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js @@ -262,23 +262,23 @@ declare module "g" { "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../project1/outfile.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/e.ts", - "not cached" + "not cached or not changed" ], [ "./src/f.ts", - "not cached" + "not cached or not changed" ], [ "./src/g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -704,23 +704,23 @@ define("g", ["require", "exports", "b"], function (require, exports, b_1) { "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../project1/outfile.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/e.ts", - "not cached" + "not cached or not changed" ], [ "./src/f.ts", - "not cached" + "not cached or not changed" ], [ "./src/g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", diff --git a/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js b/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js index 2a57d8b3ae4d3..a4685b9e70d32 100644 --- a/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js +++ b/tests/baselines/reference/tsbuild/commandLine/outFile/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js @@ -260,23 +260,23 @@ declare module "g" { "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../project1/outfile.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/e.ts", - "not cached" + "not cached or not changed" ], [ "./src/f.ts", - "not cached" + "not cached or not changed" ], [ "./src/g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -676,23 +676,23 @@ declare module "d" { "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../project1/outfile.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/e.ts", - "not cached" + "not cached or not changed" ], [ "./src/f.ts", - "not cached" + "not cached or not changed" ], [ "./src/g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -918,23 +918,23 @@ define("g", ["require", "exports", "b"], function (require, exports, b_1) { "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../project1/outfile.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/e.ts", - "not cached" + "not cached or not changed" ], [ "./src/f.ts", - "not cached" + "not cached or not changed" ], [ "./src/g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1503,23 +1503,23 @@ declare module "d" { "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../project1/outfile.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/e.ts", - "not cached" + "not cached or not changed" ], [ "./src/f.ts", - "not cached" + "not cached or not changed" ], [ "./src/g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1756,23 +1756,23 @@ define("d", ["require", "exports", "b"], function (require, exports, b_1) { "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../project1/outfile.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/e.ts", - "not cached" + "not cached or not changed" ], [ "./src/f.ts", - "not cached" + "not cached or not changed" ], [ "./src/g.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", diff --git a/tests/baselines/reference/tsbuild/noCheck/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/multiFile/dts-errors-with-incremental.js index 2f6f44ae81f6f..2b8ec7f8baafb 100644 --- a/tests/baselines/reference/tsbuild/noCheck/multiFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck/multiFile/dts-errors-with-incremental.js @@ -146,15 +146,15 @@ exports.b = 10; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -298,15 +298,15 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -572,7 +572,7 @@ exports.a = /** @class */ (function () { "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -828,7 +828,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1201,7 +1201,7 @@ exports.a = /** @class */ (function () { "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", @@ -1353,7 +1353,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", diff --git a/tests/baselines/reference/tsbuild/noCheck/multiFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/multiFile/semantic-errors-with-incremental.js index 000ede0aa7fb8..0db2beabf0352 100644 --- a/tests/baselines/reference/tsbuild/noCheck/multiFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck/multiFile/semantic-errors-with-incremental.js @@ -141,15 +141,15 @@ exports.b = 10; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -273,15 +273,15 @@ export declare const a = "hello"; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -532,7 +532,7 @@ export declare const a: number; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -771,7 +771,7 @@ export declare const a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1129,7 +1129,7 @@ export declare const a: number; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", @@ -1264,7 +1264,7 @@ export declare const a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", diff --git a/tests/baselines/reference/tsbuild/noCheck/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/multiFile/syntax-errors-with-incremental.js index 85f585dcf114a..8c140292d9402 100644 --- a/tests/baselines/reference/tsbuild/noCheck/multiFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck/multiFile/syntax-errors-with-incremental.js @@ -149,15 +149,15 @@ exports.b = 10; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -284,15 +284,15 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -554,7 +554,7 @@ exports.a = "hello; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -677,7 +677,7 @@ No shapes updated in the builder:: "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -788,7 +788,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1157,7 +1157,7 @@ exports.a = "hello; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", @@ -1295,7 +1295,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", diff --git a/tests/baselines/reference/tsbuild/noCheck/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/outFile/dts-errors-with-incremental.js index 182e55c469099..508d4c8ee1f81 100644 --- a/tests/baselines/reference/tsbuild/noCheck/outFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck/outFile/dts-errors-with-incremental.js @@ -128,15 +128,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -274,15 +274,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -518,15 +518,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -754,15 +754,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1105,19 +1105,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -1244,19 +1244,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, diff --git a/tests/baselines/reference/tsbuild/noCheck/outFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/outFile/semantic-errors-with-incremental.js index d9bdf4d0876b1..947872b0eaf31 100644 --- a/tests/baselines/reference/tsbuild/noCheck/outFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck/outFile/semantic-errors-with-incremental.js @@ -124,15 +124,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -242,15 +242,15 @@ declare module "b" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -468,15 +468,15 @@ declare module "b" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -684,15 +684,15 @@ declare module "b" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1014,19 +1014,19 @@ declare module "c" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1130,19 +1130,19 @@ declare module "c" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, diff --git a/tests/baselines/reference/tsbuild/noCheck/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noCheck/outFile/syntax-errors-with-incremental.js index 4e166f4382a2e..94f814560585f 100644 --- a/tests/baselines/reference/tsbuild/noCheck/outFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noCheck/outFile/syntax-errors-with-incremental.js @@ -132,15 +132,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -256,15 +256,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -496,15 +496,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -608,15 +608,15 @@ No shapes updated in the builder:: "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -715,15 +715,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1062,19 +1062,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1187,19 +1187,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite-discrepancies.js new file mode 100644 index 0000000000000..426adc8e2ccf9 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite-discrepancies.js @@ -0,0 +1,1338 @@ +0:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +1:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +2:: Introduce error but still noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + [ + "./src/class.ts", + "-9508063301-export declare class classC {\n prop: number;\n}\n" + ], + [ + "./src/directuse.ts", + "-3531856636-export {};\n" + ], + [ + "./src/indirectuse.ts", + "-3531856636-export {};\n" + ] + ], + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +5:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +6:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +10:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +11:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +13:: Fix error and no emit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + [ + "./src/class.ts", + "-12157283604-export declare class classC {\n prop1: number;\n}\n" + ], + [ + "./src/directuse.ts", + "-3531856636-export {};\n" + ], + [ + "./src/indirectuse.ts", + "-3531856636-export {};\n" + ] + ], + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +15:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +16:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite.js new file mode 100644 index 0000000000000..367e2c7217fbf --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-composite.js @@ -0,0 +1,1689 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "composite": true + } +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] +export {}; + + +//// [/src/project/src/directUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.d.ts] +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + + +//// [/src/project/src/indirectClass.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.d.ts] +export {}; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.d.ts] +export declare function writeLog(s: string): void; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.d.ts] +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "version": "FakeTSVersion", + "size": 2135 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"emitSignatures":[[2,"-9508063301-export declare class classC {\n prop: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js | Dts" + ], + [ + [ + "./src/directuse.ts" + ], + "Dts" + ], + [ + "./src/indirectclass.ts", + "Js | Dts" + ], + [ + [ + "./src/indirectuse.ts" + ], + "Dts" + ] + ], + "emitSignatures": [ + [ + "./src/class.ts", + "-9508063301-export declare class classC {\n prop: number;\n}\n" + ], + [ + "./src/directuse.ts", + "-3531856636-export {};\n" + ], + [ + "./src/indirectuse.ts", + "-3531856636-export {};\n" + ] + ], + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "version": "FakeTSVersion", + "size": 2791 +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "version": "FakeTSVersion", + "size": 2135 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop1: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "version": "FakeTSVersion", + "size": 2671 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/directuse.ts", + 16 + ], + "DtsEmit" + ], + [ + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/indirectuse.ts", + 16 + ], + "DtsEmit" + ] + ], + "emitSignatures": [ + [ + "./src/class.ts", + "-12157283604-export declare class classC {\n prop1: number;\n}\n" + ], + [ + "./src/directuse.ts", + "-3531856636-export {};\n" + ], + [ + "./src/indirectuse.ts", + "-3531856636-export {};\n" + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "version": "FakeTSVersion", + "size": 2217 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "version": "FakeTSVersion", + "size": 2107 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental-declaration.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental-declaration.js new file mode 100644 index 0000000000000..e20f40b9f4cae --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental-declaration.js @@ -0,0 +1,1666 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] +export {}; + + +//// [/src/project/src/directUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.d.ts] +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + + +//// [/src/project/src/indirectClass.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.d.ts] +export {}; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.d.ts] +export declare function writeLog(s: string): void; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.d.ts] +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2067 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js | Dts" + ], + [ + [ + "./src/directuse.ts" + ], + "Dts" + ], + [ + "./src/indirectclass.ts", + "Js | Dts" + ], + [ + [ + "./src/indirectuse.ts" + ], + "Dts" + ] + ], + "version": "FakeTSVersion", + "size": 2570 +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] file written with same contents +//// [/src/project/src/class.js] file written with same contents +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2067 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop1: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2631 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/directuse.ts", + 16 + ], + "DtsEmit" + ], + [ + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/indirectuse.ts", + 16 + ], + "DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 2022 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2067 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental.js new file mode 100644 index 0000000000000..0b803c9110d32 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-incremental.js @@ -0,0 +1,1512 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1520 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},"6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,4,3,5],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js" + ], + [ + "./src/directuse.ts", + "Js" + ], + [ + "./src/indirectclass.ts", + "Js" + ], + [ + "./src/indirectuse.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 2450 +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] file written with same contents +//// [/src/project/src/directUse.js] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1747 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2311 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js" + ], + [ + "./src/indirectclass.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 1780 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1747 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite-discrepancies.js new file mode 100644 index 0000000000000..b7a1a680cd675 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite-discrepancies.js @@ -0,0 +1,145 @@ +2:: Fix error and no emit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "emitSignatures": [ + [ + "./src/class.ts", + "-12157283604-export declare class classC {\n prop1: number;\n}\n" + ], + [ + "./src/directuse.ts", + "-3531856636-export {};\n" + ], + [ + "./src/indirectuse.ts", + "-3531856636-export {};\n" + ] + ], + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite.js new file mode 100644 index 0000000000000..5353a2726378e --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-composite.js @@ -0,0 +1,1093 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "composite": true + } +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,17],[3,17],[5,17],[6,17],[7,17]],"emitSignatures":[2,3,4,5,6,7],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/directuse.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/indirectuse.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/nochangefile.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/nochangefilewithemitspecificerror.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "emitSignatures": [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "version": "FakeTSVersion", + "size": 1651 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] +export {}; + + +//// [/src/project/src/directUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.d.ts] +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + + +//// [/src/project/src/indirectClass.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.d.ts] +export {}; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.d.ts] +export declare function writeLog(s: string): void; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.d.ts] +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"latestChangedDtsFile":"./src/noChangeFileWithEmitSpecificError.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "latestChangedDtsFile": "./src/noChangeFileWithEmitSpecificError.d.ts", + "version": "FakeTSVersion", + "size": 2135 +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop1: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "version": "FakeTSVersion", + "size": 2671 +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/directuse.ts", + 16 + ], + "DtsEmit" + ], + [ + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/indirectuse.ts", + 16 + ], + "DtsEmit" + ] + ], + "emitSignatures": [ + [ + "./src/class.ts", + "-12157283604-export declare class classC {\n prop1: number;\n}\n" + ], + [ + "./src/directuse.ts", + "-3531856636-export {};\n" + ], + [ + "./src/indirectuse.ts", + "-3531856636-export {};\n" + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "version": "FakeTSVersion", + "size": 2217 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "latestChangedDtsFile": "./src/class.d.ts", + "version": "FakeTSVersion", + "size": 2107 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js new file mode 100644 index 0000000000000..f0963ba92e24c --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js @@ -0,0 +1,1074 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,17],[3,17],[5,17],[6,17],[7,17]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/directuse.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/indirectuse.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/nochangefile.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/nochangefilewithemitspecificerror.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1622 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] +export {}; + + +//// [/src/project/src/directUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.d.ts] +import { classC } from './class'; +export declare class indirectClass { + classC: classC; +} + + +//// [/src/project/src/indirectClass.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.d.ts] +export {}; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.d.ts] +export declare function writeLog(s: string): void; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.d.ts] +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2067 +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop1: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2631 +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/directuse.ts", + 16 + ], + "DtsEmit" + ], + [ + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./src/indirectuse.ts", + 16 + ], + "DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 2022 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.d.ts] +export declare class classC { + prop: number; +} + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.d.ts] file written with same contents +//// [/src/project/src/indirectClass.d.ts] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.d.ts] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "original": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "8055010000-export declare function writeLog(s: string): void;\n" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2067 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental.js new file mode 100644 index 0000000000000..1aa309ce5bdfa --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/changes-with-initial-noEmit-incremental.js @@ -0,0 +1,931 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,4,3,5,6,7],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js" + ], + [ + "./src/directuse.ts", + "Js" + ], + [ + "./src/indirectclass.ts", + "Js" + ], + [ + "./src/indirectuse.ts", + "Js" + ], + [ + "./src/nochangefile.ts", + "Js" + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 1561 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/indirectClass.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.indirectClass = void 0; +var class_1 = require("./class"); +var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; +}()); +exports.indirectClass = indirectClass; + + +//// [/src/project/src/indirectUse.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var indirectClass_1 = require("./indirectClass"); +new indirectClass_1.indirectClass().classC.prop; + + +//// [/src/project/src/noChangeFile.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeLog = writeLog; +function writeLog(s) { +} + + +//// [/src/project/src/noChangeFileWithEmitSpecificError.js] +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "545032748-export class classC {\n prop = 1;\n}" + }, + "./src/indirectclass.ts": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1520 +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/directUse.js] file written with same contents +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/src/indirectUse.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1786859709-export class classC {\n prop1 = 1;\n}","signature":"-12157283604-export declare class classC {\n prop1: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},{"version":"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","signature":"-3531856636-export {};\n"},"6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "version": "1786859709-export class classC {\n prop1 = 1;\n}", + "signature": "-12157283604-export declare class classC {\n prop1: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/indirectuse.ts": { + "original": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-3531856636-export {};\n" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2413 +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./src/class.ts", + "Js" + ], + [ + "./src/indirectclass.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 1780 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/project/src/class.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.classC = void 0; +var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; +}()); +exports.classC = classC; + + +//// [/src/project/src/indirectClass.js] file written with same contents +//// [/src/project/tsconfig.tsbuildinfo] +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../lib/lib.d.ts", + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ], + "fileIdsList": [ + [ + "./src/indirectclass.ts" + ], + [ + "./src/class.ts" + ] + ], + "fileInfos": { + "../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./src/class.ts": { + "original": { + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "version": "545032748-export class classC {\n prop = 1;\n}", + "signature": "-9508063301-export declare class classC {\n prop: number;\n}\n" + }, + "./src/indirectclass.ts": { + "original": { + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "version": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "signature": "9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n" + }, + "./src/directuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/indirectuse.ts": { + "version": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "signature": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;" + }, + "./src/nochangefile.ts": { + "version": "6714567633-export function writeLog(s: string) {\n}", + "signature": "6714567633-export function writeLog(s: string) {\n}" + }, + "./src/nochangefilewithemitspecificerror.ts": { + "original": { + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + }, + "version": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "signature": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}", + "affectsGlobalScope": true + } + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./src/class.ts", + "./src/indirectclass.ts", + "./src/directuse.ts", + "./src/indirectuse.ts", + "./src/nochangefile.ts", + "./src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "referencedMap": { + "./src/directuse.ts": [ + "./src/indirectclass.ts" + ], + "./src/indirectclass.ts": [ + "./src/class.ts" + ], + "./src/indirectuse.ts": [ + "./src/indirectclass.ts" + ] + }, + "semanticDiagnosticsPerFile": [ + [ + "./src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1747 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js new file mode 100644 index 0000000000000..441b93d786a32 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js @@ -0,0 +1,123 @@ +3:: no-change-run +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "version": "FakeTSVersion" +} +7:: With declaration and declarationMap noEmit +Clean build will have declaration and declarationMap +Incremental build will have previous buildInfo so will have declaration and declarationMap +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9483521475-export const a = class { public p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9483521475-export const a = class { public p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js new file mode 100644 index 0000000000000..3243a484d0b02 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js @@ -0,0 +1,733 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 719 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 933 +} + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49],[3,49]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./b.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 782 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };",{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 959 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 897 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17],[3,16]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 16 + ], + "DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 940 +} + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js new file mode 100644 index 0000000000000..5a28c012f3184 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js @@ -0,0 +1,99 @@ +3:: no-change-run +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "version": "FakeTSVersion" +} +7:: With declaration and declarationMap noEmit +Clean build will have declaration and declarationMap +Incremental build will have previous buildInfo so will have declaration and declarationMap +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "9520728827-const a = class { public p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "9520728827-const a = class { public p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental.js new file mode 100644 index 0000000000000..3933ef21d638a --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-incremental.js @@ -0,0 +1,636 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 700 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 908 +} + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 758 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 872 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"9520728827-const a = class { public p = 10; };","signature":"13034998770-declare const a: {\n new (): {\n p: number;\n };\n};\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "9520728827-const a = class { public p = 10; };", + "signature": "13034998770-declare const a: {\n new (): {\n p: number;\n };\n};\n", + "affectsGlobalScope": true + }, + "version": "9520728827-const a = class { public p = 10; };", + "signature": "13034998770-declare const a: {\n new (): {\n p: number;\n };\n};\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 793 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"9520728827-const a = class { public p = 10; };","signature":"13034998770-declare const a: {\n new (): {\n p: number;\n };\n};\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "9520728827-const a = class { public p = 10; };", + "signature": "13034998770-declare const a: {\n new (): {\n p: number;\n };\n};\n", + "affectsGlobalScope": true + }, + "version": "9520728827-const a = class { public p = 10; };", + "signature": "13034998770-declare const a: {\n new (): {\n p: number;\n };\n};\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 829 +} + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js new file mode 100644 index 0000000000000..78dd9aa846cf0 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js @@ -0,0 +1,80 @@ +3:: no-change-run +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js new file mode 100644 index 0000000000000..5294f6174b6ff --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -0,0 +1,1335 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/c.ts] +export const c = class { private p = 10; }; + +//// [/home/src/projects/project/d.ts] +export const d = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) +/home/src/projects/project/c.ts (used version) +/home/src/projects/project/d.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"affectedFilesPendingEmit":[2,3,4,5],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ], + [ + "./c.ts", + "Js" + ], + [ + "./d.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 859 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17],[5,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./c.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./d.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1375 +} + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49],[3,49],[4,49],[5,49]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./b.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./c.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./d.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 932 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/c.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/d.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.d = void 0; +exports.d = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };",{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1387 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "emitDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 1352 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,16],[4,16],[5,16]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 16 + ], + "DtsEmit" + ], + [ + [ + "./c.ts", + 16 + ], + "DtsEmit" + ], + [ + [ + "./d.ts", + 16 + ], + "DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1409 +} + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49],[3,48],[4,48],[5,48]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./b.ts", + 48 + ], + "DtsEmit | DtsMap" + ], + [ + [ + "./c.ts", + 48 + ], + "DtsEmit | DtsMap" + ], + [ + [ + "./d.ts", + 48 + ], + "DtsEmit | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 1112 +} + + + +Change:: Fix the another +Input:: +//// [/home/src/projects/project/c.ts] +export const c = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/c.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/c.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/c.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},{"version":"-15184115393-export const c = class { public p = 10; };","signature":"-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n"},"2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49],[3,48],[4,49],[5,48]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "original": { + "version": "-15184115393-export const c = class { public p = 10; };", + "signature": "-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-15184115393-export const c = class { public p = 10; };", + "signature": "-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./b.ts", + 48 + ], + "DtsEmit | DtsMap" + ], + [ + [ + "./c.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./d.ts", + 48 + ], + "DtsEmit | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 1224 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes.js new file mode 100644 index 0000000000000..079a2e65c561a --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-declaration-enable-changes.js @@ -0,0 +1,477 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/home/src/projects/project/tsconfig.json'... + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/a.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/a.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..096c05cebd2c9 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,754 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 933 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 821 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.d.ts] +export declare const a = "hello"; + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 847 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1199 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1163 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..8fa2618b0637c --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-with-incremental.js @@ -0,0 +1,662 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 908 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 777 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1092 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1056 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..2973ac52377cb --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,572 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 719 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 780 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 747 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 921 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 890 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..1ee9d031e5088 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,506 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 700 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 710 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 884 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 853 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..946cd222c1225 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,360 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/a.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/a.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/a.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors.js new file mode 100644 index 0000000000000..e466c16b3b0fb --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/dts-errors.js @@ -0,0 +1,463 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (computed .d.ts during emit) + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/a.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/home/src/projects/project/tsconfig.json'... + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.d.ts] file changed its modified time +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..90e79c9c3bb46 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,685 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-11417512537-export const a: number = \"hello\"" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 863 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 780 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 747 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 933 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 902 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental.js index 7c704069bca98..c6b1a96cc5bed 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors-with-incremental.js @@ -1,5 +1,15 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,28 +25,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a: number = "hello" - -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "noEmit": true - } -} - Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'src/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -46,39 +46,39 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "noEmit": true, "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "../lib/lib.d.ts", + "../../../../lib/lib.d.ts", "./a.ts" ], "fileInfos": { - "../lib/lib.d.ts": { + "../../../../lib/lib.d.ts": { "original": { "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", "affectsGlobalScope": true @@ -124,7 +124,7 @@ Shape signatures in builder refreshed for:: ] ], "version": "FakeTSVersion", - "size": 833 + "size": 842 } @@ -134,15 +134,15 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -152,18 +152,18 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "noEmit": true, "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: @@ -174,54 +174,54 @@ No shapes updated in the builder:: Change:: Fix error Input:: -//// [/src/a.ts] -const a = "hello" +//// [/home/src/projects/project/a.ts] +const a = "hello"; Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "noEmit": true, "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: -/src/a.ts (computed .d.ts) +/home/src/projects/project/a.ts (computed .d.ts) -//// [/src/tsconfig.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4011451714-const a = \"hello\"","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "../lib/lib.d.ts", + "../../../../lib/lib.d.ts", "./a.ts" ], "fileInfos": { - "../lib/lib.d.ts": { + "../../../../lib/lib.d.ts": { "original": { "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", "affectsGlobalScope": true @@ -232,11 +232,11 @@ Shape signatures in builder refreshed for:: }, "./a.ts": { "original": { - "version": "4011451714-const a = \"hello\"", + "version": "3528887741-const a = \"hello\";", "signature": "-5460434953-declare const a = \"hello\";\n", "affectsGlobalScope": true }, - "version": "4011451714-const a = \"hello\"", + "version": "3528887741-const a = \"hello\";", "signature": "-5460434953-declare const a = \"hello\";\n", "affectsGlobalScope": true } @@ -254,7 +254,101 @@ Shape signatures in builder refreshed for:: ] ], "version": "FakeTSVersion", - "size": 731 + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 710 } @@ -264,12 +358,261 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' exitCode:: ExitStatus.Success + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 894 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 863 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors.js index 3e122d641dec3..02424f409a902 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/semantic-errors.js @@ -1,5 +1,13 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,28 +23,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a: number = "hello" - -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "noEmit": true - } -} - Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'src/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -46,31 +44,31 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] +//// [/home/src/projects/project/tsconfig.tsbuildinfo] {"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "root": [ "./a.ts" @@ -87,15 +85,15 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -105,74 +103,74 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Fix error Input:: -//// [/src/a.ts] -const a = "hello" +//// [/home/src/projects/project/a.ts] +const a = "hello"; Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] +//// [/home/src/projects/project/tsconfig.tsbuildinfo] {"root":["./a.ts"],"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "root": [ "./a.ts" @@ -188,36 +186,253 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.js' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/a.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.js] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js new file mode 100644 index 0000000000000..c64d714e303a6 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js @@ -0,0 +1,72 @@ +5:: Introduce error +DtsSignature of ts files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" +} +Clean:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" +} +Dts Signature:: undefined +Incremental signature is neither dts signature nor file version for File:: ./b.ts +Incremental:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" +} +Clean:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" +} +Dts Signature:: undefined +7:: no-change-run +DtsSignature of files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" +} +Clean:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" +} +Dts Signature:: undefined +Incremental signature is neither dts signature nor file version for File:: ./b.ts +Incremental:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" +} +Clean:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" +} +Dts Signature:: undefined \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..c161e69c35405 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,669 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","signature":false,"affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":false},{"version":"-13368947479-export const b = 10;","signature":false}],"root":[2,3],"changeFileSet":[2,3,1],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": false, + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "changeFileSet": [ + "./a.ts", + "./b.ts", + "../../../../lib/lib.d.ts" + ], + "version": "FakeTSVersion", + "size": 770 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) +/home/src/projects/project/b.ts (computed .d.ts) +/lib/lib.d.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 849 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 816 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "changeFileSet": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 833 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], + "version": "FakeTSVersion", + "size": 846 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js new file mode 100644 index 0000000000000..9d051064d9d0f --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js @@ -0,0 +1,46 @@ +5:: Introduce error +DtsSignature of ts files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true +} +Clean:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": false, + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true +} +Dts Signature:: undefined +7:: no-change-run +DtsSignature of files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true +} +Clean:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": false, + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true +} +Dts Signature:: undefined \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental.js index d550181a434e6..5153fdee483f6 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors-with-incremental.js @@ -1,5 +1,15 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,28 +25,104 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a = "hello + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","signature":false,"affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":false,"affectsGlobalScope":true}],"root":[2],"changeFileSet":[2,1],"version":"FakeTSVersion"} -//// [/src/tsconfig.json] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { - "compilerOptions": { - "noEmit": true - } + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": false, + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": false, + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "changeFileSet": [ + "./a.ts", + "../../../../lib/lib.d.ts" + ], + "version": "FakeTSVersion", + "size": 708 } + + +Change:: no-change-run +Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'src/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -46,39 +132,77 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { + "incremental": true, "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) /lib/lib.d.ts (used version) -/src/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"errors":true,"version":"FakeTSVersion"} +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "../lib/lib.d.ts", + "../../../../lib/lib.d.ts", "./a.ts" ], "fileInfos": { - "../lib/lib.d.ts": { + "../../../../lib/lib.d.ts": { "original": { "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", "affectsGlobalScope": true @@ -89,11 +213,12 @@ Shape signatures in builder refreshed for:: }, "./a.ts": { "original": { - "version": "2464268576-const a = \"hello", + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", "affectsGlobalScope": true }, - "version": "2464268576-const a = \"hello", - "signature": "2464268576-const a = \"hello", + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", "affectsGlobalScope": true } }, @@ -109,9 +234,102 @@ Shape signatures in builder refreshed for:: "Js" ] ], - "errors": true, "version": "FakeTSVersion", - "size": 686 + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 710 } @@ -121,15 +339,34 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -139,76 +376,127 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "noEmit": true, "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts No shapes updated in the builder:: +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "changeFileSet": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 727 +} -Change:: Fix error -Input:: -//// [/src/a.ts] -const a = "hello" +Change:: Emit when error +Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "noEmit": true, "incremental": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: -/src/a.ts (computed .d.ts) +/home/src/projects/project/a.ts (computed .d.ts) -//// [/src/tsconfig.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"4011451714-const a = \"hello\"","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} +//// [/home/src/projects/project/a.js] +var a = "hello; + -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "../lib/lib.d.ts", + "../../../../lib/lib.d.ts", "./a.ts" ], "fileInfos": { - "../lib/lib.d.ts": { + "../../../../lib/lib.d.ts": { "original": { "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", "affectsGlobalScope": true @@ -219,11 +507,11 @@ Shape signatures in builder refreshed for:: }, "./a.ts": { "original": { - "version": "4011451714-const a = \"hello\"", + "version": "2464268576-const a = \"hello", "signature": "-5460434953-declare const a = \"hello\";\n", "affectsGlobalScope": true }, - "version": "4011451714-const a = \"hello\"", + "version": "2464268576-const a = \"hello", "signature": "-5460434953-declare const a = \"hello\";\n", "affectsGlobalScope": true } @@ -234,14 +522,14 @@ Shape signatures in builder refreshed for:: "./a.ts" ] ], - "affectedFilesPendingEmit": [ + "semanticDiagnosticsPerFile": [ [ "./a.ts", - "Js" + "not cached or not changed" ] ], "version": "FakeTSVersion", - "size": 731 + "size": 740 } @@ -251,12 +539,40 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'src/tsconfig.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors.js index 800a070d74498..99f86c6c2361f 100644 --- a/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors.js +++ b/tests/baselines/reference/tsbuild/noEmit/multiFile/syntax-errors.js @@ -1,5 +1,13 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,28 +23,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a = "hello - -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "noEmit": true - } -} - Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'src/tsconfig.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -46,31 +44,27 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/a.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/lib/lib.d.ts (used version) -/src/a.ts (used version) +No shapes updated in the builder:: -//// [/src/tsconfig.tsbuildinfo] +//// [/home/src/projects/project/tsconfig.tsbuildinfo] {"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "root": [ "./a.ts" @@ -87,15 +81,15 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -105,74 +99,70 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/a.ts +No cached semantic diagnostics in the builder:: -Shape signatures in builder refreshed for:: -/lib/lib.d.ts (used version) -/src/a.ts (used version) +No shapes updated in the builder:: -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Fix error Input:: -//// [/src/a.ts] -const a = "hello" +//// [/home/src/projects/project/a.ts] +const a = "hello"; Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'src/tsconfig.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) -//// [/src/tsconfig.tsbuildinfo] +//// [/home/src/projects/project/tsconfig.tsbuildinfo] {"root":["./a.ts"],"version":"FakeTSVersion"} -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] { "root": [ "./a.ts" @@ -188,36 +178,246 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'src/a.js' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/project/a.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: Shape signatures in builder refreshed for:: /lib/lib.d.ts (used version) -/src/a.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/a.js] +var a = "hello; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: -//// [/src/tsconfig.tsbuildinfo] file written with same contents -//// [/src/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite-discrepancies.js new file mode 100644 index 0000000000000..c9ab001058334 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite-discrepancies.js @@ -0,0 +1,740 @@ +0:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +1:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +2:: Introduce error but still noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +5:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +6:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +10:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +11:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +13:: Fix error and no emit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +15:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} +16:: No Change run with noEmit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite.js new file mode 100644 index 0000000000000..e50c90e141898 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-composite.js @@ -0,0 +1,1309 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outFile": "../outFile.js", + "module": "amd" + } +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "src/class" { + export class classC { + prop: number; + } +} +declare module "src/indirectClass" { + import { classC } from "src/class"; + export class indirectClass { + classC: classC; + } +} +declare module "src/directUse" { } +declare module "src/indirectUse" { } +declare module "src/noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("src/class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("src/indirectClass", ["require", "exports", "src/class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("src/directUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("src/indirectUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("src/noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "version": "FakeTSVersion", + "size": 2045 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 2643 +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] file written with same contents +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "version": "FakeTSVersion", + "size": 2045 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "src/class" { + export class classC { + prop1: number; + } +} +declare module "src/indirectClass" { + import { classC } from "src/class"; + export class indirectClass { + classC: classC; + } +} +declare module "src/directUse" { } +declare module "src/indirectUse" { } +declare module "src/noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("src/class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("src/indirectClass", ["require", "exports", "src/class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("src/directUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("src/indirectUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("src/noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "version": "FakeTSVersion", + "size": 2625 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":17,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 2064 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "src/class" { + export class classC { + prop: number; + } +} +declare module "src/indirectClass" { + import { classC } from "src/class"; + export class indirectClass { + classC: classC; + } +} +declare module "src/directUse" { } +declare module "src/indirectUse" { } +declare module "src/noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("src/class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("src/indirectClass", ["require", "exports", "src/class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("src/directUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("src/indirectUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("src/noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "version": "FakeTSVersion", + "size": 2045 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental-declaration.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental-declaration.js new file mode 100644 index 0000000000000..2f37581bb3a64 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental-declaration.js @@ -0,0 +1,1299 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "outFile": "../outFile.js", + "module": "amd" + } +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "class" { + export class classC { + prop: number; + } +} +declare module "indirectClass" { + import { classC } from "class"; + export class indirectClass { + classC: classC; + } +} +declare module "directUse" { } +declare module "indirectUse" { } +declare module "noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1496 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js | Dts", + false + ], + "version": "FakeTSVersion", + "size": 2094 +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] file written with same contents +//// [/src/outFile.js] file written with same contents +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1496 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "class" { + export class classC { + prop1: number; + } +} +declare module "indirectClass" { + import { classC } from "class"; + export class indirectClass { + classC: classC; + } +} +declare module "directUse" { } +declare module "indirectUse" { } +declare module "noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2074 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 1513 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "class" { + export class classC { + prop: number; + } +} +declare module "indirectClass" { + import { classC } from "class"; + export class indirectClass { + classC: classC; + } +} +declare module "directUse" { } +declare module "indirectUse" { } +declare module "noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1496 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental.js new file mode 100644 index 0000000000000..9dfd948bb536f --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-incremental.js @@ -0,0 +1,1231 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "outFile": "../outFile.js", + "module": "amd" + } +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1477 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error but still noEmit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 2075 +} + + + +Change:: Fix error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] file written with same contents +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1477 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Introduce error and emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2055 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 1497 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1477 +} + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with noEmit +Input:: + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite-discrepancies.js new file mode 100644 index 0000000000000..f85d03c164736 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite-discrepancies.js @@ -0,0 +1,74 @@ +2:: Fix error and no emit +Clean build will not have latestChangedDtsFile as there was no emit and emitSignatures as undefined for files +Incremental will store the past latestChangedDtsFile and emitSignatures +TsBuild info text without affectedFilesPendingEmit:: /src/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "FakeFileName", + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite.js new file mode 100644 index 0000000000000..a01cad1d6a7bb --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-composite.js @@ -0,0 +1,778 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "composite": true, + "outFile": "../outFile.js", + "module": "amd" + } +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 1511 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "src/class" { + export class classC { + prop: number; + } +} +declare module "src/indirectClass" { + import { classC } from "src/class"; + export class indirectClass { + classC: classC; + } +} +declare module "src/directUse" { } +declare module "src/indirectUse" { } +declare module "src/noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("src/class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("src/indirectClass", ["require", "exports", "src/class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("src/directUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("src/indirectUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("src/noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "version": "FakeTSVersion", + "size": 2045 +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "src/class" { + export class classC { + prop1: number; + } +} +declare module "src/indirectClass" { + import { classC } from "src/class"; + export class indirectClass { + classC: classC; + } +} +declare module "src/directUse" { } +declare module "src/indirectUse" { } +declare module "src/noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("src/class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("src/indirectClass", ["require", "exports", "src/class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("src/directUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("src/indirectUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("src/noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "version": "FakeTSVersion", + "size": 2625 +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":17,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 2064 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "src/class" { + export class classC { + prop: number; + } +} +declare module "src/indirectClass" { + import { classC } from "src/class"; + export class indirectClass { + classC: classC; + } +} +declare module "src/directUse" { } +declare module "src/indirectUse" { } +declare module "src/noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("src/class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("src/indirectClass", ["require", "exports", "src/class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("src/directUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("src/indirectUse", ["require", "exports", "src/indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("src/noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "composite": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "outSignature": "8998999540-declare module \"src/class\" {\n export class classC {\n prop: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", + "latestChangedDtsFile": "./outFile.d.ts", + "version": "FakeTSVersion", + "size": 2045 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js new file mode 100644 index 0000000000000..693dca5d5836a --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js @@ -0,0 +1,771 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "outFile": "../outFile.js", + "module": "amd" + } +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 1513 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "class" { + export class classC { + prop: number; + } +} +declare module "indirectClass" { + import { classC } from "class"; + export class indirectClass { + classC: classC; + } +} +declare module "directUse" { } +declare module "indirectUse" { } +declare module "noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1496 +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "class" { + export class classC { + prop1: number; + } +} +declare module "indirectClass" { + import { classC } from "class"; + export class indirectClass { + classC: classC; + } +} +declare module "directUse" { } +declare module "indirectUse" { } +declare module "noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2074 +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 1513 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.d.ts] +declare module "class" { + export class classC { + prop: number; + } +} +declare module "indirectClass" { + import { classC } from "class"; + export class indirectClass { + classC: classC; + } +} +declare module "directUse" { } +declare module "indirectUse" { } +declare module "noChangeFile" { + export function writeLog(s: string): void; +} +declare function someFunc(arguments: boolean, ...rest: any[]): void; + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1496 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental.js new file mode 100644 index 0000000000000..073903fe6ef67 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/changes-with-initial-noEmit-incremental.js @@ -0,0 +1,705 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + +//// [/src/project/src/directUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/indirectClass.ts] +import { classC } from './class'; +export class indirectClass { + classC = new classC(); +} + +//// [/src/project/src/indirectUse.ts] +import { indirectClass } from './indirectClass'; +new indirectClass().classC.prop; + +//// [/src/project/src/noChangeFile.ts] +export function writeLog(s: string) { +} + +//// [/src/project/src/noChangeFileWithEmitSpecificError.ts] +function someFunc(arguments: boolean, ...rest: any[]) { +} + +//// [/src/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "outFile": "../outFile.js", + "module": "amd" + } +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because output file 'src/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 1497 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1477 +} + + + +Change:: Introduce error with emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop1 = 1; +} + + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/directUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/indirectUse.ts:2:28 - error TS2551: Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'? + +2 new indirectClass().classC.prop; +   ~~~~ + + src/project/src/class.ts:2:5 + 2 prop1 = 1; +    ~~~~~ + 'prop1' is declared here. + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop1 = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1786859709-export class classC {\n prop1 = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[4,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[5,[{"start":76,"length":4,"code":2551,"category":1,"messageText":"Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?","relatedInformation":[{"file":"./project/src/class.ts","start":26,"length":5,"messageText":"'prop1' is declared here.","category":3,"code":2728}]}]],[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "1786859709-export class classC {\n prop1 = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/directuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/indirectuse.ts", + [ + { + "start": 76, + "length": 4, + "code": 2551, + "category": 1, + "messageText": "Property 'prop' does not exist on type 'classC'. Did you mean 'prop1'?", + "relatedInformation": [ + { + "file": "./project/src/class.ts", + "start": 26, + "length": 5, + "messageText": "'prop1' is declared here.", + "category": 3, + "code": 2728 + } + ] + } + ] + ], + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 2055 +} + + + +Change:: Fix error and no emit +Input:: +//// [/src/project/src/class.ts] +export class classC { + prop = 1; +} + + + +Output:: +/lib/tsc -b -v src/project --noEmit +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +exitCode:: ExitStatus.Success + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 1497 +} + + + +Change:: No Change run with emit +Input:: + + +Output:: +/lib/tsc -b -v src/project +[HH:MM:SS AM] Projects in this build: + * src/project/tsconfig.json + +[HH:MM:SS AM] Project 'src/project/tsconfig.json' is out of date because buildinfo file 'src/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/src/project/tsconfig.json'... + +src/project/src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS2396: Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + +1 function someFunc(arguments: boolean, ...rest: any[]) { +   ~~~~~~~~~~~~~~~~~~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + +//// [/src/outFile.js] +define("class", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.classC = void 0; + var classC = /** @class */ (function () { + function classC() { + this.prop = 1; + } + return classC; + }()); + exports.classC = classC; +}); +define("indirectClass", ["require", "exports", "class"], function (require, exports, class_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indirectClass = void 0; + var indirectClass = /** @class */ (function () { + function indirectClass() { + this.classC = new class_1.classC(); + } + return indirectClass; + }()); + exports.indirectClass = indirectClass; +}); +define("directUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_1) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_1.indirectClass().classC.prop; +}); +define("indirectUse", ["require", "exports", "indirectClass"], function (require, exports, indirectClass_2) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + new indirectClass_2.indirectClass().classC.prop; +}); +define("noChangeFile", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.writeLog = writeLog; + function writeLog(s) { + } +}); +function someFunc(arguments) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } +} + + +//// [/src/outFile.tsbuildinfo] +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"version":"FakeTSVersion"} + +//// [/src/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../lib/lib.d.ts", + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ], + "fileInfos": { + "../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/src/class.ts": "545032748-export class classC {\n prop = 1;\n}", + "./project/src/indirectclass.ts": "6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}", + "./project/src/directuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/indirectuse.ts": "-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;", + "./project/src/nochangefile.ts": "6714567633-export function writeLog(s: string) {\n}", + "./project/src/nochangefilewithemitspecificerror.ts": "-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}" + }, + "root": [ + [ + [ + 2, + 7 + ], + [ + "./project/src/class.ts", + "./project/src/indirectclass.ts", + "./project/src/directuse.ts", + "./project/src/indirectuse.ts", + "./project/src/nochangefile.ts", + "./project/src/nochangefilewithemitspecificerror.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/src/nochangefilewithemitspecificerror.ts", + [ + { + "start": 18, + "length": 18, + "messageText": "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", + "category": 1, + "code": 2396, + "skippedOn": "noEmit" + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1477 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js new file mode 100644 index 0000000000000..3dea92d919feb --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules-discrepancies.js @@ -0,0 +1,105 @@ +3:: no-change-run +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +7:: With declaration and declarationMap noEmit +Clean build will have declaration and declarationMap +Incremental build will have previous buildInfo so will have declaration and declarationMap +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js new file mode 100644 index 0000000000000..db2986c4b3d4b --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js @@ -0,0 +1,632 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 729 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 918 +} + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit | DtsMap", + 49 + ], + "version": "FakeTSVersion", + "size": 940 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 901 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 728 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 744 +} + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js new file mode 100644 index 0000000000000..799b3448ba452 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental-discrepancies.js @@ -0,0 +1,81 @@ +3:: no-change-run +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +7:: With declaration and declarationMap noEmit +Clean build will have declaration and declarationMap +Incremental build will have previous buildInfo so will have declaration and declarationMap +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "9520728827-const a = class { public p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "9520728827-const a = class { public p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental.js new file mode 100644 index 0000000000000..1c057f6ec493a --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-incremental.js @@ -0,0 +1,555 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 655 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 843 +} + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"declarationMap":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit | DtsMap", + 49 + ], + "version": "FakeTSVersion", + "size": 865 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 826 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","9520728827-const a = class { public p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "9520728827-const a = class { public p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 654 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","9520728827-const a = class { public p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "9520728827-const a = class { public p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 670 +} + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js new file mode 100644 index 0000000000000..dedd245a71f22 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js @@ -0,0 +1,64 @@ +3:: no-change-run +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js new file mode 100644 index 0000000000000..102e0ea355f6a --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -0,0 +1,1114 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/c.ts] +export const c = class { private p = 10; }; + +//// [/home/src/projects/project/d.ts] +export const d = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 881 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 1362 +} + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit | DtsMap", + 49 + ], + "version": "FakeTSVersion", + "size": 1384 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/d.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); +define("c", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.c = void 0; + exports.c = /** @class */ (function () { + function class_2() { + this.p = 10; + } + return class_2; + }()); +}); +define("d", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.d = void 0; + exports.d = /** @class */ (function () { + function class_3() { + this.p = 10; + } + return class_3; + }()); +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1345 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 880 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates there is change in compilerOptions + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 1215 +} + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 2 errors. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit | DtsMap", + 49 + ], + "version": "FakeTSVersion", + "size": 1237 +} + + + +Change:: Fix the another +Input:: +//// [/home/src/projects/project/c.ts] +export const c = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-15184115393-export const c = class { public p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-15184115393-export const c = class { public p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit | DtsMap", + 49 + ], + "version": "FakeTSVersion", + "size": 1090 +} + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes.js new file mode 100644 index 0000000000000..3370cfbd077c1 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-declaration-enable-changes.js @@ -0,0 +1,470 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/home/src/projects/project/tsconfig.json'... + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -b --v /home/src/projects/project --noEmit --declaration --declarationMap +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "declarationMap": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..8350ee6f74419 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,662 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 918 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 730 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.d.ts] +declare module "a" { + export const a = "hello"; +} +declare module "b" { + export const b = 10; +} + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 713 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 918 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 901 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..52096d340eda5 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-with-incremental.js @@ -0,0 +1,572 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 843 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 655 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 638 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 843 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 826 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..fe08d9a9d0b62 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,512 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 729 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/b.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 714 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 694 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 729 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 709 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..a275bd2d32cc9 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,433 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 655 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 639 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 619 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 655 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 635 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..9d2fec6014dcf --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,355 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors.js b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors.js new file mode 100644 index 0000000000000..2ccad5295c726 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/dts-errors.js @@ -0,0 +1,456 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/home/src/projects/project/tsconfig.json'... + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.d.ts] file changed its modified time +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..c9d744d952293 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,621 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 873 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 714 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 694 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 873 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 853 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental.js index d46412c48c1ba..7383eaa005bd4 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors-with-incremental.js @@ -1,5 +1,16 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,29 +26,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a: number = "hello" - -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "outFile": "../outFile.js", - "noEmit": true - } -} - Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'outFile.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -47,44 +47,44 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", - "noEmit": true, + "outFile": "/home/src/projects/outFile.js", "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"fileNames":["./lib/lib.d.ts","./src/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "./lib/lib.d.ts", - "./src/a.ts" + "../../../lib/lib.d.ts", + "./project/a.ts" ], "fileInfos": { - "./lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "./src/a.ts": "1311033573-const a: number = \"hello\"" + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" }, "root": [ [ 2, - "./src/a.ts" + "./project/a.ts" ] ], "options": { @@ -92,7 +92,7 @@ No shapes updated in the builder:: }, "semanticDiagnosticsPerFile": [ [ - "./src/a.ts", + "./project/a.ts", [ { "start": 6, @@ -109,7 +109,7 @@ No shapes updated in the builder:: false ], "version": "FakeTSVersion", - "size": 786 + "size": 797 } @@ -119,15 +119,15 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -137,19 +137,19 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", - "noEmit": true, + "outFile": "/home/src/projects/outFile.js", "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: @@ -160,60 +160,60 @@ No shapes updated in the builder:: Change:: Fix error Input:: -//// [/src/a.ts] -const a = "hello" +//// [/home/src/projects/project/a.ts] +const a = "hello"; Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", - "noEmit": true, + "outFile": "/home/src/projects/outFile.js", "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"fileNames":["./lib/lib.d.ts","./src/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","4011451714-const a = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "./lib/lib.d.ts", - "./src/a.ts" + "../../../lib/lib.d.ts", + "./project/a.ts" ], "fileInfos": { - "./lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "./src/a.ts": "4011451714-const a = \"hello\"" + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" }, "root": [ [ 2, - "./src/a.ts" + "./project/a.ts" ] ], "options": { @@ -224,7 +224,7 @@ No shapes updated in the builder:: false ], "version": "FakeTSVersion", - "size": 627 + "size": 639 } @@ -234,12 +234,314 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' exitCode:: ExitStatus.Success + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 619 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 797 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 777 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors.js b/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors.js index 43deb618adba6..48bd7911db692 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/semantic-errors.js @@ -1,5 +1,15 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,29 +25,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a: number = "hello" - -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "outFile": "../outFile.js", - "noEmit": true - } -} - Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'outFile.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -47,37 +46,37 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"root":["./src/a.ts"],"errors":true,"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "root": [ - "./src/a.ts" + "./project/a.ts" ], "errors": true, "version": "FakeTSVersion", - "size": 63 + "size": 67 } @@ -87,15 +86,15 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const a: number = "hello"    ~ @@ -105,78 +104,78 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] file written with same contents -//// [/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Fix error Input:: -//// [/src/a.ts] -const a = "hello" +//// [/home/src/projects/project/a.ts] +const a = "hello"; Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"root":["./src/a.ts"],"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "root": [ - "./src/a.ts" + "./project/a.ts" ], "version": "FakeTSVersion", - "size": 49 + "size": 53 } @@ -186,35 +185,248 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'outFile.js' does not exist +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.js' exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] file written with same contents -//// [/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..2c0120f536633 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,601 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[2,3,1],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "./project/a.ts", + "./project/b.ts", + "../../../lib/lib.d.ts" + ], + "version": "FakeTSVersion", + "size": 715 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 714 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 694 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 711 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "../../../lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ], + [ + "./project/b.ts", + "not cached or not changed" + ] + ], + "version": "FakeTSVersion", + "size": 728 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental.js index 477384425abf8..d7758f7775a15 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors-with-incremental.js @@ -1,5 +1,16 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,29 +26,92 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a = "hello + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -//// [/src/tsconfig.json] +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[2,1],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { - "compilerOptions": { - "outFile": "../outFile.js", - "noEmit": true - } + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "./project/a.ts", + "../../../lib/lib.d.ts" + ], + "version": "FakeTSVersion", + "size": 638 } + + +Change:: no-change-run +Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'outFile.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -47,44 +121,83 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", + "incremental": true, "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"fileNames":["./lib/lib.d.ts","./src/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"errors":true,"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "./lib/lib.d.ts", - "./src/a.ts" + "../../../lib/lib.d.ts", + "./project/a.ts" ], "fileInfos": { - "./lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "./src/a.ts": "2464268576-const a = \"hello" + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" }, "root": [ [ 2, - "./src/a.ts" + "./project/a.ts" ] ], "options": { @@ -94,7 +207,6 @@ No shapes updated in the builder:: "Js", false ], - "errors": true, "version": "FakeTSVersion", "size": 639 } @@ -106,15 +218,115 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 619 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -124,94 +336,135 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", - "noEmit": true, + "outFile": "/home/src/projects/outFile.js", "incremental": true, + "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 636 +} -Change:: Fix error -Input:: -//// [/src/a.ts] -const a = "hello" + +Change:: Emit when error +Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -exitCode:: ExitStatus.Success +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", - "noEmit": true, + "outFile": "/home/src/projects/outFile.js", "incremental": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"fileNames":["./lib/lib.d.ts","./src/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","4011451714-const a = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.js] +var a = "hello; -//// [/outFile.tsbuildinfo.readable.baseline.txt] + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "fileNames": [ - "./lib/lib.d.ts", - "./src/a.ts" + "../../../lib/lib.d.ts", + "./project/a.ts" ], "fileInfos": { - "./lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", - "./src/a.ts": "4011451714-const a = \"hello\"" + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "2464268576-const a = \"hello" }, "root": [ [ 2, - "./src/a.ts" + "./project/a.ts" ] ], "options": { "outFile": "./outFile.js" }, - "pendingEmit": [ - "Js", - false + "semanticDiagnosticsPerFile": [ + [ + "../../../lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ] ], "version": "FakeTSVersion", - "size": 627 + "size": 651 } @@ -221,12 +474,40 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v --incremental +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is up to date because newest input 'src/a.ts' is older than output 'outFile.tsbuildinfo' +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -exitCode:: ExitStatus.Success +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: diff --git a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors.js b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors.js index 23f034b7d7544..deff88ac9ea92 100644 --- a/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors.js +++ b/tests/baselines/reference/tsbuild/noEmit/outFile/syntax-errors.js @@ -1,5 +1,15 @@ currentDirectory:: / useCaseSensitiveFileNames: false Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + //// [/lib/lib.d.ts] /// interface Boolean {} @@ -15,29 +25,18 @@ interface Array { length: number; [n: number]: T; } interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -//// [/src/a.ts] -const a = "hello - -//// [/src/tsconfig.json] -{ - "compilerOptions": { - "outFile": "../outFile.js", - "noEmit": true - } -} - Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'outFile.tsbuildinfo' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -47,37 +46,35 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"root":["./src/a.ts"],"errors":true,"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "root": [ - "./src/a.ts" + "./project/a.ts" ], "errors": true, "version": "FakeTSVersion", - "size": 63 + "size": 67 } @@ -87,15 +84,15 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... -src/a.ts:1:17 - error TS1002: Unterminated string literal. +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. 1 const a = "hello     @@ -105,78 +102,76 @@ Found 1 error. exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts -Semantic diagnostics in builder refreshed for:: -/lib/lib.d.ts -/src/a.ts +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] file written with same contents -//// [/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents Change:: Fix error Input:: -//// [/src/a.ts] -const a = "hello" +//// [/home/src/projects/project/a.ts] +const a = "hello"; Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because buildinfo file 'outFile.tsbuildinfo' indicates that program needs to report errors. +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] -{"root":["./src/a.ts"],"version":"FakeTSVersion"} +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} -//// [/outFile.tsbuildinfo.readable.baseline.txt] +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] { "root": [ - "./src/a.ts" + "./project/a.ts" ], "version": "FakeTSVersion", - "size": 49 + "size": 53 } @@ -186,35 +181,245 @@ Input:: Output:: -/lib/tsc --b /src/tsconfig.json -v +/lib/tsc --b --v /home/src/projects/project --noEmit [HH:MM:SS AM] Projects in this build: - * src/tsconfig.json + * home/src/projects/project/tsconfig.json -[HH:MM:SS AM] Project 'src/tsconfig.json' is out of date because output file 'outFile.js' does not exist +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist -[HH:MM:SS AM] Building project '/src/tsconfig.json'... +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... exitCode:: ExitStatus.Success Program root files: [ - "/src/a.ts" + "/home/src/projects/project/a.ts" ] Program options: { - "outFile": "/outFile.js", + "outFile": "/home/src/projects/outFile.js", "noEmit": true, "tscBuild": true, - "configFilePath": "/src/tsconfig.json" + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" } Program structureReused: Not Program files:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts Semantic diagnostics in builder refreshed for:: /lib/lib.d.ts -/src/a.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is up to date because newest input 'home/src/projects/project/a.ts' is older than output 'home/src/projects/outFile.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello; + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc --b --v /home/src/projects/project --noEmit +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: No shapes updated in the builder:: -//// [/outFile.tsbuildinfo] file written with same contents -//// [/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js new file mode 100644 index 0000000000000..c7a71ad86a284 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js @@ -0,0 +1,427 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "emitDiagnosticsPerFile": [ + [ + "../src/main.ts", + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "../shared/types/db.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "../src/main.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "../src/other.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1182 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "original": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + }, + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1114 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration.js b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration.js new file mode 100644 index 0000000000000..d6f15f28e9f10 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-declaration.js @@ -0,0 +1,291 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 109 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts during emit) +/user/username/projects/noemitonerror/src/other.ts (computed .d.ts during emit) + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "version": "FakeTSVersion", + "size": 95 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/shared/types/db.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..f1149ef936e73 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors-with-incremental.js @@ -0,0 +1,323 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 940 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/other.ts' is older than output 'dev-build/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},"9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1044 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/tsconfig.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors.js new file mode 100644 index 0000000000000..dd6b6e5c802c4 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/multiFile/dts-errors.js @@ -0,0 +1,210 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file 'dev-build/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "version": "FakeTSVersion", + "size": 95 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/other.ts' is older than output 'dev-build/shared/types/db.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output 'dev-build/shared/types/db.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js new file mode 100644 index 0000000000000..4b4d464949594 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js @@ -0,0 +1,350 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "declaration": true, + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file '../dev-build.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./noemitonerror/src/main.ts", + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 1124 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 926 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output '../dev-build.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration.js b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration.js new file mode 100644 index 0000000000000..2de91ad7b61b0 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-declaration.js @@ -0,0 +1,283 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "declaration": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file '../dev-build.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"root":["./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 148 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error. + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.tsbuildinfo] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"root":["./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "version": "FakeTSVersion", + "size": 134 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output '../dev-build.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..03adf3a161ef3 --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors-with-incremental.js @@ -0,0 +1,268 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file '../dev-build.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 915 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/other.ts' is older than output '../dev-build.tsbuildinfo' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.js] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 907 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output '../dev-build.tsbuildinfo' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors.js b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors.js new file mode 100644 index 0000000000000..3160ee2beb84d --- /dev/null +++ b/tests/baselines/reference/tsbuild/noEmitOnError/outFile/dts-errors.js @@ -0,0 +1,203 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output file '../dev-build.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"root":["./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "version": "FakeTSVersion", + "size": 134 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/other.ts' is older than output '../dev-build.js' + +exitCode:: ExitStatus.Success + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.js] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc --b --verbose +[HH:MM:SS AM] Projects in this build: + * tsconfig.json + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date because newest input 'src/main.ts' is older than output '../dev-build.js' + +exitCode:: ExitStatus.Success + + diff --git a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js index b306ec35b3f00..7232eb9ca02e7 100644 --- a/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js +++ b/tests/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js @@ -117,15 +117,15 @@ exports.x = 10; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/index.ts", - "not cached" + "not cached or not changed" ], [ "./types/type.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./types/type.d.ts", diff --git a/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing-with-force.js b/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing-with-force.js index 0f3994fcc2835..8514a056595df 100644 --- a/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing-with-force.js +++ b/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing-with-force.js @@ -210,15 +210,15 @@ function multiply(a, b) { return a * b; } "semanticDiagnosticsPerFile": [ [ "../../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.ts", - "not cached" + "not cached or not changed" ], [ "./some_decl.d.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./index.d.ts", diff --git a/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing.js b/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing.js index 1205bcc402ec9..6868f16652c74 100644 --- a/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing.js +++ b/tests/baselines/reference/tsbuild/sample1/reports-error-if-input-file-is-missing.js @@ -210,15 +210,15 @@ function multiply(a, b) { return a * b; } "semanticDiagnosticsPerFile": [ [ "../../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.ts", - "not cached" + "not cached or not changed" ], [ "./some_decl.d.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./index.d.ts", diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..ae395d7305dff --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,828 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 935 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 823 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 849 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/a.d.ts] +export declare const a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1201 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1165 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..ce5289e38085b --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-with-incremental.js @@ -0,0 +1,734 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 910 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 779 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 743 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1094 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1058 +} + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..115b9ea4aa5cf --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,704 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 721 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 782 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 749 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 923 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 892 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..99c67ebf4dfa1 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,632 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 702 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 743 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 712 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 886 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 855 +} + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..c5b95323a5fc6 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,421 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/a.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors.js new file mode 100644 index 0000000000000..307218a51481b --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/dts-errors.js @@ -0,0 +1,484 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/a.d.ts] file changed its modified time + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..2e72323462331 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,755 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-11417512537-export const a: number = \"hello\"" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 865 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 782 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 749 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 935 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 904 +} + +//// [/home/src/projects/project/a.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..e354b8a59cd38 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors-with-incremental.js @@ -0,0 +1,686 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1311033573-const a: number = \"hello\"", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 844 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 743 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 712 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 896 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 865 +} + +//// [/home/src/projects/project/a.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors.js new file mode 100644 index 0000000000000..775800615b95d --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/semantic-errors.js @@ -0,0 +1,455 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..a26c0ea9a2d28 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,739 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","signature":false,"affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":false},{"version":"-13368947479-export const b = 10;","signature":false}],"root":[2,3],"changeFileSet":[1,2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": false, + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "changeFileSet": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "version": "FakeTSVersion", + "size": 772 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 851 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (computed .d.ts) +/home/src/projects/project/b.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 818 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "changeFileSet": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 835 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], + "version": "FakeTSVersion", + "size": 848 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..c9b930d15768d --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors-with-incremental.js @@ -0,0 +1,646 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","signature":false,"affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":false,"affectsGlobalScope":true}],"root":[2],"changeFileSet":[1,2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": false, + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": false, + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "changeFileSet": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 710 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 743 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 712 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "changeFileSet": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 729 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], + "version": "FakeTSVersion", + "size": 742 +} + +//// [/home/src/projects/project/a.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors.js new file mode 100644 index 0000000000000..bf02fbc07707a --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/multiFile/syntax-errors.js @@ -0,0 +1,456 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/tsconfig.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 45 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/project/a.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/project/tsconfig.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"root":["./a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 59 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/project/a.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/project/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..375bad2f20102 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,744 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 920 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 732 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 715 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.d.ts] +declare module "a" { + export const a = "hello"; +} +declare module "b" { + export const b = 10; +} + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 920 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 903 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..9e7f9ade2a504 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-with-incremental.js @@ -0,0 +1,648 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 845 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 657 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 640 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 845 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 828 +} + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..2fe818546ef26 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,656 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 731 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 716 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 696 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 731 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 711 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..4a812c04a6943 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,565 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 657 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 641 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 621 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 657 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 637 +} + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..a00ebe955a717 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,431 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.js' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors.js new file mode 100644 index 0000000000000..67ea67b59906c --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/dts-errors.js @@ -0,0 +1,492 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.d.ts] file changed its modified time + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..24417c1e97e8f --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,699 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 875 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 716 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 696 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 875 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 855 +} + +//// [/home/src/projects/outFile.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..5381c8134e1bb --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors-with-incremental.js @@ -0,0 +1,619 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 799 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 641 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 621 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 799 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 779 +} + +//// [/home/src/projects/outFile.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors.js new file mode 100644 index 0000000000000..91166cbcad536 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/semantic-errors.js @@ -0,0 +1,465 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..b1a813a166ec0 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,679 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[1,2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "version": "FakeTSVersion", + "size": 717 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 716 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 696 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 713 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "../../../a/lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ], + [ + "./project/b.ts", + "not cached or not changed" + ] + ], + "version": "FakeTSVersion", + "size": 730 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..eaf9b3de72367 --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors-with-incremental.js @@ -0,0 +1,585 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[1,2],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 640 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 641 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that some of the changes were not emitted + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 621 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 638 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "../../../a/lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ] + ], + "version": "FakeTSVersion", + "size": 653 +} + +//// [/home/src/projects/outFile.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors.js b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors.js new file mode 100644 index 0000000000000..53e695a99426a --- /dev/null +++ b/tests/baselines/reference/tsbuildWatch/noEmit/outFile/syntax-errors.js @@ -0,0 +1,464 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -b -verbose /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Projects in this build: + * home/src/projects/project/tsconfig.json + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.tsbuildinfo' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + +FsWatches:: +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +1: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 53 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +2: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output file 'home/src/projects/outFile.js' does not exist + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/tsconfig.json' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +4: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because output 'home/src/projects/outFile.tsbuildinfo' is older than input 'home/src/projects/project/a.ts' + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"root":["./project/a.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./project/a.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 67 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +5: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/home/src/projects/outFile.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +6: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'home/src/projects/project/tsconfig.json' is out of date because buildinfo file 'home/src/projects/outFile.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/home/src/projects/project/tsconfig.json'... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-declaration-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js similarity index 63% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-declaration-with-incremental.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js index b411926284e6e..2ae6b355e94c3 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js @@ -44,7 +44,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -255,7 +255,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -423,7 +423,37 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -432,10 +462,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -587,10 +617,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -640,7 +670,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -649,10 +679,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -786,10 +816,415 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","signature":"-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[3,17]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "../src/other.ts": { + "original": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + }, + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "emitDiagnosticsPerFile": [ + [ + "../src/main.ts", + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "../src/main.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1423 +} + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "original": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + }, + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1114 +} + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js similarity index 54% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js index 508d58bbc73aa..3173036158946 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js @@ -4,6 +4,7 @@ Input:: { "compilerOptions": { "outDir": "./dev-build", + "declaration": true, "noEmitOnError": true } } @@ -42,7 +43,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -100,6 +101,7 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -165,6 +167,7 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -183,7 +186,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -232,6 +235,12 @@ Output:: Object.defineProperty(exports, "__esModule", { value: true }); +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -240,12 +249,20 @@ var a = { }; +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export {}; + + //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); console.log("hi"); +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + Program root files: [ @@ -255,6 +272,7 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -275,7 +293,69 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -284,10 +364,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -332,6 +412,7 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -358,10 +439,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -391,6 +472,7 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -409,7 +491,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -418,10 +500,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -454,13 +536,16 @@ Output:: } //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var a = "hello"; +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file changed its modified time Program root files: [ @@ -470,6 +555,7 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -496,10 +582,308 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 109 +} + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file 'dev-build/tsconfig.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"root":["../shared/types/db.ts","../src/main.ts","../src/other.ts"],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "version": "FakeTSVersion", + "size": 95 +} + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -519,8 +903,11 @@ Output:: //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file changed its modified time Program root files: [ @@ -530,6 +917,7 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-incremental.js similarity index 65% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-incremental.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-incremental.js index be71f83283878..9bd0010b46ea9 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError-with-incremental.js @@ -43,7 +43,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -251,7 +251,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -399,7 +399,37 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -408,10 +438,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -557,10 +587,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -609,7 +639,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -618,10 +648,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -748,10 +778,339 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","signature":"-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1144 +} + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},"9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1044 +} + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-declaration.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError.js similarity index 59% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-declaration.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError.js index 48ad94fb9638d..7b566a4bb14eb 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/does-not-emit-any-files-on-error-with-declaration.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/multiFile/noEmitOnError.js @@ -4,7 +4,6 @@ Input:: { "compilerOptions": { "outDir": "./dev-build", - "declaration": true, "noEmitOnError": true } } @@ -43,7 +42,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -101,7 +100,6 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -167,7 +165,6 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -186,7 +183,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -235,12 +232,6 @@ Output:: Object.defineProperty(exports, "__esModule", { value: true }); -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] -export interface A { - name: string; -} - - //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -249,20 +240,12 @@ var a = { }; -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] -export {}; - - //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); console.log("hi"); -//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] -export {}; - - Program root files: [ @@ -272,7 +255,6 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -293,7 +275,65 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -302,10 +342,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -350,7 +390,6 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -377,10 +416,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -410,7 +449,6 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -429,7 +467,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -438,10 +476,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -474,16 +512,13 @@ Output:: } //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var a = "hello"; -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file changed its modified time Program root files: [ @@ -493,7 +528,6 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -520,10 +554,267 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output 'dev-build/tsconfig.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -543,11 +834,8 @@ Output:: //// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file changed its modified time //// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file changed its modified time -//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file changed its modified time Program root files: [ @@ -557,7 +845,6 @@ Program root files: [ ] Program options: { "outDir": "/user/username/projects/noEmitOnError/dev-build", - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-declaration-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js similarity index 62% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-declaration-with-incremental.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js index f3ea2d30c4c42..ac08fc8677ccd 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js @@ -45,7 +45,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -218,7 +218,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -353,7 +353,37 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -362,10 +392,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -484,10 +514,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -538,7 +568,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -547,10 +577,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -664,10 +694,370 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./noemitonerror/src/main.ts", + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 1124 +} + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 926 +} + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js similarity index 56% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js index 91923ee6f5a6d..4a0320fd7f999 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js @@ -5,6 +5,7 @@ Input:: "compilerOptions": { "outFile": "../dev-build.js", "module": "amd", + "declaration": true, "noEmitOnError": true } } @@ -43,7 +44,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -102,6 +103,7 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -164,6 +166,7 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -182,7 +185,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -245,6 +248,18 @@ define("src/other", ["require", "exports"], function (require, exports) { }); +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { } +declare module "src/other" { + export {}; +} + + Program root files: [ @@ -255,6 +270,7 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -277,7 +293,66 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time +//// [/user/username/projects/dev-build.js] file changed its modified time +//// [/user/username/projects/dev-build.d.ts] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -286,10 +361,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -335,6 +410,7 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -363,10 +439,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -397,6 +473,7 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -415,7 +492,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -424,10 +501,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -474,6 +551,7 @@ define("src/other", ["require", "exports"], function (require, exports) { }); +//// [/user/username/projects/dev-build.d.ts] file written with same contents Program root files: [ @@ -484,6 +562,7 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -512,10 +591,327 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time +//// [/user/username/projects/dev-build.js] file changed its modified time +//// [/user/username/projects/dev-build.d.ts] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"root":["./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"errors":true,"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "errors": true, + "version": "FakeTSVersion", + "size": 148 +} + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because buildinfo file '../dev-build.tsbuildinfo' indicates that program needs to report errors. + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"root":["./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "root": [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "version": "FakeTSVersion", + "size": 134 +} + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -535,6 +931,7 @@ Output:: //// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time //// [/user/username/projects/dev-build.js] file changed its modified time +//// [/user/username/projects/dev-build.d.ts] file changed its modified time Program root files: [ @@ -545,6 +942,7 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, + "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-incremental.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-incremental.js similarity index 65% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-incremental.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-incremental.js index d18caa3ed1d3a..d08a1e66691d7 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-incremental.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError-with-incremental.js @@ -44,7 +44,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -214,7 +214,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -335,7 +335,37 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -344,10 +374,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -464,10 +494,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -517,7 +547,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -526,10 +556,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -640,10 +670,296 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 915 +} + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is up to date but needs to update timestamps of output files that are older than input files + +[HH:MM:SS AM] Updating output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 907 +} + +//// [/user/username/projects/dev-build.js] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-declaration.js b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError.js similarity index 60% rename from tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-declaration.js rename to tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError.js index 7f9cdee84059d..ebf125e5daf6e 100644 --- a/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/does-not-emit-any-files-on-error-with-declaration.js +++ b/tests/baselines/reference/tsbuildWatch/noEmitOnError/outFile/noEmitOnError.js @@ -5,7 +5,6 @@ Input:: "compilerOptions": { "outFile": "../dev-build.js", "module": "amd", - "declaration": true, "noEmitOnError": true } } @@ -44,7 +43,7 @@ interface ReadonlyArray {} declare const console: { log(msg: any): void; }; -/a/lib/tsc.js -b -w -verbose +/a/lib/tsc.js -b -verbose --w Output:: >> Screen clear [HH:MM:SS AM] Starting compilation in watch mode... @@ -103,7 +102,6 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -166,7 +164,6 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -185,7 +182,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -248,18 +245,6 @@ define("src/other", ["require", "exports"], function (require, exports) { }); -//// [/user/username/projects/dev-build.d.ts] -declare module "shared/types/db" { - export interface A { - name: string; - } -} -declare module "src/main" { } -declare module "src/other" { - export {}; -} - - Program root files: [ @@ -270,7 +255,6 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -293,7 +277,64 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +3: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time +//// [/user/username/projects/dev-build.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -302,10 +343,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject *new* +4: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -3: timerToBuildInvalidatedProject +4: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -351,7 +392,6 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -380,10 +420,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject *new* +5: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -4: timerToBuildInvalidatedProject +5: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -414,7 +454,6 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -433,7 +472,7 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -442,10 +481,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject *new* +6: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -5: timerToBuildInvalidatedProject +6: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -492,7 +531,6 @@ define("src/other", ["require", "exports"], function (require, exports) { }); -//// [/user/username/projects/dev-build.d.ts] file written with same contents Program root files: [ @@ -503,7 +541,6 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, @@ -532,10 +569,274 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject *new* +7: timerToBuildInvalidatedProject *new* Before running Timeout callback:: count: 1 -6: timerToBuildInvalidatedProject +7: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time +//// [/user/username/projects/dev-build.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +8: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +9: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Updating unchanged output timestamps of project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time +//// [/user/username/projects/dev-build.js] file changed its modified time + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +10: timerToBuildInvalidatedProject + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Project 'tsconfig.json' is out of date because output '../dev-build.tsbuildinfo' is older than input 'src/main.ts' + +[HH:MM:SS AM] Building project '/user/username/projects/noEmitOnError/tsconfig.json'... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] file written with same contents +//// [/user/username/projects/dev-build.js] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "watch": true, + "tscBuild": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject *new* + +Before running Timeout callback:: count: 1 +11: timerToBuildInvalidatedProject Host is moving to new time After running Timeout callback:: count: 0 @@ -555,7 +856,6 @@ Output:: //// [/user/username/projects/dev-build.tsbuildinfo] file changed its modified time //// [/user/username/projects/dev-build.js] file changed its modified time -//// [/user/username/projects/dev-build.d.ts] file changed its modified time Program root files: [ @@ -566,7 +866,6 @@ Program root files: [ Program options: { "outFile": "/user/username/projects/dev-build.js", "module": 2, - "declaration": true, "noEmitOnError": true, "watch": true, "tscBuild": true, diff --git a/tests/baselines/reference/tsbuildWatch/programUpdates/watches-config-files-that-are-not-present.js b/tests/baselines/reference/tsbuildWatch/programUpdates/watches-config-files-that-are-not-present.js index 579b229a02948..144f299a0df67 100644 --- a/tests/baselines/reference/tsbuildWatch/programUpdates/watches-config-files-that-are-not-present.js +++ b/tests/baselines/reference/tsbuildWatch/programUpdates/watches-config-files-that-are-not-present.js @@ -321,23 +321,23 @@ export declare const m: typeof mod; "semanticDiagnosticsPerFile": [ [ "../../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../core/index.d.ts", - "not cached" + "not cached or not changed" ], [ "../core/anothermodule.d.ts", - "not cached" + "not cached or not changed" ], [ "../logic/index.ts", - "not cached" + "not cached or not changed" ], [ "./index.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./index.d.ts", diff --git a/tests/baselines/reference/tsc/cancellationToken/when-emitting-buildInfo.js b/tests/baselines/reference/tsc/cancellationToken/when-emitting-buildInfo.js index bd7d0b0f629d6..c1b71f2d6ce45 100644 --- a/tests/baselines/reference/tsc/cancellationToken/when-emitting-buildInfo.js +++ b/tests/baselines/reference/tsc/cancellationToken/when-emitting-buildInfo.js @@ -256,7 +256,7 @@ Operation ws cancelled:: true //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts","./d.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}","signature":"-2874569268-export declare var C: {\n new (): {\n d: number;\n };\n};\n"},{"version":"-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}","signature":"-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"},{"version":"-7804761415-export class D { }","signature":"-8611429667-export declare class D {\n}\n"}],"root":[[2,5]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts","./d.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}","signature":"-2874569268-export declare var C: {\n new (): {\n d: number;\n };\n};\n"},{"version":"-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}","signature":"-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"},{"version":"-7804761415-export class D { }","signature":"-8611429667-export declare class D {\n}\n"}],"root":[[2,5]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2]],"changeFileSet":[2],"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -343,14 +343,11 @@ Operation ws cancelled:: true "./c.ts" ] }, - "semanticDiagnosticsPerFile": [ - [ - "./c.ts", - "not cached" - ] + "changeFileSet": [ + "./c.ts" ], "version": "FakeTSVersion", - "size": 1283 + "size": 1270 } @@ -384,8 +381,34 @@ Change:: Normal build Input:: +//// [/user/username/projects/myproject/c.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.C = void 0; +exports.foo = foo; +exports.C = /** @class */ (function () { + function CReal() { + this.d = 1; + } + return CReal; +}()); +function foo() { } + + +//// [/user/username/projects/myproject/c.d.ts] +export declare var C: { + new (): { + d: number; + }; +}; +export declare function foo(): void; + + +//// [/user/username/projects/myproject/b.js] file written with same contents +//// [/user/username/projects/myproject/b.d.ts] file written with same contents +//// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts","./d.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}","signature":"-2874569268-export declare var C: {\n new (): {\n d: number;\n };\n};\n"},{"version":"-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}","signature":"-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"},{"version":"-7804761415-export class D { }","signature":"-8611429667-export declare class D {\n}\n"}],"root":[[2,5]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2]],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts","./d.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}","signature":"-544179862-export declare var C: {\n new (): {\n d: number;\n };\n};\nexport declare function foo(): void;\n"},{"version":"-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}","signature":"-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"},{"version":"-7804761415-export class D { }","signature":"-8611429667-export declare class D {\n}\n"}],"root":[[2,5]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2]],"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -417,10 +440,10 @@ Input:: "./c.ts": { "original": { "version": "-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}", - "signature": "-2874569268-export declare var C: {\n new (): {\n d: number;\n };\n};\n" + "signature": "-544179862-export declare var C: {\n new (): {\n d: number;\n };\n};\nexport declare function foo(): void;\n" }, "version": "-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}", - "signature": "-2874569268-export declare var C: {\n new (): {\n d: number;\n };\n};\n" + "signature": "-544179862-export declare var C: {\n new (): {\n d: number;\n };\n};\nexport declare function foo(): void;\n" }, "./b.ts": { "original": { @@ -473,7 +496,7 @@ Input:: ] }, "version": "FakeTSVersion", - "size": 1250 + "size": 1287 } @@ -498,8 +521,13 @@ Program files:: Semantic diagnostics in builder refreshed for:: /user/username/projects/myproject/c.ts +/user/username/projects/myproject/b.ts +/user/username/projects/myproject/a.ts -No shapes updated in the builder:: +Shape signatures in builder refreshed for:: +/user/username/projects/myproject/c.ts (computed .d.ts) +/user/username/projects/myproject/b.ts (computed .d.ts) +/user/username/projects/myproject/a.ts (computed .d.ts during emit) exitCode:: ExitStatus.undefined @@ -507,127 +535,16 @@ Change:: Clean build Input:: -//// [/user/username/projects/myproject/c.js] -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.C = void 0; -exports.foo = foo; -exports.C = /** @class */ (function () { - function CReal() { - this.d = 1; - } - return CReal; -}()); -function foo() { } - - -//// [/user/username/projects/myproject/c.d.ts] -export declare var C: { - new (): { - d: number; - }; -}; -export declare function foo(): void; - - +//// [/user/username/projects/myproject/c.js] file written with same contents +//// [/user/username/projects/myproject/c.d.ts] file written with same contents //// [/user/username/projects/myproject/b.js] file written with same contents //// [/user/username/projects/myproject/b.d.ts] file written with same contents //// [/user/username/projects/myproject/a.js] file written with same contents //// [/user/username/projects/myproject/a.d.ts] file written with same contents //// [/user/username/projects/myproject/d.js] file written with same contents //// [/user/username/projects/myproject/d.d.ts] file written with same contents -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts","./d.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}","signature":"-544179862-export declare var C: {\n new (): {\n d: number;\n };\n};\nexport declare function foo(): void;\n"},{"version":"-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}","signature":"-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"},{"version":"-7804761415-export class D { }","signature":"-8611429667-export declare class D {\n}\n"}],"root":[[2,5]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2]],"version":"FakeTSVersion"} - -//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] -{ - "fileNames": [ - "../../../../a/lib/lib.d.ts", - "./c.ts", - "./b.ts", - "./a.ts", - "./d.ts" - ], - "fileIdsList": [ - [ - "./b.ts" - ], - [ - "./c.ts" - ] - ], - "fileInfos": { - "../../../../a/lib/lib.d.ts": { - "original": { - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "version": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "signature": "-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }", - "affectsGlobalScope": true - }, - "./c.ts": { - "original": { - "version": "-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}", - "signature": "-544179862-export declare var C: {\n new (): {\n d: number;\n };\n};\nexport declare function foo(): void;\n" - }, - "version": "-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}", - "signature": "-544179862-export declare var C: {\n new (): {\n d: number;\n };\n};\nexport declare function foo(): void;\n" - }, - "./b.ts": { - "original": { - "version": "-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}", - "signature": "-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n" - }, - "version": "-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}", - "signature": "-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n" - }, - "./a.ts": { - "original": { - "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "-3531856636-export {};\n" - }, - "version": "4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);", - "signature": "-3531856636-export {};\n" - }, - "./d.ts": { - "original": { - "version": "-7804761415-export class D { }", - "signature": "-8611429667-export declare class D {\n}\n" - }, - "version": "-7804761415-export class D { }", - "signature": "-8611429667-export declare class D {\n}\n" - } - }, - "root": [ - [ - [ - 2, - 5 - ], - [ - "./c.ts", - "./b.ts", - "./a.ts", - "./d.ts" - ] - ] - ], - "options": { - "declaration": true - }, - "referencedMap": { - "./a.ts": [ - "./b.ts" - ], - "./b.ts": [ - "./c.ts" - ] - }, - "version": "FakeTSVersion", - "size": 1287 -} - +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo] file written with same contents +//// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Program root files: [ "/user/username/projects/myproject/a.ts", diff --git a/tests/baselines/reference/tsc/cancellationToken/when-using-state.js b/tests/baselines/reference/tsc/cancellationToken/when-using-state.js index a19074b6ee326..e401a1d0123d8 100644 --- a/tests/baselines/reference/tsc/cancellationToken/when-using-state.js +++ b/tests/baselines/reference/tsc/cancellationToken/when-using-state.js @@ -256,7 +256,7 @@ Operation ws cancelled:: true //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts","./d.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}","signature":"-2874569268-export declare var C: {\n new (): {\n d: number;\n };\n};\n"},{"version":"-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}","signature":"-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"},{"version":"-7804761415-export class D { }","signature":"-8611429667-export declare class D {\n}\n"}],"root":[[2,5]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2]],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./c.ts","./b.ts","./a.ts","./d.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-8116587914-export var C = class CReal {\n d = 1;\n};export function foo() {}","signature":"-2874569268-export declare var C: {\n new (): {\n d: number;\n };\n};\n"},{"version":"-6441446591-import {C} from './c';\nexport class B {\n c = new C();\n}","signature":"-12916012021-export declare class B {\n c: {\n d: number;\n };\n}\n"},{"version":"4878398349-import {B} from './b';\ndeclare var console: any;\nlet b = new B();\nconsole.log(b.c.d);","signature":"-3531856636-export {};\n"},{"version":"-7804761415-export class D { }","signature":"-8611429667-export declare class D {\n}\n"}],"root":[[2,5]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2]],"changeFileSet":[2],"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -343,14 +343,11 @@ Operation ws cancelled:: true "./c.ts" ] }, - "semanticDiagnosticsPerFile": [ - [ - "./c.ts", - "not cached" - ] + "changeFileSet": [ + "./c.ts" ], "version": "FakeTSVersion", - "size": 1283 + "size": 1270 } diff --git a/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js b/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js index 63d85312cd294..b4104dc3ffc22 100644 --- a/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js +++ b/tests/baselines/reference/tsc/incremental/when-new-file-is-added-to-the-referenced-project.js @@ -385,11 +385,11 @@ exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated "semanticDiagnosticsPerFile": [ [ "../project1/class1.d.ts", - "not cached" + "not cached or not changed" ], [ "./class2.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./class2.d.ts", diff --git a/tests/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js b/tests/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js index f143d7bb7aacb..85d12f97ddfdf 100644 --- a/tests/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js +++ b/tests/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js @@ -254,11 +254,11 @@ Shape signatures in builder refreshed for:: "semanticDiagnosticsPerFile": [ [ "./a.d.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", diff --git a/tests/baselines/reference/tsc/moduleResolution/alternateResult.js b/tests/baselines/reference/tsc/moduleResolution/alternateResult.js index ed6ecc8a79b32..c4cd0a925744b 100644 --- a/tests/baselines/reference/tsc/moduleResolution/alternateResult.js +++ b/tests/baselines/reference/tsc/moduleResolution/alternateResult.js @@ -461,19 +461,19 @@ Object.defineProperty(exports, "__esModule", { value: true }); "semanticDiagnosticsPerFile": [ [ "../../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1682,23 +1682,23 @@ Shape signatures in builder refreshed for:: "semanticDiagnosticsPerFile": [ [ "../../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1972,27 +1972,27 @@ Shape signatures in builder refreshed for:: "semanticDiagnosticsPerFile": [ [ "../../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -2290,23 +2290,23 @@ Shape signatures in builder refreshed for:: "semanticDiagnosticsPerFile": [ [ "../../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -2621,19 +2621,19 @@ Shape signatures in builder refreshed for:: "semanticDiagnosticsPerFile": [ [ "../../../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", diff --git a/tests/baselines/reference/tsc/noCheck/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsc/noCheck/multiFile/dts-errors-with-incremental.js index 64b3ac7202b89..8ac646bbe7409 100644 --- a/tests/baselines/reference/tsc/noCheck/multiFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noCheck/multiFile/dts-errors-with-incremental.js @@ -139,15 +139,15 @@ exports.b = 10; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -307,15 +307,15 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -611,7 +611,7 @@ exports.a = /** @class */ (function () { "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -877,7 +877,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1229,7 +1229,7 @@ exports.a = /** @class */ (function () { "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", @@ -1374,7 +1374,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", diff --git a/tests/baselines/reference/tsc/noCheck/multiFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsc/noCheck/multiFile/semantic-errors-with-incremental.js index cd489f67e805b..988534557d630 100644 --- a/tests/baselines/reference/tsc/noCheck/multiFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noCheck/multiFile/semantic-errors-with-incremental.js @@ -134,15 +134,15 @@ exports.b = 10; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -274,15 +274,15 @@ export declare const a = "hello"; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -563,7 +563,7 @@ export declare const a: number; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -804,7 +804,7 @@ export declare const a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1141,7 +1141,7 @@ export declare const a: number; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", @@ -1269,7 +1269,7 @@ export declare const a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", diff --git a/tests/baselines/reference/tsc/noCheck/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsc/noCheck/multiFile/syntax-errors-with-incremental.js index 6ba0dc278841c..241d24b640de7 100644 --- a/tests/baselines/reference/tsc/noCheck/multiFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noCheck/multiFile/syntax-errors-with-incremental.js @@ -142,15 +142,15 @@ exports.b = 10; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -293,15 +293,15 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -593,7 +593,7 @@ exports.a = "hello; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -733,7 +733,7 @@ No shapes updated in the builder:: "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -837,7 +837,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1185,7 +1185,7 @@ exports.a = "hello; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", @@ -1316,7 +1316,7 @@ exports.a = "hello"; "semanticDiagnosticsPerFile": [ [ "./a.ts", - "not cached" + "not cached or not changed" ], [ "./c.ts", diff --git a/tests/baselines/reference/tsc/noCheck/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsc/noCheck/outFile/dts-errors-with-incremental.js index 847da3c02eef1..bc64ad79f1fd3 100644 --- a/tests/baselines/reference/tsc/noCheck/outFile/dts-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noCheck/outFile/dts-errors-with-incremental.js @@ -121,15 +121,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -285,15 +285,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -565,15 +565,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -812,15 +812,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1142,19 +1142,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "emitDiagnosticsPerFile": [ @@ -1274,19 +1274,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, diff --git a/tests/baselines/reference/tsc/noCheck/outFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsc/noCheck/outFile/semantic-errors-with-incremental.js index 6b6b8e7c6b040..dec9376c9ef9a 100644 --- a/tests/baselines/reference/tsc/noCheck/outFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noCheck/outFile/semantic-errors-with-incremental.js @@ -117,15 +117,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -245,15 +245,15 @@ declare module "b" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -507,15 +507,15 @@ declare module "b" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -726,15 +726,15 @@ declare module "b" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1035,19 +1035,19 @@ declare module "c" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1144,19 +1144,19 @@ declare module "c" { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, diff --git a/tests/baselines/reference/tsc/noCheck/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsc/noCheck/outFile/syntax-errors-with-incremental.js index 28fe71ecec3bc..f47216ccfcb7d 100644 --- a/tests/baselines/reference/tsc/noCheck/outFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noCheck/outFile/syntax-errors-with-incremental.js @@ -125,15 +125,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -267,15 +267,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -543,15 +543,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -673,15 +673,15 @@ No shapes updated in the builder:: "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -773,15 +773,15 @@ define("b", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1099,19 +1099,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, @@ -1217,19 +1217,19 @@ define("c", ["require", "exports"], function (require, exports) { "semanticDiagnosticsPerFile": [ [ "./lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./src/a.ts", - "not cached" + "not cached or not changed" ], [ "./src/b.ts", - "not cached" + "not cached or not changed" ], [ "./src/c.ts", - "not cached" + "not cached or not changed" ] ], "checkPending": true, diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/changes-composite.js b/tests/baselines/reference/tsc/noEmit/multiFile/changes-composite.js index a616debd0d119..f3934fa98128e 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/changes-composite.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/changes-composite.js @@ -1194,7 +1194,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1315,24 +1315,32 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/directuse.ts" + "./src/directuse.ts", + 16 ], - "Dts" + "DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/indirectuse.ts" + "./src/indirectuse.ts", + 16 ], - "Dts" + "DtsEmit" ] ], "emitSignatures": [ @@ -1351,7 +1359,7 @@ exitCode:: ExitStatus.Success ], "latestChangedDtsFile": "./src/class.d.ts", "version": "FakeTSVersion", - "size": 2201 + "size": 2217 } diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/changes-incremental-declaration.js b/tests/baselines/reference/tsc/noEmit/multiFile/changes-incremental-declaration.js index 3134ab9e7e8f6..45b56adfac945 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/changes-incremental-declaration.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/changes-incremental-declaration.js @@ -1184,7 +1184,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -1305,28 +1305,36 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/directuse.ts" + "./src/directuse.ts", + 16 ], - "Dts" + "DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/indirectuse.ts" + "./src/indirectuse.ts", + 16 ], - "Dts" + "DtsEmit" ] ], "version": "FakeTSVersion", - "size": 2006 + "size": 2022 } diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-composite.js b/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-composite.js index 7ae85225560ff..6db7cc7f040e6 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-composite.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-composite.js @@ -57,7 +57,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,4,3,5,6,7],"emitSignatures":[2,3,4,5,6,7],"version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,17],[3,17],[5,17],[6,17],[7,17]],"emitSignatures":[2,3,4,5,6,7],"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -165,28 +165,46 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/directuse.ts", - "Js | Dts" + [ + "./src/directuse.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/indirectuse.ts", - "Js | Dts" + [ + "./src/indirectuse.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/nochangefile.ts", - "Js | Dts" + [ + "./src/nochangefile.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/nochangefilewithemitspecificerror.ts", - "Js | Dts" + [ + "./src/nochangefilewithemitspecificerror.ts", + 17 + ], + "Js | DtsEmit" ] ], "emitSignatures": [ @@ -198,7 +216,7 @@ exitCode:: ExitStatus.Success "./src/nochangefilewithemitspecificerror.ts" ], "version": "FakeTSVersion", - "size": 1621 + "size": 1651 } @@ -702,7 +720,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"composite":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"emitSignatures":[[2,"-12157283604-export declare class classC {\n prop1: number;\n}\n"],[4,"-3531856636-export {};\n"],[5,"-3531856636-export {};\n"]],"latestChangedDtsFile":"./src/class.d.ts","version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -823,24 +841,32 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/directuse.ts" + "./src/directuse.ts", + 16 ], - "Dts" + "DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/indirectuse.ts" + "./src/indirectuse.ts", + 16 ], - "Dts" + "DtsEmit" ] ], "emitSignatures": [ @@ -859,7 +885,7 @@ exitCode:: ExitStatus.Success ], "latestChangedDtsFile": "./src/class.d.ts", "version": "FakeTSVersion", - "size": 2201 + "size": 2217 } diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js b/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js index 61d770b672845..445c5855b4722 100644 --- a/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js +++ b/tests/baselines/reference/tsc/noEmit/multiFile/changes-with-initial-noEmit-incremental-declaration.js @@ -58,7 +58,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,4,3,5,6,7],"version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}",{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,17],[3,17],[5,17],[6,17],[7,17]],"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -166,32 +166,50 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/directuse.ts", - "Js | Dts" + [ + "./src/directuse.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/indirectuse.ts", - "Js | Dts" + [ + "./src/indirectuse.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/nochangefile.ts", - "Js | Dts" + [ + "./src/nochangefile.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./src/nochangefilewithemitspecificerror.ts", - "Js | Dts" + [ + "./src/nochangefilewithemitspecificerror.ts", + 17 + ], + "Js | DtsEmit" ] ], "version": "FakeTSVersion", - "size": 1592 + "size": 1622 } @@ -696,7 +714,7 @@ exitCode:: ExitStatus.Success //// [/src/project/tsconfig.tsbuildinfo] -{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[2,[4],3,[5]],"version":"FakeTSVersion"} +{"fileNames":["../../lib/lib.d.ts","./src/class.ts","./src/indirectclass.ts","./src/directuse.ts","./src/indirectuse.ts","./src/nochangefile.ts","./src/nochangefilewithemitspecificerror.ts"],"fileIdsList":[[3],[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"545032748-export class classC {\n prop = 1;\n}","signature":"-9508063301-export declare class classC {\n prop: number;\n}\n"},{"version":"6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","signature":"9337978648-import { classC } from './class';\nexport declare class indirectClass {\n classC: classC;\n}\n"},"-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;",{"version":"6714567633-export function writeLog(s: string) {\n}","signature":"8055010000-export declare function writeLog(s: string): void;\n"},{"version":"-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}","signature":"-5615417221-declare function someFunc(arguments: boolean, ...rest: any[]): void;\n","affectsGlobalScope":true}],"root":[[2,7]],"options":{"declaration":true},"referencedMap":[[4,1],[3,2],[5,1]],"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"affectedFilesPendingEmit":[[2,17],[4,16],[3,17],[5,16]],"version":"FakeTSVersion"} //// [/src/project/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -817,28 +835,36 @@ exitCode:: ExitStatus.Success ], "affectedFilesPendingEmit": [ [ - "./src/class.ts", - "Js | Dts" + [ + "./src/class.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/directuse.ts" + "./src/directuse.ts", + 16 ], - "Dts" + "DtsEmit" ], [ - "./src/indirectclass.ts", - "Js | Dts" + [ + "./src/indirectclass.ts", + 17 + ], + "Js | DtsEmit" ], [ [ - "./src/indirectuse.ts" + "./src/indirectuse.ts", + 16 ], - "Dts" + "DtsEmit" ] ], "version": "FakeTSVersion", - "size": 2006 + "size": 2022 } diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js new file mode 100644 index 0000000000000..78dd9aa846cf0 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js @@ -0,0 +1,80 @@ +3:: no-change-run +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../../lib/lib.d.ts": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js new file mode 100644 index 0000000000000..c6cd75c791aff --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -0,0 +1,1326 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/c.ts] +export const c = class { private p = 10; }; + +//// [/home/src/projects/project/d.ts] +export const d = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) +/home/src/projects/project/c.ts (used version) +/home/src/projects/project/d.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"affectedFilesPendingEmit":[2,3,4,5],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ], + [ + "./c.ts", + "Js" + ], + [ + "./d.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 859 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 home/src/projects/project/a.ts:1 + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17],[5,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./c.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./d.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1375 +} + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "declarationMap": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49],[3,49],[4,49],[5,49]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./b.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./c.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./d.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 932 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --declaration +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 home/src/projects/project/a.ts:1 + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "declaration": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/c.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.c = void 0; +exports.c = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/d.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.d = void 0; +exports.d = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };",{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1387 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "emitDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 1352 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 2 errors in 2 files. + +Errors Files + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true},"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,16],[4,16],[5,16]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 16 + ], + "DtsEmit" + ], + [ + [ + "./c.ts", + 16 + ], + "DtsEmit" + ], + [ + [ + "./d.ts", + 16 + ], + "DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1409 +} + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "declarationMap": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},"-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49],[3,48],[4,48],[5,48]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "version": "-17233149573-export const c = class { private p = 10; };", + "signature": "-17233149573-export const c = class { private p = 10; };" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./b.ts", + 48 + ], + "DtsEmit | DtsMap" + ], + [ + [ + "./c.ts", + 48 + ], + "DtsEmit | DtsMap" + ], + [ + [ + "./d.ts", + 48 + ], + "DtsEmit | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 1112 +} + + + +Change:: Fix the another +Input:: +//// [/home/src/projects/project/c.ts] +export const c = class { public p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "declarationMap": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/c.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/c.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts","./c.ts","./d.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9483521475-export const a = class { public p = 10; };","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"},{"version":"-15184115393-export const c = class { public p = 10; };","signature":"-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n"},"2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true},"affectedFilesPendingEmit":[[2,49],[3,48],[4,49],[5,48]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-9483521475-export const a = class { public p = 10; };", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "./c.ts": { + "original": { + "version": "-15184115393-export const c = class { public p = 10; };", + "signature": "-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-15184115393-export const c = class { public p = 10; };", + "signature": "-1507017290-export declare const c: {\n new (): {\n p: number;\n };\n};\n" + }, + "./d.ts": { + "version": "2523684124-export const d = class { private p = 10; };", + "signature": "2523684124-export const d = class { private p = 10; };" + } + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./a.ts", + "./b.ts", + "./c.ts", + "./d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./b.ts", + 48 + ], + "DtsEmit | DtsMap" + ], + [ + [ + "./c.ts", + 49 + ], + "Js | DtsEmit | DtsMap" + ], + [ + [ + "./d.ts", + 48 + ], + "DtsEmit | DtsMap" + ] + ], + "version": "FakeTSVersion", + "size": 1224 +} + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..2c1ecdcfa8529 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,735 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 933 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 821 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.d.ts] +export declare const a = "hello"; + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 847 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1199 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1163 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..5357908bb250d --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-with-incremental.js @@ -0,0 +1,639 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 908 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 777 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1092 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1056 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..890ebc65eb209 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,593 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 719 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 780 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 747 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 921 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 890 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..b8c3df7f8a2b6 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,519 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 700 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 710 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 884 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 853 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..fa160f804e05d --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,245 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors.js b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors.js new file mode 100644 index 0000000000000..aa82569939323 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/dts-errors.js @@ -0,0 +1,300 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..cd579888258c4 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,664 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-11417512537-export const a: number = \"hello\"" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 863 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 780 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 747 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 933 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 902 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..e25b3acb72c51 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors-with-incremental.js @@ -0,0 +1,593 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1311033573-const a: number = \"hello\"", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 842 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 710 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 894 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] file written with same contents +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 863 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors.js b/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors.js new file mode 100644 index 0000000000000..03e21e58c42b9 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/semantic-errors.js @@ -0,0 +1,277 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.js] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js new file mode 100644 index 0000000000000..c64d714e303a6 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules-discrepancies.js @@ -0,0 +1,72 @@ +5:: Introduce error +DtsSignature of ts files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" +} +Clean:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" +} +Dts Signature:: undefined +Incremental signature is neither dts signature nor file version for File:: ./b.ts +Incremental:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" +} +Clean:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" +} +Dts Signature:: undefined +7:: no-change-run +DtsSignature of files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" +} +Clean:: { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" +} +Dts Signature:: undefined +Incremental signature is neither dts signature nor file version for File:: ./b.ts +Incremental:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" +} +Clean:: { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" +} +Dts Signature:: undefined \ No newline at end of file diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..af2ab2c1637e3 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,648 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","signature":false,"affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":false},{"version":"-13368947479-export const b = 10;","signature":false}],"root":[2,3],"changeFileSet":[2,3,1],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": false, + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "changeFileSet": [ + "./a.ts", + "./b.ts", + "../../../../lib/lib.d.ts" + ], + "version": "FakeTSVersion", + "size": 770 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) +/home/src/projects/project/b.ts (computed .d.ts) +/lib/lib.d.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 849 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 816 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "changeFileSet": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 833 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], + "version": "FakeTSVersion", + "size": 846 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js new file mode 100644 index 0000000000000..9d051064d9d0f --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental-discrepancies.js @@ -0,0 +1,46 @@ +5:: Introduce error +DtsSignature of ts files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true +} +Clean:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": false, + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true +} +Dts Signature:: undefined +7:: no-change-run +DtsSignature of files: Incremental build have dts signature for ts files from emit so its not d.ts or same as file version +Incremental signature is neither dts signature nor file version for File:: ./a.ts +Incremental:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true +} +Clean:: { + "original": { + "version": "2464268576-const a = \"hello", + "signature": false, + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true +} +Dts Signature:: undefined \ No newline at end of file diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..362d2ab1206fa --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors-with-incremental.js @@ -0,0 +1,553 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","signature":false,"affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":false,"affectsGlobalScope":true}],"root":[2],"changeFileSet":[2,1],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": false, + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": false, + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "changeFileSet": [ + "./a.ts", + "../../../../lib/lib.d.ts" + ], + "version": "FakeTSVersion", + "size": 708 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) +/lib/lib.d.ts (used version) + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 741 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 710 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "changeFileSet": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 727 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + + +//// [/home/src/projects/project/a.js] +var a = "hello; + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], + "version": "FakeTSVersion", + "size": 740 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors.js b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors.js new file mode 100644 index 0000000000000..436bf39d063b1 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/multiFile/syntax-errors.js @@ -0,0 +1,280 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/project/a.js] +var a = "hello; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/changes-composite.js b/tests/baselines/reference/tsc/noEmit/outFile/changes-composite.js index fccce1b0aca1a..c5e7835dfe2a1 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/changes-composite.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/changes-composite.js @@ -932,7 +932,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -993,11 +993,11 @@ exitCode:: ExitStatus.Success "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", "latestChangedDtsFile": "./outFile.d.ts", "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 2067 + "size": 2064 } diff --git a/tests/baselines/reference/tsc/noEmit/outFile/changes-incremental-declaration.js b/tests/baselines/reference/tsc/noEmit/outFile/changes-incremental-declaration.js index 8f1f23c63cb36..22d2cdf78693b 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/changes-incremental-declaration.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/changes-incremental-declaration.js @@ -926,7 +926,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -985,11 +985,11 @@ exitCode:: ExitStatus.Success ] ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 1516 + "size": 1513 } diff --git a/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-composite.js b/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-composite.js index 2800317eec331..1d61ea8d75c16 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-composite.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-composite.js @@ -59,7 +59,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -118,11 +118,11 @@ exitCode:: ExitStatus.Success ] ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 1514 + "size": 1511 } @@ -523,7 +523,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"outSignature":"-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -584,11 +584,11 @@ exitCode:: ExitStatus.Success "outSignature": "-1966987419-declare module \"src/class\" {\n export class classC {\n prop1: number;\n }\n}\ndeclare module \"src/indirectClass\" {\n import { classC } from \"src/class\";\n export class indirectClass {\n classC: classC;\n }\n}\ndeclare module \"src/directUse\" { }\ndeclare module \"src/indirectUse\" { }\ndeclare module \"src/noChangeFile\" {\n export function writeLog(s: string): void;\n}\ndeclare function someFunc(arguments: boolean, ...rest: any[]): void;\n", "latestChangedDtsFile": "./outFile.d.ts", "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 2067 + "size": 2064 } diff --git a/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js b/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js index 2529fa735c64f..2a01de3cdc67c 100644 --- a/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js +++ b/tests/baselines/reference/tsc/noEmit/outFile/changes-with-initial-noEmit-incremental-declaration.js @@ -60,7 +60,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -119,11 +119,11 @@ exitCode:: ExitStatus.Success ] ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 1516 + "size": 1513 } @@ -520,7 +520,7 @@ exitCode:: ExitStatus.Success //// [/src/outFile.tsbuildinfo] -{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../lib/lib.d.ts","./project/src/class.ts","./project/src/indirectclass.ts","./project/src/directuse.ts","./project/src/indirectuse.ts","./project/src/nochangefile.ts","./project/src/nochangefilewithemitspecificerror.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","545032748-export class classC {\n prop = 1;\n}","6324910780-import { classC } from './class';\nexport class indirectClass {\n classC = new classC();\n}","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","-8953710208-import { indirectClass } from './indirectClass';\nnew indirectClass().classC.prop;","6714567633-export function writeLog(s: string) {\n}","-19339541508-function someFunc(arguments: boolean, ...rest: any[]) {\n}"],"root":[[2,7]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[7,[{"start":18,"length":18,"messageText":"Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.","category":1,"code":2396,"skippedOn":"noEmit"}]]],"pendingEmit":17,"version":"FakeTSVersion"} //// [/src/outFile.tsbuildinfo.readable.baseline.txt] { @@ -579,11 +579,11 @@ exitCode:: ExitStatus.Success ] ], "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 1516 + "size": 1513 } diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js new file mode 100644 index 0000000000000..dedd245a71f22 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files-discrepancies.js @@ -0,0 +1,64 @@ +3:: no-change-run +Clean build will not have declaration and declarationMap +Incremental build will have previous buildInfo so will have dts and declaration and declarationMap +TsBuild info text without affectedFilesPendingEmit:: /home/src/projects/outfile.tsbuildinfo.readable.baseline.txt:: +CleanBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} +IncrementalBuild: +{ + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion" +} \ No newline at end of file diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js new file mode 100644 index 0000000000000..690283be6b9ae --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -0,0 +1,1116 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/c.ts] +export const c = class { private p = 10; }; + +//// [/home/src/projects/project/d.ts] +export const d = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 881 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: With declaration enabled noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 home/src/projects/project/a.ts:1 + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 1362 +} + + + +Change:: With declaration and declarationMap noEmit - Should report errors +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 home/src/projects/project/a.ts:1 + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "declarationMap": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit | DtsMap", + 49 + ], + "version": "FakeTSVersion", + "size": 1384 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Dts Emit with error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --declaration +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 3 errors in 3 files. + +Errors Files + 1 home/src/projects/project/a.ts:1 + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "declaration": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); +define("c", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.c = void 0; + exports.c = /** @class */ (function () { + function class_2() { + this.p = 10; + } + return class_2; + }()); +}); +define("d", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.d = void 0; + exports.d = /** @class */ (function () { + function class_3() { + this.p = 10; + } + return class_3; + }()); +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1345 +} + + + +Change:: Fix the error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { public p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 880 +} + + + +Change:: With declaration enabled noEmit +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 2 errors in 2 files. + +Errors Files + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 1215 +} + + + +Change:: With declaration and declarationMap noEmit +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap +home/src/projects/project/c.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const c = class { private p = 10; }; +   ~ + +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 2 errors in 2 files. + +Errors Files + 1 home/src/projects/project/c.ts:1 + 1 home/src/projects/project/d.ts:1 +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "declarationMap": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-17233149573-export const c = class { private p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[4,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]],[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-17233149573-export const c = class { private p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/c.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ], + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit | DtsMap", + 49 + ], + "version": "FakeTSVersion", + "size": 1237 +} + + + +Change:: Fix the another +Input:: +//// [/home/src/projects/project/c.ts] +export const c = class { public p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit --declaration --declarationMap +home/src/projects/project/d.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const d = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/d.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts", + "/home/src/projects/project/c.ts", + "/home/src/projects/project/d.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "declaration": true, + "declarationMap": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts +/home/src/projects/project/c.ts +/home/src/projects/project/d.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts","./project/c.ts","./project/d.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9483521475-export const a = class { public p = 10; };","-13368947479-export const b = 10;","-15184115393-export const c = class { public p = 10; };","2523684124-export const d = class { private p = 10; };"],"root":[[2,5]],"options":{"declaration":true,"declarationMap":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[5,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":49,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9483521475-export const a = class { public p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;", + "./project/c.ts": "-15184115393-export const c = class { public p = 10; };", + "./project/d.ts": "2523684124-export const d = class { private p = 10; };" + }, + "root": [ + [ + [ + 2, + 5 + ], + [ + "./project/a.ts", + "./project/b.ts", + "./project/c.ts", + "./project/d.ts" + ] + ] + ], + "options": { + "declaration": true, + "declarationMap": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/d.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit | DtsMap", + 49 + ], + "version": "FakeTSVersion", + "size": 1090 +} + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..e775985e62a97 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,647 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 918 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 730 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.d.ts] +declare module "a" { + export const a = "hello"; +} +declare module "b" { + export const b = 10; +} + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 713 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 918 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 901 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..3c6f932c43fa1 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-with-incremental.js @@ -0,0 +1,551 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 843 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 655 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 638 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 843 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 826 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..d8d5f00ec7dc2 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,541 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 729 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 714 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 694 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 729 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 709 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..3fdea8ba48ccc --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,450 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 655 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 639 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 619 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 655 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 635 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..15c59ddf864de --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,256 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/dts-errors.js b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors.js new file mode 100644 index 0000000000000..d1bbaee52a143 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/dts-errors.js @@ -0,0 +1,310 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..922f4809e5563 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,604 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 873 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 714 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 694 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 873 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 853 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..544e81abdadd7 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors-with-incremental.js @@ -0,0 +1,524 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 797 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 639 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 619 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 797 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] file written with same contents +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 777 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors.js b/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors.js new file mode 100644 index 0000000000000..d3c57be2ae283 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/semantic-errors.js @@ -0,0 +1,288 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.js] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..9cad28bb9c3e5 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,584 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[2,3,1],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "./project/a.ts", + "./project/b.ts", + "../../../lib/lib.d.ts" + ], + "version": "FakeTSVersion", + "size": 715 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 714 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 694 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 711 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "../../../lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ], + [ + "./project/b.ts", + "not cached or not changed" + ] + ], + "version": "FakeTSVersion", + "size": 728 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..864f1fdff4f37 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors-with-incremental.js @@ -0,0 +1,490 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[2,1],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "./project/a.ts", + "../../../lib/lib.d.ts" + ], + "version": "FakeTSVersion", + "size": 638 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 639 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 619 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 636 +} + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + +//// [/home/src/projects/outFile.js] +var a = "hello; + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "../../../lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ] + ], + "version": "FakeTSVersion", + "size": 651 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors.js b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors.js new file mode 100644 index 0000000000000..668a01c6728c4 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmit/outFile/syntax-errors.js @@ -0,0 +1,291 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + +//// [/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Fix error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit after fixing error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +exitCode:: ExitStatus.Success +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Introduce error +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + + + +Change:: Emit when error +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + +//// [/home/src/projects/outFile.js] +var a = "hello; + + + + +Change:: no-change-run +Input:: + + +Output:: +/lib/tsc -p /home/src/projects/project --noEmit +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + + +Found 1 error in home/src/projects/project/a.ts:1 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsGenerated +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "noEmit": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/lib/lib.d.ts +/home/src/projects/project/a.ts + + diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js new file mode 100644 index 0000000000000..847f269056ac9 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration-with-incremental.js @@ -0,0 +1,420 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17],[4,17]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "emitDiagnosticsPerFile": [ + [ + "../src/main.ts", + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "../shared/types/db.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "../src/main.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "../src/other.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1182 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "original": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + }, + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1114 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration.js new file mode 100644 index 0000000000000..29f4547d50b31 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-declaration.js @@ -0,0 +1,218 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "declaration": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] +export {}; + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.d.ts] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/other.d.ts] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file written with same contents diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..8cf43186500a1 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors-with-incremental.js @@ -0,0 +1,339 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/user/username/projects/noemitonerror/shared/types/db.ts (used version) +/user/username/projects/noemitonerror/src/main.ts (used version) +/user/username/projects/noemitonerror/src/other.ts (used version) + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 940 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},"9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1044 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors.js new file mode 100644 index 0000000000000..7c6569944a212 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/dts-errors.js @@ -0,0 +1,182 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outDir": "./dev-build", + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +console.log("hi"); + + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file written with same contents + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/noEmitOnError/dev-build/shared/types/db.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents +//// [/user/username/projects/noEmitOnError/dev-build/src/other.js] file written with same contents diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration-with-incremental.js index 413b389b6667d..1b1931ad5e845 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration-with-incremental.js @@ -222,7 +222,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration.js index 671b31139b20e..dc759510f7ae6 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-declaration.js @@ -109,7 +109,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-incremental.js index eadc938dee4ed..6d38b41472fd9 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors-with-incremental.js @@ -218,7 +218,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors.js index 6c4bfefe3fcaa..3381fd82bb2b4 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/semantic-errors.js @@ -106,7 +106,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration-with-incremental.js index 59b068da532fd..c05f9443ea587 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration-with-incremental.js @@ -212,7 +212,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration.js index ca9035bd7d2a1..f76bfe64c3d89 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-declaration.js @@ -112,7 +112,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-incremental.js index d9571ff015651..c035a9f9bdf89 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors-with-incremental.js @@ -208,7 +208,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors.js b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors.js index 2e3dafb7b21ea..eee6ec673fdf7 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors.js +++ b/tests/baselines/reference/tsc/noEmitOnError/multiFile/syntax-errors.js @@ -109,7 +109,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js new file mode 100644 index 0000000000000..d3cadfee88a02 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration-with-incremental.js @@ -0,0 +1,344 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "declaration": true, + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./noemitonerror/src/main.ts", + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 1124 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 926 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration.js new file mode 100644 index 0000000000000..3b3cabb3db733 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-declaration.js @@ -0,0 +1,219 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "declaration": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + + +Found 1 error in src/main.ts:2 + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/dev-build.d.ts] file written with same contents +//// [/user/username/projects/dev-build.js] file written with same contents diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..fdfbee667d69a --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors-with-incremental.js @@ -0,0 +1,286 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "incremental": true, + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 915 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + + +//// [/user/username/projects/dev-build.js] file written with same contents +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 907 +} + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + + diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors.js new file mode 100644 index 0000000000000..e75a254a21c81 --- /dev/null +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/dts-errors.js @@ -0,0 +1,181 @@ +currentDirectory:: /user/username/projects/noEmitOnError useCaseSensitiveFileNames: false +Input:: +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + +//// [/user/username/projects/noEmitOnError/shared/types/db.ts] +export interface A { + name: string; +} + + +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + +//// [/user/username/projects/noEmitOnError/src/other.ts] +console.log("hi"); +export { } + + +//// [/user/username/projects/noEmitOnError/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../dev-build.js", + "module": "amd", + "noEmitOnError": true + } +} + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/dev-build.js] file written with same contents + + +Change:: Fix error +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/dev-build.js] file written with same contents + + +Change:: no-change-run +Input:: + + +Output:: +/a/lib/tsc +exitCode:: ExitStatus.Success +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + + +//// [/user/username/projects/dev-build.js] file written with same contents diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration-with-incremental.js index 161b010072f05..4144576918f75 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration-with-incremental.js @@ -185,7 +185,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration.js index 66c311cfecd4c..cd44f1f92dcf7 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-declaration.js @@ -112,7 +112,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-incremental.js index d003357320399..eb206cb4af378 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors-with-incremental.js @@ -181,7 +181,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors.js index 489e348d0140d..b0f2cb9ba3da0 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/semantic-errors.js @@ -109,7 +109,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration-with-incremental.js index 355855188eecf..7f6ecf3ec8b40 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration-with-incremental.js @@ -175,7 +175,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration.js index 02556588614fd..70144f43bea42 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-declaration.js @@ -115,7 +115,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-incremental.js index 078d06e48f93b..ab83767df9dd8 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-incremental.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors-with-incremental.js @@ -171,7 +171,7 @@ No shapes updated in the builder:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors.js b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors.js index 601e358318374..fa72048f8d5bf 100644 --- a/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors.js +++ b/tests/baselines/reference/tsc/noEmitOnError/outFile/syntax-errors.js @@ -112,7 +112,7 @@ Program files:: -Change:: incremental-declaration-doesnt-change +Change:: Fix error Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] import { A } from "../shared/types/db"; diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-declaration-=-false.js b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-declaration-=-false.js index 64ac0c89f1e1a..ab744c69527e5 100644 --- a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-declaration-=-false.js +++ b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-declaration-=-false.js @@ -94,11 +94,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../a.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./a.d.ts", diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-exist.js b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-exist.js index 3675089c127a7..15f94406b70a4 100644 --- a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-exist.js +++ b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-exist.js @@ -100,11 +100,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../a.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./a.d.ts", diff --git a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-have-composite.js b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-have-composite.js index 7f7d445a2bbd5..3a8191e97e687 100644 --- a/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-have-composite.js +++ b/tests/baselines/reference/tsc/projectReferencesConfig/errors-when-the-referenced-project-doesnt-have-composite.js @@ -115,11 +115,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); "semanticDiagnosticsPerFile": [ [ "../../lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "../b.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./b.d.ts", diff --git a/tests/baselines/reference/tscWatch/moduleResolution/alternateResult.js b/tests/baselines/reference/tscWatch/moduleResolution/alternateResult.js index d150b7613d9d6..c9a1190333dc7 100644 --- a/tests/baselines/reference/tscWatch/moduleResolution/alternateResult.js +++ b/tests/baselines/reference/tscWatch/moduleResolution/alternateResult.js @@ -453,19 +453,19 @@ Object.defineProperty(exports, "__esModule", { value: true }); "semanticDiagnosticsPerFile": [ [ "../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1360,23 +1360,23 @@ File '/package.json' does not exist according to earlier cached lookups. "semanticDiagnosticsPerFile": [ [ "../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1654,27 +1654,27 @@ Elapsed:: *ms DirectoryWatcher:: Close:: WatchInfo: /home/src/projects/node_modu "semanticDiagnosticsPerFile": [ [ "../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -1992,23 +1992,23 @@ Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/node_modu "semanticDiagnosticsPerFile": [ [ "../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo2/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", @@ -2289,19 +2289,19 @@ FileWatcher:: Close:: WatchInfo: /home/src/projects/project/node_modules/foo2/in "semanticDiagnosticsPerFile": [ [ "../../../../a/lib/lib.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/foo/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./node_modules/@types/bar/index.d.ts", - "not cached" + "not cached or not changed" ], [ "./index.mts", - "not cached" + "not cached or not changed" ] ], "version": "FakeTSVersion", diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..85fbaf20fada4 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,805 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 935 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17],[3,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ], + [ + [ + "./b.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 823 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 849 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/a.d.ts] +export declare const a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + +//// [/home/src/projects/project/b.d.ts] +export declare const b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1201 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1165 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..2900fea6b2905 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-with-incremental.js @@ -0,0 +1,711 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 910 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 779 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "version": "FakeTSVersion", + "size": 743 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[2,17]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "./a.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1094 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"options":{"declaration":true},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "options": { + "declaration": true + }, + "emitDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 1058 +} + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..fc207d0e61105 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,681 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-9502176711-export const a = class { private p = 10; };" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 721 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 782 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 749 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 923 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-9502176711-export const a = class { private p = 10; };","signature":"-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "-9502176711-export const a = class { private p = 10; };", + "signature": "-7147472585-export declare const a: {\n new (): {\n p: number;\n };\n};\n(13,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 892 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..a98b6580da090 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,609 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "7752727223-const a = class { private p = 10; };", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 702 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 743 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 712 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 886 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"7752727223-const a = class { private p = 10; };","signature":"-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + }, + "version": "7752727223-const a = class { private p = 10; };", + "signature": "-6162671385-declare const a: {\n new (): {\n p: number;\n };\n};\n(6,1)Error4094: Property 'p' of exported class expression may not be private or protected.", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 855 +} + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..3ef18573710b5 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,378 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors.js new file mode 100644 index 0000000000000..b684b5e5ac509 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/dts-errors.js @@ -0,0 +1,416 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + +//// [/home/src/projects/project/a.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..64dfa7a7f21c8 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,732 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-11417512537-export const a: number = \"hello\"" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 865 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) +/home/src/projects/project/b.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 782 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},"-13368947479-export const b = 10;"],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 749 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 935 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-11417512537-export const a: number = \"hello\"","signature":"-3045186137-export declare const a: number;\n"},"-13368947479-export const b = 10;"],"root":[2,3],"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "version": "-11417512537-export const a: number = \"hello\"", + "signature": "-3045186137-export declare const a: number;\n" + }, + "./b.ts": { + "version": "-13368947479-export const b = 10;", + "signature": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 904 +} + +//// [/home/src/projects/project/a.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..13ef608541e61 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors-with-incremental.js @@ -0,0 +1,663 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1311033573-const a: number = \"hello\"", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 844 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 743 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 712 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 896 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"1311033573-const a: number = \"hello\"","signature":"1093425381-declare const a: number;\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + }, + "version": "1311033573-const a: number = \"hello\"", + "signature": "1093425381-declare const a: number;\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 865 +} + +//// [/home/src/projects/project/a.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors.js new file mode 100644 index 0000000000000..156677860decb --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/semantic-errors.js @@ -0,0 +1,390 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (used version) + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..5460a4b100d52 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,716 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","signature":false,"affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":false},{"version":"-13368947479-export const b = 10;","signature":false}],"root":[2,3],"changeFileSet":[1,2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": false, + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": false + }, + "version": "-14000546910-export const a = \"hello" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": false + }, + "version": "-13368947479-export const b = 10;" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "changeFileSet": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "version": "FakeTSVersion", + "size": 772 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"affectedFilesPendingEmit":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ], + [ + "./b.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 851 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (computed .d.ts) +/home/src/projects/project/b.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-16641552193-export const a = \"hello\";","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-16641552193-export const a = \"hello\";", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "version": "FakeTSVersion", + "size": 818 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello"; + + +//// [/home/src/projects/project/b.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.b = void 0; +exports.b = 10; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "changeFileSet": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 835 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts","./b.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"-14000546910-export const a = \"hello","signature":"-2692717255-export declare const a = \"hello\";\n"},{"version":"-13368947479-export const b = 10;","signature":"-3829150557-export declare const b = 10;\n"}],"root":[2,3],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts", + "./b.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "version": "-14000546910-export const a = \"hello", + "signature": "-2692717255-export declare const a = \"hello\";\n" + }, + "./b.ts": { + "original": { + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + }, + "version": "-13368947479-export const b = 10;", + "signature": "-3829150557-export declare const b = 10;\n" + } + }, + "root": [ + [ + 2, + "./a.ts" + ], + [ + 3, + "./b.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], + "version": "FakeTSVersion", + "size": 848 +} + +//// [/home/src/projects/project/a.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..edc65a3406bf8 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors-with-incremental.js @@ -0,0 +1,623 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","signature":false,"affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":false,"affectsGlobalScope":true}],"root":[2],"changeFileSet":[1,2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": false, + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": false, + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "changeFileSet": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 710 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"affectedFilesPendingEmit":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "affectedFilesPendingEmit": [ + [ + "./a.ts", + "Js" + ] + ], + "version": "FakeTSVersion", + "size": 743 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"3528887741-const a = \"hello\";","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "3528887741-const a = \"hello\";", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "version": "FakeTSVersion", + "size": 712 +} + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "changeFileSet": [ + "./a.ts" + ], + "version": "FakeTSVersion", + "size": 729 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/tsconfig.tsbuildinfo] +{"fileNames":["../../../../a/lib/lib.d.ts","./a.ts"],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},{"version":"2464268576-const a = \"hello","signature":"-5460434953-declare const a = \"hello\";\n","affectsGlobalScope":true}],"root":[2],"semanticDiagnosticsPerFile":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/project/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../a/lib/lib.d.ts", + "./a.ts" + ], + "fileInfos": { + "../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "./a.ts": { + "original": { + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + }, + "version": "2464268576-const a = \"hello", + "signature": "-5460434953-declare const a = \"hello\";\n", + "affectsGlobalScope": true + } + }, + "root": [ + [ + 2, + "./a.ts" + ] + ], + "semanticDiagnosticsPerFile": [ + [ + "./a.ts", + "not cached or not changed" + ] + ], + "version": "FakeTSVersion", + "size": 742 +} + +//// [/home/src/projects/project/a.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors.js b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors.js new file mode 100644 index 0000000000000..76c81a0665104 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/multiFile/syntax-errors.js @@ -0,0 +1,391 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/a/lib/lib.d.ts (used version) +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": {} +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/project/a.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +Shape signatures in builder refreshed for:: +/home/src/projects/project/a.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..69d678475c081 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental-as-modules.js @@ -0,0 +1,721 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 920 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 732 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 715 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + +//// [/home/src/projects/outFile.d.ts] +declare module "a" { + export const a = "hello"; +} +declare module "b" { + export const b = 10; +} + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 920 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"declaration":true,"module":2,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":13,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "declaration": true, + "module": 2, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 903 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental.js new file mode 100644 index 0000000000000..77e8634b377cc --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-with-incremental.js @@ -0,0 +1,625 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 845 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 657 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 640 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 845 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"declaration":true,"outFile":"./outFile.js"},"emitDiagnosticsPerFile":[[2,[{"start":6,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "declaration": true, + "outFile": "./outFile.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 828 +} + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js new file mode 100644 index 0000000000000..1b2a8617fe267 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental-as-modules.js @@ -0,0 +1,633 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 731 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 716 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 696 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 731 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-9502176711-export const a = class { private p = 10; };","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-9502176711-export const a = class { private p = 10; };", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 711 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js new file mode 100644 index 0000000000000..e7156419f19ec --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled-with-incremental.js @@ -0,0 +1,542 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 657 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 641 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 621 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 657 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","7752727223-const a = class { private p = 10; };"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "7752727223-const a = class { private p = 10; };" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 637 +} + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled.js new file mode 100644 index 0000000000000..5f85396fb1306 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors-without-dts-enabled.js @@ -0,0 +1,388 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors.js b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors.js new file mode 100644 index 0000000000000..ec750180d6af2 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/dts-errors.js @@ -0,0 +1,424 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + +//// [/home/src/projects/outFile.d.ts] +declare const a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = class { private p = 10; }; + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] +var a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "declaration": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +1 const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "declaration": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..1f04a55c3f391 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors-with-incremental-as-modules.js @@ -0,0 +1,676 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 875 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 716 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 696 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 875 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-11417512537-export const a: number = \"hello\"","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":13,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-11417512537-export const a: number = \"hello\"", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 13, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 855 +} + +//// [/home/src/projects/outFile.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:14 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 export const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors-with-incremental.js new file mode 100644 index 0000000000000..d7a65071871ef --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors-with-incremental.js @@ -0,0 +1,596 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 799 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 641 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 621 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 799 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","1311033573-const a: number = \"hello\""],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[[2,[{"start":6,"length":1,"code":2322,"category":1,"messageText":"Type 'string' is not assignable to type 'number'."}]]],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "1311033573-const a: number = \"hello\"" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "./project/a.ts", + [ + { + "start": 6, + "length": 1, + "code": 2322, + "category": 1, + "messageText": "Type 'string' is not assignable to type 'number'." + } + ] + ] + ], + "version": "FakeTSVersion", + "size": 779 +} + +//// [/home/src/projects/outFile.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors.js b/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors.js new file mode 100644 index 0000000000000..43c0642912f7b --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/semantic-errors.js @@ -0,0 +1,400 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a: number = "hello" + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] file written with same contents + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. + +1 const a: number = "hello" +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js new file mode 100644 index 0000000000000..c536f7f6025d6 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental-as-modules.js @@ -0,0 +1,656 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + +//// [/home/src/projects/project/b.ts] +export const b = 10; + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[1,2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "version": "FakeTSVersion", + "size": 717 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/b.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 716 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-16641552193-export const a = \"hello\";","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-16641552193-export const a = \"hello\";", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 696 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello"; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +export const a = "hello + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 713 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts","./project/b.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-14000546910-export const a = \"hello","-13368947479-export const b = 10;"],"root":[2,3],"options":{"module":2,"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2,3],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts", + "./project/b.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "-14000546910-export const a = \"hello", + "./project/b.ts": "-13368947479-export const b = 10;" + }, + "root": [ + [ + 2, + "./project/a.ts" + ], + [ + 3, + "./project/b.ts" + ] + ], + "options": { + "module": 2, + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "../../../a/lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ], + [ + "./project/b.ts", + "not cached or not changed" + ] + ], + "version": "FakeTSVersion", + "size": 730 +} + +//// [/home/src/projects/outFile.js] +define("a", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = "hello; +}); +define("b", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.b = void 0; + exports.b = 10; +}); + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "module": "amd", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:24 - error TS1002: Unterminated string literal. + +1 export const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts", + "/home/src/projects/project/b.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "module": 2, + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts +/home/src/projects/project/b.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental.js b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental.js new file mode 100644 index 0000000000000..95b55d1534e51 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors-with-incremental.js @@ -0,0 +1,562 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[1,2],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 640 +} + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "pendingEmit": [ + "Js", + false + ], + "version": "FakeTSVersion", + "size": 641 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","3528887741-const a = \"hello\";"],"root":[2],"options":{"outFile":"./outFile.js"},"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "3528887741-const a = \"hello\";" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "version": "FakeTSVersion", + "size": 621 +} + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"changeFileSet":[2],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "changeFileSet": [ + "./project/a.ts" + ], + "version": "FakeTSVersion", + "size": 638 +} + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./project/a.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","2464268576-const a = \"hello"],"root":[2],"options":{"outFile":"./outFile.js"},"semanticDiagnosticsPerFile":[1,2],"version":"FakeTSVersion"} + +//// [/home/src/projects/outFile.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./project/a.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./project/a.ts": "2464268576-const a = \"hello" + }, + "root": [ + [ + 2, + "./project/a.ts" + ] + ], + "options": { + "outFile": "./outFile.js" + }, + "semanticDiagnosticsPerFile": [ + [ + "../../../a/lib/lib.d.ts", + "not cached or not changed" + ], + [ + "./project/a.ts", + "not cached or not changed" + ] + ], + "version": "FakeTSVersion", + "size": 653 +} + +//// [/home/src/projects/outFile.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "incremental": true, + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "incremental": true, + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors.js b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors.js new file mode 100644 index 0000000000000..1cb36caf87d54 --- /dev/null +++ b/tests/baselines/reference/tscWatch/noEmit/outFile/syntax-errors.js @@ -0,0 +1,399 @@ +currentDirectory:: / useCaseSensitiveFileNames: false +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + +//// [/a/lib/lib.d.ts] +/// +interface Boolean {} +interface Function {} +interface CallableFunction {} +interface NewableFunction {} +interface IArguments {} +interface Number { toExponential: any; } +interface Object {} +interface RegExp {} +interface String { charAt: any; } +interface Array { length: number; [n: number]: T; } +interface ReadonlyArray {} +declare const console: { log(msg: any): void; }; + + +/a/lib/tsc.js -p /home/src/projects/project -w +Output:: +>> Screen clear +[HH:MM:SS AM] Starting compilation in watch mode... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + +PolledWatches:: +/home/src/projects/node_modules/@types: *new* + {"pollingInterval":500} +/home/src/projects/project/node_modules/@types: *new* + {"pollingInterval":500} + +FsWatches:: +/a/lib/lib.d.ts: *new* + {} +/home/src/projects/project/a.ts: *new* + {} +/home/src/projects/project/tsconfig.json: *new* + {} + +FsWatchesRecursive:: +/home/src/projects/project: *new* + {} + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Not +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Fix error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello"; + + +Timeout callback:: count: 1 +1: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +1: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +2: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +2: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] +var a = "hello"; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run after fixing error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +Semantic diagnostics in builder refreshed for:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Introduce error + +Input:: +//// [/home/src/projects/project/a.ts] +const a = "hello + + +Timeout callback:: count: 1 +4: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +4: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: Emit when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js" + } +} + + +Timeout callback:: count: 1 +5: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +5: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/home/src/projects/outFile.js] +var a = "hello; + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: no Emit run when error + +Input:: +//// [/home/src/projects/project/tsconfig.json] +{ + "compilerOptions": { + "outFile": "../outFile.js", + "noEmit": true + } +} + + +Timeout callback:: count: 1 +6: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +6: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +home/src/projects/project/a.ts:1:17 - error TS1002: Unterminated string literal. + +1 const a = "hello +    + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/home/src/projects/project/a.ts" +] +Program options: { + "outFile": "/home/src/projects/outFile.js", + "noEmit": true, + "project": "/home/src/projects/project", + "watch": true, + "configFilePath": "/home/src/projects/project/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/home/src/projects/project/a.ts + +No cached semantic diagnostics in the builder:: + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js index 0b6c88400ba18..e547ba209f917 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration-with-incremental.js @@ -213,7 +213,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -376,7 +376,24 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -385,10 +402,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -535,10 +552,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -546,7 +563,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -555,10 +572,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -687,10 +704,350 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","signature":"-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected."},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"affectedFilesPendingEmit":[[3,17]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "../src/other.ts": { + "original": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + }, + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "emitDiagnosticsPerFile": [ + [ + "../src/main.ts", + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "affectedFilesPendingEmit": [ + [ + [ + "../src/main.ts", + 17 + ], + "Js | DtsEmit" + ] + ], + "version": "FakeTSVersion", + "size": 1423 +} + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},{"version":"9084524823-console.log(\"hi\");\nexport { }\n","signature":"-3531856636-export {};\n"}],"root":[[2,4]],"options":{"declaration":true,"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "original": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + }, + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "-3531856636-export {};\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1114 +} + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js index eb78ea36d043e..c4496aaca4f47 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-declaration.js @@ -130,7 +130,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -218,7 +218,24 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -227,10 +244,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -282,10 +299,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -293,7 +310,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -302,10 +319,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -359,10 +376,177 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.d.ts] +export declare const a: { + new (): { + p: number; + }; +}; + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "declaration": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-incremental.js index 31c5f0c0ace3a..eede79b45059c 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError-with-incremental.js @@ -210,7 +210,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -353,7 +353,24 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -362,10 +379,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -506,10 +523,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -517,7 +534,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -526,10 +543,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -651,10 +668,303 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","signature":"-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected."},"9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "version": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "signature": "-8511871557-export declare const a: {\n new (): {\n p: number;\n };\n};\n(53,1)Error4094: Property 'p' of exported class expression may not be private or protected." + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1144 +} + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo] +{"fileNames":["../../../../../a/lib/lib.d.ts","../shared/types/db.ts","../src/main.ts","../src/other.ts"],"fileIdsList":[[2]],"fileInfos":[{"version":"3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-5014788164-export interface A {\n name: string;\n}\n",{"version":"-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","signature":"4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n"},"9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[[3,1]],"version":"FakeTSVersion"} + +//// [/user/username/projects/noEmitOnError/dev-build/tsconfig.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../../../a/lib/lib.d.ts", + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ], + "fileIdsList": [ + [ + "../shared/types/db.ts" + ] + ], + "fileInfos": { + "../../../../../a/lib/lib.d.ts": { + "original": { + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "version": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "signature": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "affectsGlobalScope": true + }, + "../shared/types/db.ts": { + "version": "-5014788164-export interface A {\n name: string;\n}\n", + "signature": "-5014788164-export interface A {\n name: string;\n}\n" + }, + "../src/main.ts": { + "original": { + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "version": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "signature": "4346604020-export declare const a: {\n new (): {\n p: number;\n };\n};\n" + }, + "../src/other.ts": { + "version": "9084524823-console.log(\"hi\");\nexport { }\n", + "signature": "9084524823-console.log(\"hi\");\nexport { }\n" + } + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "../shared/types/db.ts", + "../src/main.ts", + "../src/other.ts" + ] + ] + ], + "options": { + "noEmitOnError": true, + "outDir": "./" + }, + "referencedMap": { + "../src/main.ts": [ + "../shared/types/db.ts" + ] + }, + "version": "FakeTSVersion", + "size": 1044 +} + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError.js b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError.js index 16ee93653c6aa..eb6a75a8d78b4 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/multiFile/noEmitOnError.js @@ -128,7 +128,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -201,7 +201,24 @@ Shape signatures in builder refreshed for:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -210,10 +227,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -264,10 +281,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -275,7 +292,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -284,10 +301,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -339,10 +356,163 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.a = void 0; +exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; +}()); + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/noEmitOnError/dev-build/src/main.js] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outDir": "/user/username/projects/noEmitOnError/dev-build", + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/user/username/projects/noEmitOnError/src/main.ts + +Shape signatures in builder refreshed for:: +/user/username/projects/noemitonerror/src/main.ts (computed .d.ts) + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js index 6dabdc7b179e6..b8d246c4cbba8 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration-with-incremental.js @@ -175,7 +175,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -305,7 +305,24 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -314,10 +331,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -431,10 +448,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -442,7 +459,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -451,10 +468,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -563,10 +580,304 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"emitDiagnosticsPerFile":[[3,[{"start":53,"length":1,"messageText":"Property 'p' of exported class expression may not be private or protected.","category":1,"code":4094}]]],"pendingEmit":17,"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "emitDiagnosticsPerFile": [ + [ + "./noemitonerror/src/main.ts", + [ + { + "start": 53, + "length": 1, + "messageText": "Property 'p' of exported class expression may not be private or protected.", + "category": 1, + "code": 4094 + } + ] + ] + ], + "pendingEmit": [ + "Js | DtsEmit", + 17 + ], + "version": "FakeTSVersion", + "size": 1124 +} + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"declaration":true,"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "declaration": true, + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 926 +} + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js index 74af0a1cb605d..58f7b4019b9b4 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-declaration.js @@ -128,7 +128,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -217,7 +217,24 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -226,10 +243,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -284,10 +301,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -295,7 +312,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -304,10 +321,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -375,10 +392,204 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +src/main.ts:2:14 - error TS4094: Property 'p' of exported class expression may not be private or protected. + +2 export const a = class { private p = 10; }; +   ~ + +[HH:MM:SS AM] Found 1 error. Watching for file changes. + + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + +//// [/user/username/projects/dev-build.d.ts] +declare module "shared/types/db" { + export interface A { + name: string; + } +} +declare module "src/main" { + export const a: { + new (): { + p: number; + }; + }; +} +declare module "src/other" { + export {}; +} + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "declaration": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-incremental.js b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-incremental.js index f3567ce6e7ca7..cce784de66baf 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-incremental.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError-with-incremental.js @@ -172,7 +172,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -288,7 +288,24 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -297,10 +314,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -412,10 +429,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -423,7 +440,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -432,10 +449,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -541,10 +558,260 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "5099365167-import { A } from \"../shared/types/db\";\nexport const a = class { private p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 915 +} + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.tsbuildinfo] +{"fileNames":["../../../a/lib/lib.d.ts","./noemitonerror/shared/types/db.ts","./noemitonerror/src/main.ts","./noemitonerror/src/other.ts"],"fileInfos":["3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };","-5014788164-export interface A {\n name: string;\n}\n","-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n","9084524823-console.log(\"hi\");\nexport { }\n"],"root":[[2,4]],"options":{"module":2,"noEmitOnError":true,"outFile":"./dev-build.js"},"version":"FakeTSVersion"} + +//// [/user/username/projects/dev-build.tsbuildinfo.readable.baseline.txt] +{ + "fileNames": [ + "../../../a/lib/lib.d.ts", + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ], + "fileInfos": { + "../../../a/lib/lib.d.ts": "3858781397-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ndeclare const console: { log(msg: any): void; };", + "./noemitonerror/shared/types/db.ts": "-5014788164-export interface A {\n name: string;\n}\n", + "./noemitonerror/src/main.ts": "-614304812-import { A } from \"../shared/types/db\";\nexport const a = class { p = 10; };\n", + "./noemitonerror/src/other.ts": "9084524823-console.log(\"hi\");\nexport { }\n" + }, + "root": [ + [ + [ + 2, + 4 + ], + [ + "./noemitonerror/shared/types/db.ts", + "./noemitonerror/src/main.ts", + "./noemitonerror/src/other.ts" + ] + ] + ], + "options": { + "module": 2, + "noEmitOnError": true, + "outFile": "./dev-build.js" + }, + "version": "FakeTSVersion", + "size": 907 +} + +//// [/user/username/projects/dev-build.js] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "incremental": true, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError.js b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError.js index bdf0b2114cfb3..8449c73c638dc 100644 --- a/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError.js +++ b/tests/baselines/reference/tscWatch/noEmitOnError/outFile/noEmitOnError.js @@ -126,7 +126,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Syntax error +Change:: Fix syntax errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -202,7 +202,24 @@ No shapes updated in the builder:: exitCode:: ExitStatus.undefined -Change:: Semantic Error +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +3: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +3: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -211,10 +228,10 @@ const a: string = 10; Timeout callback:: count: 1 -3: timerToUpdateProgram *new* +4: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -3: timerToUpdateProgram +4: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -268,10 +285,10 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -4: timerToUpdateProgram *new* +5: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -4: timerToUpdateProgram +5: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -279,7 +296,7 @@ After running Timeout callback:: count: 0 exitCode:: ExitStatus.undefined -Change:: Fix Semantic Error +Change:: Fix semantic errors Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] @@ -288,10 +305,10 @@ const a: string = "hello"; Timeout callback:: count: 1 -5: timerToUpdateProgram *new* +6: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -5: timerToUpdateProgram +6: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 @@ -357,10 +374,180 @@ Input:: //// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents Timeout callback:: count: 1 -6: timerToUpdateProgram *new* +7: timerToUpdateProgram *new* Before running Timeout callback:: count: 1 -6: timerToUpdateProgram +7: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { private p = 10; }; + + + +Timeout callback:: count: 1 +8: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +8: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.js] +define("shared/types/db", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); +}); +define("src/main", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.a = void 0; + exports.a = /** @class */ (function () { + function class_1() { + this.p = 10; + } + return class_1; + }()); +}); +define("src/other", ["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + console.log("hi"); +}); + + + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +9: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +9: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 + + +exitCode:: ExitStatus.undefined + +Change:: Fix dts errors + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] +import { A } from "../shared/types/db"; +export const a = class { p = 10; }; + + + +Timeout callback:: count: 1 +10: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +10: timerToUpdateProgram + +Host is moving to new time +After running Timeout callback:: count: 0 +Output:: +>> Screen clear +[HH:MM:SS AM] File change detected. Starting incremental compilation... + +[HH:MM:SS AM] Found 0 errors. Watching for file changes. + + + +//// [/user/username/projects/dev-build.js] file written with same contents + + +Program root files: [ + "/user/username/projects/noEmitOnError/shared/types/db.ts", + "/user/username/projects/noEmitOnError/src/main.ts", + "/user/username/projects/noEmitOnError/src/other.ts" +] +Program options: { + "outFile": "/user/username/projects/dev-build.js", + "module": 2, + "noEmitOnError": true, + "watch": true, + "configFilePath": "/user/username/projects/noEmitOnError/tsconfig.json" +} +Program structureReused: Completely +Program files:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +Semantic diagnostics in builder refreshed for:: +/a/lib/lib.d.ts +/user/username/projects/noEmitOnError/shared/types/db.ts +/user/username/projects/noEmitOnError/src/main.ts +/user/username/projects/noEmitOnError/src/other.ts + +No shapes updated in the builder:: + +exitCode:: ExitStatus.undefined + +Change:: No change + +Input:: +//// [/user/username/projects/noEmitOnError/src/main.ts] file written with same contents + +Timeout callback:: count: 1 +11: timerToUpdateProgram *new* + +Before running Timeout callback:: count: 1 +11: timerToUpdateProgram Host is moving to new time After running Timeout callback:: count: 0 diff --git a/tests/baselines/reference/tscWatch/programUpdates/when-new-file-is-added-to-the-referenced-project.js b/tests/baselines/reference/tscWatch/programUpdates/when-new-file-is-added-to-the-referenced-project.js index e20784b3f1145..1f68b6322120e 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/when-new-file-is-added-to-the-referenced-project.js +++ b/tests/baselines/reference/tscWatch/programUpdates/when-new-file-is-added-to-the-referenced-project.js @@ -685,11 +685,11 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/projects/proj "semanticDiagnosticsPerFile": [ [ "../project1/class1.d.ts", - "not cached" + "not cached or not changed" ], [ "./class2.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./class2.d.ts", diff --git a/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-emit-builder.js b/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-emit-builder.js index 3776cacb25e13..a41ac165d9053 100644 --- a/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-emit-builder.js +++ b/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-emit-builder.js @@ -37,7 +37,7 @@ Output:: //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[2,3],"emitSignatures":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[[2,17],[3,17]],"emitSignatures":[2,3],"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -80,12 +80,18 @@ Output:: }, "affectedFilesPendingEmit": [ [ - "./main.ts", - "Js | Dts" + [ + "./main.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./other.ts", - "Js | Dts" + [ + "./other.ts", + 17 + ], + "Js | DtsEmit" ] ], "emitSignatures": [ @@ -93,7 +99,7 @@ Output:: "./other.ts" ], "version": "FakeTSVersion", - "size": 678 + "size": 688 } @@ -329,7 +335,7 @@ Output:: //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[2],"latestChangedDtsFile":"./other.d.ts","version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[[2,17]],"latestChangedDtsFile":"./other.d.ts","version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -380,13 +386,16 @@ Output:: }, "affectedFilesPendingEmit": [ [ - "./main.ts", - "Js | Dts" + [ + "./main.ts", + 17 + ], + "Js | DtsEmit" ] ], "latestChangedDtsFile": "./other.d.ts", "version": "FakeTSVersion", - "size": 845 + "size": 850 } diff --git a/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-semantic-builder.js b/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-semantic-builder.js index cf6d3b461bd45..2fbc61c6b4f37 100644 --- a/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-semantic-builder.js +++ b/tests/baselines/reference/tscWatch/watchApi/multiFile/noEmit-with-composite-with-semantic-builder.js @@ -37,7 +37,7 @@ Output:: //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[2,3],"emitSignatures":[2,3],"version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},"-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[[2,17],[3,17]],"emitSignatures":[2,3],"version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -80,12 +80,18 @@ Output:: }, "affectedFilesPendingEmit": [ [ - "./main.ts", - "Js | Dts" + [ + "./main.ts", + 17 + ], + "Js | DtsEmit" ], [ - "./other.ts", - "Js | Dts" + [ + "./other.ts", + 17 + ], + "Js | DtsEmit" ] ], "emitSignatures": [ @@ -93,7 +99,7 @@ Output:: "./other.ts" ], "version": "FakeTSVersion", - "size": 678 + "size": 688 } @@ -343,7 +349,7 @@ Output:: //// [/user/username/projects/myproject/tsconfig.tsbuildinfo] -{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[2],"latestChangedDtsFile":"./other.d.ts","version":"FakeTSVersion"} +{"fileNames":["../../../../a/lib/lib.d.ts","./main.ts","./other.ts"],"fileInfos":[{"version":"-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","affectsGlobalScope":true},{"version":"-14918944530-export const x = 10;\n// SomeComment","signature":"-6821242887-export declare const x = 10;\n"},{"version":"-13729955264-export const y = 10;","signature":"-7152472870-export declare const y = 10;\n"}],"root":[2,3],"options":{"composite":true},"affectedFilesPendingEmit":[[2,17]],"latestChangedDtsFile":"./other.d.ts","version":"FakeTSVersion"} //// [/user/username/projects/myproject/tsconfig.tsbuildinfo.readable.baseline.txt] { @@ -394,13 +400,16 @@ Output:: }, "affectedFilesPendingEmit": [ [ - "./main.ts", - "Js | Dts" + [ + "./main.ts", + 17 + ], + "Js | DtsEmit" ] ], "latestChangedDtsFile": "./other.d.ts", "version": "FakeTSVersion", - "size": 845 + "size": 850 } diff --git a/tests/baselines/reference/tscWatch/watchApi/multiFile/semantic-builder-emitOnlyDts.js b/tests/baselines/reference/tscWatch/watchApi/multiFile/semantic-builder-emitOnlyDts.js index 3d715d2b946b0..a3d424757f932 100644 --- a/tests/baselines/reference/tscWatch/watchApi/multiFile/semantic-builder-emitOnlyDts.js +++ b/tests/baselines/reference/tscWatch/watchApi/multiFile/semantic-builder-emitOnlyDts.js @@ -254,13 +254,15 @@ Output:: "affectedFilesPendingEmit": [ [ [ - "./main.ts" + "./main.ts", + 1 ], "Js" ], [ [ - "./other.ts" + "./other.ts", + 1 ], "Js" ] diff --git a/tests/baselines/reference/tscWatch/watchApi/multiFile/when-emitting-with-emitOnlyDtsFiles.js b/tests/baselines/reference/tscWatch/watchApi/multiFile/when-emitting-with-emitOnlyDtsFiles.js index 84d2a18f6c346..db68ab8bc8793 100644 --- a/tests/baselines/reference/tscWatch/watchApi/multiFile/when-emitting-with-emitOnlyDtsFiles.js +++ b/tests/baselines/reference/tscWatch/watchApi/multiFile/when-emitting-with-emitOnlyDtsFiles.js @@ -266,13 +266,15 @@ CreatingProgramWith:: "affectedFilesPendingEmit": [ [ [ - "./a.ts" + "./a.ts", + 1 ], "Js" ], [ [ - "./b.ts" + "./b.ts", + 1 ], "Js" ] diff --git a/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-emit-builder.js b/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-emit-builder.js index dfe16f26a87b1..3f894449e27a1 100644 --- a/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-emit-builder.js +++ b/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-emit-builder.js @@ -39,7 +39,7 @@ Output:: //// [/user/username/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} //// [/user/username/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -69,11 +69,11 @@ Output:: "outFile": "./outFile.js" }, "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 657 + "size": 654 } @@ -293,7 +293,7 @@ Output:: //// [/user/username/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","-14918944530-export const x = 10;\n// SomeComment","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"outSignature":"3483479585-declare module \"main\" {\n export const x = 10;\n}\ndeclare module \"other\" {\n export const y = 10;\n}\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","-14918944530-export const x = 10;\n// SomeComment","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"outSignature":"3483479585-declare module \"main\" {\n export const x = 10;\n}\ndeclare module \"other\" {\n export const y = 10;\n}\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":17,"version":"FakeTSVersion"} //// [/user/username/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -325,11 +325,11 @@ Output:: "outSignature": "3483479585-declare module \"main\" {\n export const x = 10;\n}\ndeclare module \"other\" {\n export const y = 10;\n}\n", "latestChangedDtsFile": "./outFile.d.ts", "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 855 + "size": 852 } diff --git a/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-semantic-builder.js b/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-semantic-builder.js index 120dead41e909..d8f63bf18236b 100644 --- a/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-semantic-builder.js +++ b/tests/baselines/reference/tscWatch/watchApi/outFile/noEmit-with-composite-with-semantic-builder.js @@ -39,7 +39,7 @@ Output:: //// [/user/username/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","-10726455937-export const x = 10;","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"pendingEmit":17,"version":"FakeTSVersion"} //// [/user/username/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -69,11 +69,11 @@ Output:: "outFile": "./outFile.js" }, "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 657 + "size": 654 } @@ -307,7 +307,7 @@ Output:: //// [/user/username/projects/outFile.tsbuildinfo] -{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","-14918944530-export const x = 10;\n// SomeComment","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"outSignature":"3483479585-declare module \"main\" {\n export const x = 10;\n}\ndeclare module \"other\" {\n export const y = 10;\n}\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":false,"version":"FakeTSVersion"} +{"fileNames":["../../../a/lib/lib.d.ts","./myproject/main.ts","./myproject/other.ts"],"fileInfos":["-7698705165-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }","-14918944530-export const x = 10;\n// SomeComment","-13729955264-export const y = 10;"],"root":[2,3],"options":{"composite":true,"module":2,"outFile":"./outFile.js"},"outSignature":"3483479585-declare module \"main\" {\n export const x = 10;\n}\ndeclare module \"other\" {\n export const y = 10;\n}\n","latestChangedDtsFile":"./outFile.d.ts","pendingEmit":17,"version":"FakeTSVersion"} //// [/user/username/projects/outFile.tsbuildinfo.readable.baseline.txt] { @@ -339,11 +339,11 @@ Output:: "outSignature": "3483479585-declare module \"main\" {\n export const x = 10;\n}\ndeclare module \"other\" {\n export const y = 10;\n}\n", "latestChangedDtsFile": "./outFile.d.ts", "pendingEmit": [ - "Js | Dts", - false + "Js | DtsEmit", + 17 ], "version": "FakeTSVersion", - "size": 855 + "size": 852 } diff --git a/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine-without-implementing-useSourceOfProjectReferenceRedirect.js b/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine-without-implementing-useSourceOfProjectReferenceRedirect.js index 35b372f84ef20..4bea0917c04d9 100644 --- a/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine-without-implementing-useSourceOfProjectReferenceRedirect.js +++ b/tests/baselines/reference/tscWatch/watchApi/when-new-file-is-added-to-the-referenced-project-with-host-implementing-getParsedCommandLine-without-implementing-useSourceOfProjectReferenceRedirect.js @@ -679,11 +679,11 @@ FileWatcher:: Added:: WatchInfo: /user/username/projects/myproject/projects/proj "semanticDiagnosticsPerFile": [ [ "../project1/class1.d.ts", - "not cached" + "not cached or not changed" ], [ "./class2.ts", - "not cached" + "not cached or not changed" ] ], "latestChangedDtsFile": "./class2.d.ts",