From 476d818ff8007dd4d99328697f7a1cde294db8ae Mon Sep 17 00:00:00 2001 From: John Favret <64748847+johnfav03@users.noreply.github.com> Date: Thu, 20 Aug 2026 16:22:27 -0500 Subject: [PATCH 1/6] add diagnostic formatting APIs --- packages/typescript/src/api/async/api.ts | 138 ++++++- packages/typescript/src/api/async/types.ts | 6 + packages/typescript/src/api/path.ts | 39 ++ .../typescript/src/api/proto.generated.ts | 23 ++ packages/typescript/src/api/sync/api.ts | 134 ++++++- packages/typescript/src/api/sync/types.ts | 6 + packages/typescript/test/async/api.test.ts | 128 +++++++ packages/typescript/test/sync/api.test.ts | 120 ++++++ tsc/internal/api/format_diagnostics.go | 209 +++++++++++ tsc/internal/api/proto.go | 194 +++++----- tsc/internal/api/session.go | 4 + .../api/session_format_diagnostics_test.go | 346 ++++++++++++++++++ .../diagnosticwriter/diagnosticwriter.go | 29 +- .../tsoptions/tsconfigparsing_test.go | 8 +- ...ntMapperDiagnosticDirectives.contentmapper | 5 - .../contentMapperDiagnostics.contentmapper | 2 - ...rInvalidDiagnosticDirectives.contentmapper | 4 - .../deeplyNestedAssignabilityIssue.errors.txt | 15 +- ...uplicateIdentifierRelatedSpans1.errors.txt | 31 +- ...uplicateIdentifierRelatedSpans2.errors.txt | 71 ++-- ...uplicateIdentifierRelatedSpans3.errors.txt | 23 +- ...uplicateIdentifierRelatedSpans4.errors.txt | 63 ++-- ...uplicateIdentifierRelatedSpans5.errors.txt | 23 +- ...uplicateIdentifierRelatedSpans6.errors.txt | 23 +- ...uplicateIdentifierRelatedSpans7.errors.txt | 71 ++-- ...opPrettyErrorRelatedInformation.errors.txt | 3 +- ...manyCompilerErrorsInTheTwoFiles.errors.txt | 18 - .../prettyContextNotDebugAssertion.errors.txt | 3 +- .../prettyFileWithErrorsAndTabs.errors.txt | 2 - ....json to typeAcquisition with json api.js | 2 +- ...ypeAcquisition with jsonSourceFile api.js | 1 - ....json to typeAcquisition with json api.js | 2 +- ...ypeAcquisition with jsonSourceFile api.js | 1 - ...rectory with no .ts files with json api.js | 2 +- ...th no .ts files with jsonSourceFile api.js | 2 +- ...rrors for empty directory with json api.js | 2 +- ...empty directory with jsonSourceFile api.js | 2 +- ...o references are provided with json api.js | 2 +- ...es are provided with jsonSourceFile api.js | 1 - ...rors for empty files list with json api.js | 2 +- ...mpty files list with jsonSourceFile api.js | 1 - ... errors for empty include with json api.js | 2 +- ...r empty include with jsonSourceFile api.js | 2 +- ... after recursive wildcard with json api.js | 2 +- ...ursive wildcard with jsonSourceFile api.js | 3 +- ... for includes with outDir with json api.js | 2 +- ...des with outDir with jsonSourceFile api.js | 2 +- ...ine option is in tsconfig with json api.js | 2 +- ... is in tsconfig with jsonSourceFile api.js | 1 - ... when files is not string with json api.js | 2 +- ...s is not string with jsonSourceFile api.js | 1 - ...hen include is not string with json api.js | 2 +- ...e is not string with jsonSourceFile api.js | 3 +- ...ror for an unknown option with json api.js | 2 +- ... unknown option with jsonSourceFile api.js | 1 - ...rectly cased option names with json api.js | 2 +- ...ed option names with jsonSourceFile api.js | 10 - ...on and invalid enum value with json api.js | 2 +- ...alid enum value with jsonSourceFile api.js | 3 - ...ion for an unknown option with json api.js | 2 +- ... unknown option with jsonSourceFile api.js | 1 - ...en tsconfig have excludes with json api.js | 2 +- ...g have excludes with jsonSourceFile api.js | 1 - .../typedefCrossModule5.errors.txt | 15 +- .../tsbuild/commandLine/bad-locale.js | 1 + .../when-build-not-first-argument.js | 2 + .../configFileErrors/missing-config-file.js | 1 + .../when-tsconfig-extends-the-missing-file.js | 4 + ...ts-the-error-about-it-by-stopping-build.js | 1 + .../noCheck/dts-errors-with-incremental.js | 18 +- .../reference/tsbuild/noCheck/dts-errors.js | 18 +- .../tsbuild/noEmit/changes-composite.js | 36 +- .../noEmit/changes-incremental-declaration.js | 36 +- .../tsbuild/noEmit/changes-incremental.js | 36 +- .../changes-with-initial-noEmit-composite.js | 6 +- ...-initial-noEmit-incremental-declaration.js | 6 +- ...changes-with-initial-noEmit-incremental.js | 6 +- ...ble-changes-with-incremental-as-modules.js | 9 +- ...aration-enable-changes-with-incremental.js | 9 +- ...tion-enable-changes-with-multiple-files.js | 42 ++- ...-errors-with-declaration-enable-changes.js | 9 +- .../dts-errors-with-incremental-as-modules.js | 15 +- .../noEmit/dts-errors-with-incremental.js | 15 +- .../reference/tsbuild/noEmit/dts-errors.js | 15 +- ...rrors-with-declaration-with-incremental.js | 6 +- .../dts-errors-with-declaration.js | 6 +- ...iles-belong-to-rootDir-and-is-composite.js | 3 + ...ied-but-not-all-files-belong-to-rootDir.js | 3 + ...ting-json-module-from-project-reference.js | 4 + ...t-in-not-build-order-doesnt-throw-error.js | 1 + ...t-in-not-build-order-doesnt-throw-error.js | 1 + ...ror-if-input-file-is-missing-with-force.js | 4 +- .../reports-error-if-input-file-is-missing.js | 4 +- ...rrors-when-test-does-not-reference-core.js | 6 +- ...ects-have-errors-with-stopBuildOnErrors.js | 6 +- .../demo/updates-with-circular-reference.js | 1 + .../dts-errors-with-incremental-as-modules.js | 12 +- .../noEmit/dts-errors-with-incremental.js | 12 +- .../tsbuildWatch/noEmit/dts-errors.js | 12 +- ...Error-with-declaration-with-incremental.js | 6 +- .../noEmitOnError-with-declaration.js | 6 +- ...ceError-when-file-with-no-error-changes.js | 6 +- ...ing-errors-only-changed-file-is-emitted.js | 3 +- ...tErrors-when-file-with-no-error-changes.js | 6 +- ...ixing-error-files-all-files-are-emitted.js | 3 +- ...e-down-stream-project-and-then-fixes-it.js | 3 +- .../works-with-extended-source-files.js | 1 + .../reexport/Reports-errors-correctly.js | 3 +- ...rrors-when-test-does-not-reference-core.js | 3 +- ...ects-have-errors-with-stopBuildOnErrors.js | 3 +- ...tches-config-files-that-are-not-present.js | 1 + ...ig-with-incorrect-compiler-option-value.js | 1 + ...TSConfig-with-incorrect-compiler-option.js | 1 + ...Initialized-TSConfig-with-tsconfig.json.js | 1 + .../commandLine/Parse-enum-type-options.js | 1 + .../reference/tsc/commandLine/bad-locale.js | 1 + ...nfig-in-different-folder-does-not-exist.js | 1 + ...ionless-file-in-tsconfig-does-not-exist.js | 4 +- .../extensionless-file-in-tsconfig-exists.js | 4 +- ...tensionless-file-on-command-line-exists.js | 1 + .../file-in-tsconfig-does-not-exist.js | 4 +- .../tsc/commandLine/non-object-config-root.js | 1 + ...ation-failure-reports-one-project-error.js | 1 + ...per-is-disabled-after-repeated-failures.js | 1 + ...ist-on-disk-that-differs-only-in-casing.js | 3 +- ...m-multiple-places-with-different-casing.js | 133 +++---- ...ative-and-non-relative-file-resolutions.js | 6 +- ...e-with-multiple-files-and-complex-types.js | 3 +- ...-config-file-absent-with---ignoreConfig.js | 1 + ...oject-and-files-when-config-file-absent.js | 1 + ...g-project-and-files-with---ignoreConfig.js | 1 + .../ignoreConfig/mixing-project-and-files.js | 1 + .../tsc/ignoreConfig/specifying-files.js | 1 + ...-config-file-absent-with---ignoreConfig.js | 1 + ...cifying-project-when-config-file-absent.js | 1 + ...mental-with-case-insensitive-file-names.js | 3 +- ...ion-field-with-declaration-emit-enabled.js | 6 +- .../internal-symbolname-in-tsbuildInfo.js | 24 +- ...th-import-in-jsdoc-in-composite-project.js | 1 + .../incremental/serializing-error-chain.js | 6 +- .../libraryResolution/when-noLib-toggles.js | 10 + .../noCheck/dts-errors-with-incremental.js | 18 +- .../reference/tsc/noCheck/dts-errors.js | 18 +- .../reference/tsc/noEmit/changes-composite.js | 36 +- .../noEmit/changes-incremental-declaration.js | 36 +- .../tsc/noEmit/changes-incremental.js | 36 +- .../changes-with-initial-noEmit-composite.js | 6 +- ...-initial-noEmit-incremental-declaration.js | 6 +- ...changes-with-initial-noEmit-incremental.js | 6 +- ...tion-enable-changes-with-multiple-files.js | 42 ++- .../dts-errors-with-incremental-as-modules.js | 15 +- .../tsc/noEmit/dts-errors-with-incremental.js | 15 +- .../reference/tsc/noEmit/dts-errors.js | 15 +- ...rrors-with-declaration-with-incremental.js | 6 +- .../dts-errors-with-declaration.js | 6 +- .../Default-initialized-TSConfig.js | 1 + .../Show-TSConfig-with-advanced-options.js | 1 + ...fig-with-boolean-value-compiler-options.js | 1 + ...Config-with-enum-value-compiler-options.js | 1 + ...ig-with-incorrect-compiler-option-value.js | 1 + ...TSConfig-with-incorrect-compiler-option.js | 1 + ...h-list-compiler-options-with-enum-value.js | 1 + ...how-TSConfig-with-list-compiler-options.js | 1 + .../parse-tsconfig-with-typeAcquisition.js | 1 + ...sted-subdirectory-removed-and-recreated.js | 3 +- .../watch-handles-tsconfig-deleted.js | 6 +- ...-with-tsconfig-files-list-entry-deleted.js | 4 +- .../reference/tscWatch/noEmit/dts-errors.js | 12 +- tsc/testdata/submoduleAccepted.txt | 3 - 169 files changed, 2078 insertions(+), 680 deletions(-) create mode 100644 tsc/internal/api/format_diagnostics.go create mode 100644 tsc/internal/api/session_format_diagnostics_test.go diff --git a/packages/typescript/src/api/async/api.ts b/packages/typescript/src/api/async/api.ts index 09f38832fe3b3..81c6c5cfcbae6 100644 --- a/packages/typescript/src/api/async/api.ts +++ b/packages/typescript/src/api/async/api.ts @@ -44,6 +44,7 @@ import type { LSPConnectionOptions, } from "../options.ts"; import { + convertToRelativePath, createGetCanonicalFileName, toPath, } from "../path.ts"; @@ -101,6 +102,7 @@ import type { EmitOutput, EmitOutputFile, EmitResult, + FormatDiagnosticsHost, FreshableType, GetImportEditsForSymbolsOptions, IdentifierTypePredicate, @@ -153,6 +155,7 @@ export type { EmitOutput, EmitOutputFile, EmitResult, + FormatDiagnosticsHost, FreshableType, GetImportEditsForSymbolsOptions, IdentifierTypePredicate, @@ -204,6 +207,72 @@ export interface TranspileOutput { sourceMapText?: string; } +const diagnosticOrigin = globalThis.Symbol("diagnosticOrigin"); + +interface DiagnosticOrigin { + readonly snapshot: number; + readonly project: Path; +} + +interface DiagnosticWithOrigin extends Diagnostic { + readonly [diagnosticOrigin]?: DiagnosticOrigin; +} + +interface FormatDiagnosticRequest extends Diagnostic { + readonly originSnapshot: number; + readonly originProject: Path; + readonly displayFileName?: string; +} + +function associateDiagnostics( + diagnostics: readonly Diagnostic[], + origin: DiagnosticOrigin, +): readonly Diagnostic[] { + for (const diagnostic of diagnostics) { + Object.defineProperty(diagnostic, diagnosticOrigin, { value: origin }); + if (diagnostic.messageChain) { + associateDiagnostics(diagnostic.messageChain, origin); + } + if (diagnostic.relatedInformation) { + associateDiagnostics(diagnostic.relatedInformation, origin); + } + } + return diagnostics; +} + +function toFormatDiagnosticRequest( + diagnostic: Diagnostic, + expectedOrigin: DiagnosticOrigin, + host: FormatDiagnosticsHost, +): FormatDiagnosticRequest { + const origin = (diagnostic as DiagnosticWithOrigin)[diagnosticOrigin]; + if (origin?.snapshot !== expectedOrigin.snapshot || origin.project !== expectedOrigin.project) { + throw new Error("Diagnostic was not produced by this program."); + } + + const { messageChain, relatedInformation, ...diagnosticData } = diagnostic; + return { + ...diagnosticData, + originSnapshot: origin.snapshot, + originProject: origin.project, + ...(diagnostic.fileName + ? { + displayFileName: convertToRelativePath( + diagnostic.fileName, + host.getCurrentDirectory(), + fileName => host.getCanonicalFileName(fileName), + ), + } + : {}), + ...(messageChain + ? { messageChain: messageChain.map(d => toFormatDiagnosticRequest(d, expectedOrigin, host)) } + : {}), + ...(relatedInformation + ? { relatedInformation: relatedInformation.map(d => toFormatDiagnosticRequest(d, expectedOrigin, host)) } + : {}), + }; +} + export class API { private client: Client; private sourceFileCache: SourceFileCache; @@ -968,6 +1037,13 @@ export class Program { this.toPath = toPath; } + private associateDiagnostics(diagnostics: readonly Diagnostic[]): readonly Diagnostic[] { + return associateDiagnostics(diagnostics, { + snapshot: this.snapshotId, + project: this.project.id, + }); + } + getCompilerOptions(): CompilerOptions { return this.project.compilerOptions; } @@ -1104,7 +1180,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return data ?? []; + return this.associateDiagnostics(data ?? []); } /** @@ -1120,7 +1196,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return data ?? []; + return this.associateDiagnostics(data ?? []); } /** @@ -1136,7 +1212,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return data ?? []; + return this.associateDiagnostics(data ?? []); } /** @@ -1152,7 +1228,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return data ?? []; + return this.associateDiagnostics(data ?? []); } /** @@ -1168,7 +1244,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return data ?? []; + return this.associateDiagnostics(data ?? []); } /** @@ -1179,7 +1255,7 @@ export class Program { snapshot: this.snapshotId, project: this.project.id, }); - return data ?? []; + return this.associateDiagnostics(data ?? []); } /** @@ -1190,7 +1266,7 @@ export class Program { snapshot: this.snapshotId, project: this.project.id, }); - return data ?? []; + return this.associateDiagnostics(data ?? []); } /** @@ -1201,7 +1277,41 @@ export class Program { snapshot: this.snapshotId, project: this.project.id, }); - return data ?? []; + return this.associateDiagnostics(data ?? []); + } + + /** + * Formats diagnostics produced by this program. + */ + async formatDiagnostics( + diagnostics: readonly Diagnostic[], + host: FormatDiagnosticsHost, + ): Promise { + const origin = { snapshot: this.snapshotId, project: this.project.id }; + const data = await this.client.apiRequest("formatDiagnostics", { + snapshot: this.snapshotId, + project: this.project.id, + diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, origin, host)), + newLine: host.getNewLine(), + }); + return data.output; + } + + /** + * Formats diagnostics produced by this program with color and context. + */ + async formatDiagnosticsWithColorAndContext( + diagnostics: readonly Diagnostic[], + host: FormatDiagnosticsHost, + ): Promise { + const origin = { snapshot: this.snapshotId, project: this.project.id }; + const data = await this.client.apiRequest("formatDiagnosticsWithColorAndContext", { + snapshot: this.snapshotId, + project: this.project.id, + diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, origin, host)), + newLine: host.getNewLine(), + }); + return data.output; } /** @@ -1218,7 +1328,7 @@ export class Program { }); return { emitSkipped: response.emitSkipped, - diagnostics: response.diagnostics, + diagnostics: this.associateDiagnostics(response.diagnostics), emittedFiles: response.emittedFiles, }; } @@ -1232,7 +1342,7 @@ export class Program { project: this.project.id, ...(emitOnly !== undefined ? { emitOnly } : {}), }); - return toEmitOutput(response); + return toEmitOutput(response, this.associateDiagnostics(response.diagnostics)); } /** @@ -1244,7 +1354,7 @@ export class Program { project: this.project.id, files, }); - return toEmitOutput(response); + return toEmitOutput(response, this.associateDiagnostics(response.diagnostics)); } /** @@ -1256,18 +1366,18 @@ export class Program { project: this.project.id, files, }); - return toEmitOutput(response); + return toEmitOutput(response, this.associateDiagnostics(response.diagnostics)); } } -function toEmitOutput(response: ProtocolEmitOutputResponse): EmitOutput { +function toEmitOutput(response: ProtocolEmitOutputResponse, diagnostics: readonly Diagnostic[]): EmitOutput { const outputFiles = new Map(); for (const { fileName, ...outputFile } of response.outputFiles) { outputFiles.set(fileName, outputFile); } return { emitSkipped: response.emitSkipped, - diagnostics: response.diagnostics, + diagnostics, outputFiles, }; } diff --git a/packages/typescript/src/api/async/types.ts b/packages/typescript/src/api/async/types.ts index adc64768c2452..4446597aa400d 100644 --- a/packages/typescript/src/api/async/types.ts +++ b/packages/typescript/src/api/async/types.ts @@ -367,6 +367,12 @@ export interface CompletionInfo { readonly entries: readonly CompletionEntry[]; } +export interface FormatDiagnosticsHost { + getCurrentDirectory(): string; + getCanonicalFileName(fileName: string): string; + getNewLine(): string; +} + export interface EmitOutputFile { readonly text: string; readonly sourceFileName?: string | undefined; diff --git a/packages/typescript/src/api/path.ts b/packages/typescript/src/api/path.ts index 778cbf8ecedcc..2d30b2a4a49e5 100644 --- a/packages/typescript/src/api/path.ts +++ b/packages/typescript/src/api/path.ts @@ -337,6 +337,45 @@ export function isRootedDiskPath(path: string): boolean { return getEncodedRootLength(path) > 0; } +export function convertToRelativePath( + absoluteOrRelativePath: string, + basePath: string, + getCanonicalFileName: (path: string) => string, +): string { + if (!isRootedDiskPath(absoluteOrRelativePath)) { + return absoluteOrRelativePath; + } + + const fromComponents = getPathComponents(getNormalizedAbsolutePath(basePath, "")); + const toComponents = getPathComponents(getNormalizedAbsolutePath(absoluteOrRelativePath, "")); + let start = 0; + for (; start < fromComponents.length && start < toComponents.length; start++) { + const fromComponent = getCanonicalFileName(fromComponents[start]); + const toComponent = getCanonicalFileName(toComponents[start]); + const equal = start === 0 + ? fromComponent.toLowerCase() === toComponent.toLowerCase() + : fromComponent === toComponent; + if (!equal) { + break; + } + } + + if (start === 0) { + return pathFromComponents(toComponents); + } + + const relative = Array(fromComponents.length - start).fill(".."); + return pathFromComponents(["", ...relative, ...toComponents.slice(start)]); +} + +function pathFromComponents(components: readonly string[]): string { + if (components.length === 0) { + return ""; + } + const root = components[0] && ensureTrailingDirectorySeparator(components[0]); + return root + components.slice(1).join(directorySeparator); +} + /** * Converts a file name to a normalized path. * diff --git a/packages/typescript/src/api/proto.generated.ts b/packages/typescript/src/api/proto.generated.ts index 5e30d12bae247..b05ee9e4e197c 100644 --- a/packages/typescript/src/api/proto.generated.ts +++ b/packages/typescript/src/api/proto.generated.ts @@ -124,6 +124,8 @@ export interface APIMethodInfo { getProgramDiagnostics: APIMethod; getGlobalDiagnostics: APIMethod; getConfigFileParsingDiagnostics: APIMethod; + formatDiagnostics: APIMethod; + formatDiagnosticsWithColorAndContext: APIMethod; printNode: APIMethod; formatNodeForInsertion: APIMethod; emit: APIMethod; @@ -766,6 +768,8 @@ export interface DiagnosticResponse { code: number; /** Category is the diagnostic category (error, warning, suggestion, message). */ category: number; + /** Source is a custom diagnostic-code prefix. An empty value uses the default "TS". */ + source?: string; /** Text is the localized diagnostic message text. */ text: string; /** ReportsUnnecessary indicates this diagnostic highlights unnecessary code. */ @@ -776,6 +780,25 @@ export interface DiagnosticResponse { messageChain?: DiagnosticResponse[]; /** RelatedInformation contains related diagnostic information, if any. */ relatedInformation?: DiagnosticResponse[]; + /** OriginSnapshot and OriginProject identify the program that produced this diagnostic. */ + originSnapshot?: number; + originProject?: string; + /** DisplayFileName is the host-formatted file name used only for diagnostic output. */ + displayFileName?: string; +} + +/** FormatDiagnosticsParams are parameters for diagnostic formatting methods. */ +export interface FormatDiagnosticsParams { + snapshot: number; + project: string; + diagnostics: readonly DiagnosticResponse[] | null; + newLine: string; +} + +/** FormatDiagnosticsResponse is the response for diagnostic formatting methods. */ +export interface FormatDiagnosticsResponse { + /** Output is the fully formatted diagnostics text. */ + output: string; } /** PrintNodeParams are the parameters for the printNode method. */ diff --git a/packages/typescript/src/api/sync/api.ts b/packages/typescript/src/api/sync/api.ts index 582c0b6c54359..8af6bcb04d71e 100644 --- a/packages/typescript/src/api/sync/api.ts +++ b/packages/typescript/src/api/sync/api.ts @@ -52,6 +52,7 @@ import type { LSPConnectionOptions, } from "../options.ts"; import { + convertToRelativePath, createGetCanonicalFileName, toPath, } from "../path.ts"; @@ -109,6 +110,7 @@ import type { EmitOutput, EmitOutputFile, EmitResult, + FormatDiagnosticsHost, FreshableType, GetImportEditsForSymbolsOptions, IdentifierTypePredicate, @@ -161,6 +163,7 @@ export type { EmitOutput, EmitOutputFile, EmitResult, + FormatDiagnosticsHost, FreshableType, GetImportEditsForSymbolsOptions, IdentifierTypePredicate, @@ -212,6 +215,72 @@ export interface TranspileOutput { sourceMapText?: string; } +const diagnosticOrigin = globalThis.Symbol("diagnosticOrigin"); + +interface DiagnosticOrigin { + readonly snapshot: number; + readonly project: Path; +} + +interface DiagnosticWithOrigin extends Diagnostic { + readonly [diagnosticOrigin]?: DiagnosticOrigin; +} + +interface FormatDiagnosticRequest extends Diagnostic { + readonly originSnapshot: number; + readonly originProject: Path; + readonly displayFileName?: string; +} + +function associateDiagnostics( + diagnostics: readonly Diagnostic[], + origin: DiagnosticOrigin, +): readonly Diagnostic[] { + for (const diagnostic of diagnostics) { + Object.defineProperty(diagnostic, diagnosticOrigin, { value: origin }); + if (diagnostic.messageChain) { + associateDiagnostics(diagnostic.messageChain, origin); + } + if (diagnostic.relatedInformation) { + associateDiagnostics(diagnostic.relatedInformation, origin); + } + } + return diagnostics; +} + +function toFormatDiagnosticRequest( + diagnostic: Diagnostic, + expectedOrigin: DiagnosticOrigin, + host: FormatDiagnosticsHost, +): FormatDiagnosticRequest { + const origin = (diagnostic as DiagnosticWithOrigin)[diagnosticOrigin]; + if (origin?.snapshot !== expectedOrigin.snapshot || origin.project !== expectedOrigin.project) { + throw new Error("Diagnostic was not produced by this program."); + } + + const { messageChain, relatedInformation, ...diagnosticData } = diagnostic; + return { + ...diagnosticData, + originSnapshot: origin.snapshot, + originProject: origin.project, + ...(diagnostic.fileName + ? { + displayFileName: convertToRelativePath( + diagnostic.fileName, + host.getCurrentDirectory(), + fileName => host.getCanonicalFileName(fileName), + ), + } + : {}), + ...(messageChain + ? { messageChain: messageChain.map(d => toFormatDiagnosticRequest(d, expectedOrigin, host)) } + : {}), + ...(relatedInformation + ? { relatedInformation: relatedInformation.map(d => toFormatDiagnosticRequest(d, expectedOrigin, host)) } + : {}), + }; +} + export class API { private client: Client; private sourceFileCache: SourceFileCache; @@ -976,6 +1045,13 @@ export class Program { this.toPath = toPath; } + private associateDiagnostics(diagnostics: readonly Diagnostic[]): readonly Diagnostic[] { + return associateDiagnostics(diagnostics, { + snapshot: this.snapshotId, + project: this.project.id, + }); + } + getCompilerOptions(): CompilerOptions { return this.project.compilerOptions; } @@ -1112,7 +1188,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return data ?? []; + return this.associateDiagnostics(data ?? []); } /** @@ -1128,7 +1204,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return data ?? []; + return this.associateDiagnostics(data ?? []); } /** @@ -1144,7 +1220,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return data ?? []; + return this.associateDiagnostics(data ?? []); } /** @@ -1160,7 +1236,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return data ?? []; + return this.associateDiagnostics(data ?? []); } /** @@ -1176,7 +1252,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return data ?? []; + return this.associateDiagnostics(data ?? []); } /** @@ -1187,7 +1263,7 @@ export class Program { snapshot: this.snapshotId, project: this.project.id, }); - return data ?? []; + return this.associateDiagnostics(data ?? []); } /** @@ -1198,7 +1274,7 @@ export class Program { snapshot: this.snapshotId, project: this.project.id, }); - return data ?? []; + return this.associateDiagnostics(data ?? []); } /** @@ -1209,7 +1285,37 @@ export class Program { snapshot: this.snapshotId, project: this.project.id, }); - return data ?? []; + return this.associateDiagnostics(data ?? []); + } + + /** Formats diagnostics produced by this program. */ + formatDiagnostics( + diagnostics: readonly Diagnostic[], + host: FormatDiagnosticsHost, + ): string { + const origin = { snapshot: this.snapshotId, project: this.project.id }; + const data = this.client.apiRequest("formatDiagnostics", { + snapshot: this.snapshotId, + project: this.project.id, + diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, origin, host)), + newLine: host.getNewLine(), + }); + return data.output; + } + + /** Formats diagnostics produced by this program with color and context. */ + formatDiagnosticsWithColorAndContext( + diagnostics: readonly Diagnostic[], + host: FormatDiagnosticsHost, + ): string { + const origin = { snapshot: this.snapshotId, project: this.project.id }; + const data = this.client.apiRequest("formatDiagnosticsWithColorAndContext", { + snapshot: this.snapshotId, + project: this.project.id, + diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, origin, host)), + newLine: host.getNewLine(), + }); + return data.output; } /** @@ -1226,7 +1332,7 @@ export class Program { }); return { emitSkipped: response.emitSkipped, - diagnostics: response.diagnostics, + diagnostics: this.associateDiagnostics(response.diagnostics), emittedFiles: response.emittedFiles, }; } @@ -1240,7 +1346,7 @@ export class Program { project: this.project.id, ...(emitOnly !== undefined ? { emitOnly } : {}), }); - return toEmitOutput(response); + return toEmitOutput(response, this.associateDiagnostics(response.diagnostics)); } /** @@ -1252,7 +1358,7 @@ export class Program { project: this.project.id, files, }); - return toEmitOutput(response); + return toEmitOutput(response, this.associateDiagnostics(response.diagnostics)); } /** @@ -1264,18 +1370,18 @@ export class Program { project: this.project.id, files, }); - return toEmitOutput(response); + return toEmitOutput(response, this.associateDiagnostics(response.diagnostics)); } } -function toEmitOutput(response: ProtocolEmitOutputResponse): EmitOutput { +function toEmitOutput(response: ProtocolEmitOutputResponse, diagnostics: readonly Diagnostic[]): EmitOutput { const outputFiles = new Map(); for (const { fileName, ...outputFile } of response.outputFiles) { outputFiles.set(fileName, outputFile); } return { emitSkipped: response.emitSkipped, - diagnostics: response.diagnostics, + diagnostics, outputFiles, }; } diff --git a/packages/typescript/src/api/sync/types.ts b/packages/typescript/src/api/sync/types.ts index 04e9f3f848577..1173219805f5a 100644 --- a/packages/typescript/src/api/sync/types.ts +++ b/packages/typescript/src/api/sync/types.ts @@ -375,6 +375,12 @@ export interface CompletionInfo { readonly entries: readonly CompletionEntry[]; } +export interface FormatDiagnosticsHost { + getCurrentDirectory(): string; + getCanonicalFileName(fileName: string): string; + getNewLine(): string; +} + export interface EmitOutputFile { readonly text: string; readonly sourceFileName?: string | undefined; diff --git a/packages/typescript/test/async/api.test.ts b/packages/typescript/test/async/api.test.ts index 24ae9c84f1eb8..5cb2a6852a934 100644 --- a/packages/typescript/test/async/api.test.ts +++ b/packages/typescript/test/async/api.test.ts @@ -5727,6 +5727,134 @@ describe("Program - diagnostics", () => { } }); + test("formatDiagnostics and formatDiagnosticsWithColorAndContext", async () => { + const source = `const x: number = "oops";\n`; + const api = spawnAPI({ + "/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + "/src/index.ts": source, + }); + try { + const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); + const project = snapshot.getProject("/tsconfig.json")!; + const diags = await project.program.getSemanticDiagnostics("/src/index.ts"); + assert.equal(diags.length, 1); + const host = { + getCurrentDirectory: () => "/SRC", + getCanonicalFileName: (fileName: string) => fileName.toLowerCase(), + getNewLine: () => "\r\n", + }; + + const plain = await project.program.formatDiagnostics(diags, host); + assert.equal( + plain, + "index.ts(1,7): error TS2322: Type 'string' is not assignable to type 'number'.\r\n", + ); + + const color = await project.program.formatDiagnosticsWithColorAndContext(diags, host); + assert.ok(color.includes("TS2322: "), color); + assert.ok(color.includes(`const x: number = "oops";`), color); + assert.ok(color.includes("~"), color); + assert.ok(color.includes("\x1b["), color); + assert.ok(color.endsWith("\r\n"), color); + const doubled = await project.program.formatDiagnosticsWithColorAndContext([diags[0], diags[0]], host); + assert.equal(doubled, color + color); + } + finally { + await api.close(); + } + }); + + test("formatDiagnostics resolves config-file context", async () => { + const config = `{ "compilerOptions": { "target": "invalid" } }`; + const api = spawnAPI({ + "/tsconfig.json": config, + "/src/index.ts": `export const x = 1;`, + }); + try { + const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); + const project = snapshot.getProject("/tsconfig.json")!; + const diags = await project.program.getConfigFileParsingDiagnostics(); + const host = { + getCurrentDirectory: () => "/", + getCanonicalFileName: (fileName: string) => fileName, + getNewLine: () => "\n", + }; + + const plain = await project.program.formatDiagnostics(diags, host); + assert.ok(plain.includes("tsconfig.json(1,34): error TS6046: "), plain); + + const color = await project.program.formatDiagnosticsWithColorAndContext(diags, host); + assert.ok(color.includes(`"target": "invalid"`), color); + } + finally { + await api.close(); + } + }); + + test("formatDiagnostics rejects diagnostics from another program", async () => { + const api = spawnAPI({ + "/a/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + "/a/index.ts": `const x: number = "oops";`, + "/b/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + "/b/index.ts": `export const x = 1;`, + }); + try { + const snapshot = await api.updateSnapshot({ + openProjects: ["/a/tsconfig.json", "/b/tsconfig.json"], + }); + const a = snapshot.getProject("/a/tsconfig.json")!.program; + const b = snapshot.getProject("/b/tsconfig.json")!.program; + const diagnostics = await a.getSemanticDiagnostics("/a/index.ts"); + const host = { + getCurrentDirectory: () => "/", + getCanonicalFileName: (fileName: string) => fileName, + getNewLine: () => "\n", + }; + + // @sync: assert.throws(() => + await assert.rejects( // @sync-skip + b.formatDiagnostics(diagnostics, host), + /Diagnostic was not produced by this program/, + ); + } + finally { + await api.close(); + } + }); + + test("formatDiagnostics rejects diagnostics without origin metadata", async () => { + const api = spawnAPI({ + "/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + "/src/index.ts": `const x: number = "oops";`, + }); + try { + const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); + const program = snapshot.getProject("/tsconfig.json")!.program; + const diagnostics = await program.getSemanticDiagnostics("/src/index.ts"); + const host = { + getCurrentDirectory: () => "/", + getCanonicalFileName: (fileName: string) => fileName, + getNewLine: () => "\n", + }; + const diagnosticsWithoutOrigin = [ + [{ ...diagnostics[0] }], + structuredClone(diagnostics), + JSON.parse(JSON.stringify(diagnostics)), + ]; + + for (const clonedDiagnostics of diagnosticsWithoutOrigin) { + // @sync: assert.throws(() => + await assert.rejects( // @sync-skip + program.formatDiagnostics(clonedDiagnostics, host), + /Diagnostic was not produced by this program/, + ); + } + } + finally { + await api.close(); + } + }); + test("getConfigFileNames and getConfigSourceFile", async () => { const baseConfigText = `{ "compilerOptions": { "strict": true } }`; const { api, fs } = spawnAPIWithFS({ diff --git a/packages/typescript/test/sync/api.test.ts b/packages/typescript/test/sync/api.test.ts index 93fe5eae5255f..3553bbf3a221e 100644 --- a/packages/typescript/test/sync/api.test.ts +++ b/packages/typescript/test/sync/api.test.ts @@ -5735,6 +5735,126 @@ describe("Program - diagnostics", () => { } }); + test("formatDiagnostics and formatDiagnosticsWithColorAndContext", () => { + const source = `const x: number = "oops";\n`; + const api = spawnAPI({ + "/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + "/src/index.ts": source, + }); + try { + const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); + const project = snapshot.getProject("/tsconfig.json")!; + const diags = project.program.getSemanticDiagnostics("/src/index.ts"); + assert.equal(diags.length, 1); + const host = { + getCurrentDirectory: () => "/SRC", + getCanonicalFileName: (fileName: string) => fileName.toLowerCase(), + getNewLine: () => "\r\n", + }; + + const plain = project.program.formatDiagnostics(diags, host); + assert.equal( + plain, + "index.ts(1,7): error TS2322: Type 'string' is not assignable to type 'number'.\r\n", + ); + + const color = project.program.formatDiagnosticsWithColorAndContext(diags, host); + assert.ok(color.includes("TS2322: "), color); + assert.ok(color.includes(`const x: number = "oops";`), color); + assert.ok(color.includes("~"), color); + assert.ok(color.includes("\x1b["), color); + assert.ok(color.endsWith("\r\n"), color); + const doubled = project.program.formatDiagnosticsWithColorAndContext([diags[0], diags[0]], host); + assert.equal(doubled, color + color); + } + finally { + api.close(); + } + }); + + test("formatDiagnostics resolves config-file context", () => { + const config = `{ "compilerOptions": { "target": "invalid" } }`; + const api = spawnAPI({ + "/tsconfig.json": config, + "/src/index.ts": `export const x = 1;`, + }); + try { + const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); + const project = snapshot.getProject("/tsconfig.json")!; + const diags = project.program.getConfigFileParsingDiagnostics(); + const host = { + getCurrentDirectory: () => "/", + getCanonicalFileName: (fileName: string) => fileName, + getNewLine: () => "\n", + }; + + const plain = project.program.formatDiagnostics(diags, host); + assert.ok(plain.includes("tsconfig.json(1,34): error TS6046: "), plain); + + const color = project.program.formatDiagnosticsWithColorAndContext(diags, host); + assert.ok(color.includes(`"target": "invalid"`), color); + } + finally { + api.close(); + } + }); + + test("formatDiagnostics rejects diagnostics from another program", () => { + const api = spawnAPI({ + "/a/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + "/a/index.ts": `const x: number = "oops";`, + "/b/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + "/b/index.ts": `export const x = 1;`, + }); + try { + const snapshot = api.updateSnapshot({ + openProjects: ["/a/tsconfig.json", "/b/tsconfig.json"], + }); + const a = snapshot.getProject("/a/tsconfig.json")!.program; + const b = snapshot.getProject("/b/tsconfig.json")!.program; + const diagnostics = a.getSemanticDiagnostics("/a/index.ts"); + const host = { + getCurrentDirectory: () => "/", + getCanonicalFileName: (fileName: string) => fileName, + getNewLine: () => "\n", + }; + + assert.throws(() => b.formatDiagnostics(diagnostics, host), /Diagnostic was not produced by this program/); + } + finally { + api.close(); + } + }); + + test("formatDiagnostics rejects diagnostics without origin metadata", () => { + const api = spawnAPI({ + "/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + "/src/index.ts": `const x: number = "oops";`, + }); + try { + const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); + const program = snapshot.getProject("/tsconfig.json")!.program; + const diagnostics = program.getSemanticDiagnostics("/src/index.ts"); + const host = { + getCurrentDirectory: () => "/", + getCanonicalFileName: (fileName: string) => fileName, + getNewLine: () => "\n", + }; + const diagnosticsWithoutOrigin = [ + [{ ...diagnostics[0] }], + structuredClone(diagnostics), + JSON.parse(JSON.stringify(diagnostics)), + ]; + + for (const clonedDiagnostics of diagnosticsWithoutOrigin) { + assert.throws(() => program.formatDiagnostics(clonedDiagnostics, host), /Diagnostic was not produced by this program/); + } + } + finally { + api.close(); + } + }); + test("getConfigFileNames and getConfigSourceFile", () => { const baseConfigText = `{ "compilerOptions": { "strict": true } }`; const { api, fs } = spawnAPIWithFS({ diff --git a/tsc/internal/api/format_diagnostics.go b/tsc/internal/api/format_diagnostics.go new file mode 100644 index 0000000000000..83162229983d7 --- /dev/null +++ b/tsc/internal/api/format_diagnostics.go @@ -0,0 +1,209 @@ +package api + +import ( + "context" + "fmt" + "strings" + + "github.com/microsoft/TypeScript/tsc/internal/ast" + "github.com/microsoft/TypeScript/tsc/internal/compiler" + "github.com/microsoft/TypeScript/tsc/internal/diagnostics" + "github.com/microsoft/TypeScript/tsc/internal/diagnosticwriter" + "github.com/microsoft/TypeScript/tsc/internal/locale" + "github.com/microsoft/TypeScript/tsc/internal/tsoptions" + "github.com/microsoft/TypeScript/tsc/internal/tspath" +) + +// handleFormatDiagnostics formats diagnostics using source text from their snapshot. +func (s *Session) handleFormatDiagnostics(ctx context.Context, params *FormatDiagnosticsParams, colorAndContext bool) (*FormatDiagnosticsResponse, error) { + sd, err := s.getSnapshotData(params.Snapshot) + if err != nil { + return nil, err + } + + program, err := sd.getProgram(params.Project) + if err != nil { + return nil, err + } + + resolver := newFormatFileResolver(sd, program) + diags := make([]diagnosticwriter.Diagnostic, len(params.Diagnostics)) + for i, d := range params.Diagnostics { + diag, err := newWireDiagnostic(d, resolver, params.Snapshot, params.Project) + if err != nil { + return nil, err + } + diags[i] = diag + } + + formatOpts := &diagnosticwriter.FormattingOptions{ + NewLine: params.NewLine, + ComparePathsOptions: tspath.ComparePathsOptions{ + CurrentDirectory: s.projectSession.GetCurrentDirectory(), + UseCaseSensitiveFileNames: s.projectSession.FS().UseCaseSensitiveFileNames(), + }, + } + + var sb strings.Builder + if colorAndContext { + diagnosticwriter.FormatDiagnosticsWithColorAndContext(&sb, diags, formatOpts) + } else { + diagnosticwriter.WriteFormatDiagnostics(&sb, diags, formatOpts) + } + + return &FormatDiagnosticsResponse{Output: sb.String()}, nil +} + +// formatFileResolver resolves source and config files from a snapshot. +type formatFileResolver struct { + sd *snapshotData + program *compiler.Program + cache map[string]*ast.SourceFile +} + +func newFormatFileResolver(sd *snapshotData, program *compiler.Program) *formatFileResolver { + return &formatFileResolver{ + sd: sd, + program: program, + cache: make(map[string]*ast.SourceFile), + } +} + +func (r *formatFileResolver) resolve(fileName string) *ast.SourceFile { + if fileName == "" { + return nil + } + if file, ok := r.cache[fileName]; ok { + return file + } + file := r.resolveUncached(fileName) + r.cache[fileName] = file + return file +} + +func (r *formatFileResolver) resolveUncached(fileName string) *ast.SourceFile { + if file := r.program.GetSourceFile(fileName); file != nil { + return file + } + + // Config files are not program source files. + commandLine := r.program.CommandLine() + if commandLine == nil || commandLine.ConfigFile == nil || commandLine.ConfigFile.SourceFile == nil { + return nil + } + + requestedPath := tspath.ToPath(fileName, r.program.GetCurrentDirectory(), r.program.UseCaseSensitiveFileNames()) + if rootConfig := commandLine.ConfigFile.SourceFile; rootConfig.Path() == requestedPath { + return rootConfig + } + + for _, configFileName := range commandLine.ExtendedSourceFiles() { + if tspath.ToPath(configFileName, r.program.GetCurrentDirectory(), r.program.UseCaseSensitiveFileNames()) != requestedPath { + continue + } + configFileContent, ok := r.sd.snapshot.ReadFile(configFileName) + if !ok { + return nil + } + return tsoptions.NewTsconfigSourceFileFromFilePath(configFileName, requestedPath, configFileContent).SourceFile + } + + return nil +} + +// wireDiagnostic adapts a DiagnosticResponse to diagnosticwriter.Diagnostic. +type wireDiagnostic struct { + resp *DiagnosticResponse + file diagnosticwriter.FileLike + pos int // UTF-8 byte offset + end int // UTF-8 byte offset + chain []diagnosticwriter.Diagnostic + related []diagnosticwriter.Diagnostic +} + +func newWireDiagnostic( + resp *DiagnosticResponse, + resolver *formatFileResolver, + snapshot SnapshotID, + project ProjectID, +) (*wireDiagnostic, error) { + if resp.OriginSnapshot != snapshot || resp.OriginProject != project { + return nil, fmt.Errorf("%w: diagnostic was not produced by this program", ErrClientError) + } + + sourceFile := resolver.resolve(resp.FileName) + if resp.FileName != "" && sourceFile == nil { + return nil, fmt.Errorf("%w: diagnostic source file not found: %s", ErrClientError, resp.FileName) + } + + pos, end := resp.Pos, resp.End + var file diagnosticwriter.FileLike + if sourceFile != nil { + positionMap := sourceFile.GetPositionMap() + pos = positionMap.UTF16ToUTF8(resp.Pos) + end = positionMap.UTF16ToUTF8(resp.End) + textLength := len(sourceFile.Text()) + pos = max(0, min(pos, textLength)) + end = max(pos, min(end, textLength)) + file = sourceFile + if resp.DisplayFileName != "" { + file = &diagnosticDisplayFile{ + SourceFile: sourceFile, + fileName: resp.DisplayFileName, + } + } + } + + wd := &wireDiagnostic{resp: resp, file: file, pos: pos, end: end} + + if len(resp.MessageChain) > 0 { + wd.chain = make([]diagnosticwriter.Diagnostic, len(resp.MessageChain)) + for i, c := range resp.MessageChain { + diag, err := newWireDiagnostic(c, resolver, snapshot, project) + if err != nil { + return nil, err + } + wd.chain[i] = diag + } + } + if len(resp.RelatedInformation) > 0 { + wd.related = make([]diagnosticwriter.Diagnostic, len(resp.RelatedInformation)) + for i, ri := range resp.RelatedInformation { + diag, err := newWireDiagnostic(ri, resolver, snapshot, project) + if err != nil { + return nil, err + } + wd.related[i] = diag + } + } + + return wd, nil +} + +type diagnosticDisplayFile struct { + *ast.SourceFile + fileName string +} + +func (f *diagnosticDisplayFile) FileName() string { + return f.fileName +} + +func (f *diagnosticDisplayFile) FileNameIsFormatted() bool { + return true +} + +func (d *wireDiagnostic) File() diagnosticwriter.FileLike { + return d.file +} + +func (d *wireDiagnostic) Pos() int { return d.pos } +func (d *wireDiagnostic) End() int { return d.end } +func (d *wireDiagnostic) Len() int { return d.end - d.pos } +func (d *wireDiagnostic) Code() int32 { return d.resp.Code } +func (d *wireDiagnostic) Category() diagnostics.Category { return d.resp.Category } +func (d *wireDiagnostic) Source() string { return d.resp.Source } +func (d *wireDiagnostic) Localize(_ locale.Locale) string { return d.resp.Text } + +func (d *wireDiagnostic) MessageChain() []diagnosticwriter.Diagnostic { return d.chain } +func (d *wireDiagnostic) RelatedInformation() []diagnosticwriter.Diagnostic { return d.related } diff --git a/tsc/internal/api/proto.go b/tsc/internal/api/proto.go index 8178bf0cbef04..74534d56e7507 100644 --- a/tsc/internal/api/proto.go +++ b/tsc/internal/api/proto.go @@ -180,14 +180,16 @@ const ( MethodGetCompletionsAtPosition Method = "getCompletionsAtPosition" // Diagnostic methods - MethodGetSyntacticDiagnostics Method = "getSyntacticDiagnostics" - MethodGetBindDiagnostics Method = "getBindDiagnostics" - MethodGetSemanticDiagnostics Method = "getSemanticDiagnostics" - MethodGetSuggestionDiagnostics Method = "getSuggestionDiagnostics" - MethodGetDeclarationDiagnostics Method = "getDeclarationDiagnostics" - MethodGetProgramDiagnostics Method = "getProgramDiagnostics" - MethodGetGlobalDiagnostics Method = "getGlobalDiagnostics" - MethodGetConfigFileParsingDiagnostics Method = "getConfigFileParsingDiagnostics" + MethodGetSyntacticDiagnostics Method = "getSyntacticDiagnostics" + MethodGetBindDiagnostics Method = "getBindDiagnostics" + MethodGetSemanticDiagnostics Method = "getSemanticDiagnostics" + MethodGetSuggestionDiagnostics Method = "getSuggestionDiagnostics" + MethodGetDeclarationDiagnostics Method = "getDeclarationDiagnostics" + MethodGetProgramDiagnostics Method = "getProgramDiagnostics" + MethodGetGlobalDiagnostics Method = "getGlobalDiagnostics" + MethodGetConfigFileParsingDiagnostics Method = "getConfigFileParsingDiagnostics" + MethodFormatDiagnostics Method = "formatDiagnostics" + MethodFormatDiagnosticsWithColorAndContext Method = "formatDiagnosticsWithColorAndContext" // Emitter methods MethodPrintNode Method = "printNode" @@ -465,82 +467,84 @@ var unmarshalers = map[Method]func([]byte) (any, error){ MethodGetThisParameterOfSignature: unmarshallerFor[GetSignaturePropertyParams], MethodGetTargetOfSignature: unmarshallerFor[GetSignaturePropertyParams], - MethodGetContextualType: unmarshallerFor[GetContextualTypeParams], - MethodGetBaseTypeOfLiteralType: unmarshallerFor[GetBaseTypeOfLiteralTypeParams], - MethodGetNonNullableType: unmarshallerFor[GetTypePropertyParams], - MethodGetTypeFromTypeNode: unmarshallerFor[GetTypeFromTypeNodeParams], - MethodGetWidenedType: unmarshallerFor[GetWidenedTypeParams], - MethodGetParameterType: unmarshallerFor[GetParameterTypeParams], - MethodGetTypeParameterAtPosition: unmarshallerFor[GetParameterTypeParams], - MethodIsArrayLikeType: unmarshallerFor[IsArrayLikeTypeParams], - MethodIsTypeAssignableTo: unmarshallerFor[IsTypeAssignableToParams], - MethodGetShorthandAssignmentValueSymbol: unmarshallerFor[GetTypeAtLocationParams], - MethodGetTypeOfSymbolAtLocation: unmarshallerFor[GetTypeOfSymbolAtLocationParams], - MethodTypeToTypeNode: unmarshallerFor[TypeToTypeNodeParams], - MethodSignatureToSignatureDeclaration: unmarshallerFor[SignatureToSignatureDeclarationParams], - MethodTypeToString: unmarshallerFor[TypeToTypeNodeParams], - MethodIsContextSensitive: unmarshallerFor[GetContextualTypeParams], - MethodGetReturnTypeOfSignature: unmarshallerFor[GetSignaturePropertyParams], - MethodGetRestTypeOfSignature: unmarshallerFor[CheckerSignatureParams], - MethodGetTypePredicateOfSignature: unmarshallerFor[CheckerSignatureParams], - MethodGetBaseTypes: unmarshallerFor[CheckerTypeParams], - MethodGetPropertiesOfType: unmarshallerFor[CheckerTypeParams], - MethodGetApparentPropertiesOfType: unmarshallerFor[GetTypePropertyParams], - MethodGetApparentType: unmarshallerFor[GetTypePropertyParams], - MethodGetPropertyOfType: unmarshallerFor[GetPropertyOfTypeParams], - MethodGetIndexInfosOfType: unmarshallerFor[CheckerTypeParams], - MethodGetConstraintOfTypeParameter: unmarshallerFor[GetTypePropertyParams], - MethodGetBaseConstraintOfType: unmarshallerFor[CheckerTypeParams], - MethodGetDefaultFromTypeParameter: unmarshallerFor[GetTypePropertyParams], - MethodGetTypeArguments: unmarshallerFor[CheckerTypeParams], - MethodGetImportAdderEdits: unmarshallerFor[GetImportAdderEditsParams], - MethodGetConstantValue: unmarshallerFor[CheckerNodeParams], - MethodGetSignatureFromDeclaration: unmarshallerFor[CheckerNodeParams], - MethodGetExportSpecifierLocalTarget: unmarshallerFor[CheckerNodeParams], - MethodGetAliasedSymbol: unmarshallerFor[CheckerSymbolParams], - MethodGetImmediateAliasedSymbol: unmarshallerFor[CheckerSymbolParams], - MethodGetFullyQualifiedName: unmarshallerFor[CheckerSymbolParams], - MethodGetExportsOfModule: unmarshallerFor[CheckerSymbolParams], - MethodGetMemberInModuleExports: unmarshallerFor[GetMemberInModuleExportsParams], - MethodGetJSDocTags: unmarshallerFor[CheckerSymbolParams], - MethodGetDocumentationComment: unmarshallerFor[CheckerSymbolParams], - MethodIsArrayType: unmarshallerFor[CheckerTypeParams], - MethodIsTupleType: unmarshallerFor[CheckerTypeParams], - MethodGetReferencesToSymbolInFile: unmarshallerFor[GetReferencesToSymbolInFileParams], - MethodGetReferencedSymbolsForNode: unmarshallerFor[GetReferencedSymbolsForNodeParams], - MethodGetSignatureUsages: unmarshallerFor[GetSignatureUsagesParams], - MethodGetCompletionsAtPosition: unmarshallerFor[GetCompletionsAtPositionParams], - MethodPrintNode: unmarshallerFor[PrintNodeParams], - MethodFormatNodeForInsertion: unmarshallerFor[FormatNodeForInsertionParams], - MethodEmit: unmarshallerFor[EmitParams], - MethodEmitToString: unmarshallerFor[EmitParams], - MethodGetJavaScriptEmit: unmarshallerFor[SelectedFilesEmitParams], - MethodGetDeclarationEmit: unmarshallerFor[SelectedFilesEmitParams], - MethodGetAnyType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetStringType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetNumberType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetBooleanType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetVoidType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetUndefinedType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetNullType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetNeverType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetUnknownType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetBigIntType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetESSymbolType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetNonPrimitiveType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetWellKnownSymbols: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetWellKnownSignatures: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetSyntacticDiagnostics: unmarshallerFor[GetDiagnosticsParams], - MethodGetBindDiagnostics: unmarshallerFor[GetDiagnosticsParams], - MethodGetSemanticDiagnostics: unmarshallerFor[GetDiagnosticsParams], - MethodGetSuggestionDiagnostics: unmarshallerFor[GetDiagnosticsParams], - MethodGetDeclarationDiagnostics: unmarshallerFor[GetDiagnosticsParams], - MethodGetProgramDiagnostics: unmarshallerFor[GetProjectDiagnosticsParams], - MethodGetGlobalDiagnostics: unmarshallerFor[GetProjectDiagnosticsParams], - MethodGetConfigFileParsingDiagnostics: unmarshallerFor[GetProjectDiagnosticsParams], - MethodStartCPUProfile: unmarshallerFor[ProfileParams], - MethodStopCPUProfile: noParams, - MethodSaveHeapProfile: unmarshallerFor[ProfileParams], + MethodGetContextualType: unmarshallerFor[GetContextualTypeParams], + MethodGetBaseTypeOfLiteralType: unmarshallerFor[GetBaseTypeOfLiteralTypeParams], + MethodGetNonNullableType: unmarshallerFor[GetTypePropertyParams], + MethodGetTypeFromTypeNode: unmarshallerFor[GetTypeFromTypeNodeParams], + MethodGetWidenedType: unmarshallerFor[GetWidenedTypeParams], + MethodGetParameterType: unmarshallerFor[GetParameterTypeParams], + MethodGetTypeParameterAtPosition: unmarshallerFor[GetParameterTypeParams], + MethodIsArrayLikeType: unmarshallerFor[IsArrayLikeTypeParams], + MethodIsTypeAssignableTo: unmarshallerFor[IsTypeAssignableToParams], + MethodGetShorthandAssignmentValueSymbol: unmarshallerFor[GetTypeAtLocationParams], + MethodGetTypeOfSymbolAtLocation: unmarshallerFor[GetTypeOfSymbolAtLocationParams], + MethodTypeToTypeNode: unmarshallerFor[TypeToTypeNodeParams], + MethodSignatureToSignatureDeclaration: unmarshallerFor[SignatureToSignatureDeclarationParams], + MethodTypeToString: unmarshallerFor[TypeToTypeNodeParams], + MethodIsContextSensitive: unmarshallerFor[GetContextualTypeParams], + MethodGetReturnTypeOfSignature: unmarshallerFor[GetSignaturePropertyParams], + MethodGetRestTypeOfSignature: unmarshallerFor[CheckerSignatureParams], + MethodGetTypePredicateOfSignature: unmarshallerFor[CheckerSignatureParams], + MethodGetBaseTypes: unmarshallerFor[CheckerTypeParams], + MethodGetPropertiesOfType: unmarshallerFor[CheckerTypeParams], + MethodGetApparentPropertiesOfType: unmarshallerFor[GetTypePropertyParams], + MethodGetApparentType: unmarshallerFor[GetTypePropertyParams], + MethodGetPropertyOfType: unmarshallerFor[GetPropertyOfTypeParams], + MethodGetIndexInfosOfType: unmarshallerFor[CheckerTypeParams], + MethodGetConstraintOfTypeParameter: unmarshallerFor[GetTypePropertyParams], + MethodGetBaseConstraintOfType: unmarshallerFor[CheckerTypeParams], + MethodGetDefaultFromTypeParameter: unmarshallerFor[GetTypePropertyParams], + MethodGetTypeArguments: unmarshallerFor[CheckerTypeParams], + MethodGetImportAdderEdits: unmarshallerFor[GetImportAdderEditsParams], + MethodGetConstantValue: unmarshallerFor[CheckerNodeParams], + MethodGetSignatureFromDeclaration: unmarshallerFor[CheckerNodeParams], + MethodGetExportSpecifierLocalTarget: unmarshallerFor[CheckerNodeParams], + MethodGetAliasedSymbol: unmarshallerFor[CheckerSymbolParams], + MethodGetImmediateAliasedSymbol: unmarshallerFor[CheckerSymbolParams], + MethodGetFullyQualifiedName: unmarshallerFor[CheckerSymbolParams], + MethodGetExportsOfModule: unmarshallerFor[CheckerSymbolParams], + MethodGetMemberInModuleExports: unmarshallerFor[GetMemberInModuleExportsParams], + MethodGetJSDocTags: unmarshallerFor[CheckerSymbolParams], + MethodGetDocumentationComment: unmarshallerFor[CheckerSymbolParams], + MethodIsArrayType: unmarshallerFor[CheckerTypeParams], + MethodIsTupleType: unmarshallerFor[CheckerTypeParams], + MethodGetReferencesToSymbolInFile: unmarshallerFor[GetReferencesToSymbolInFileParams], + MethodGetReferencedSymbolsForNode: unmarshallerFor[GetReferencedSymbolsForNodeParams], + MethodGetSignatureUsages: unmarshallerFor[GetSignatureUsagesParams], + MethodGetCompletionsAtPosition: unmarshallerFor[GetCompletionsAtPositionParams], + MethodPrintNode: unmarshallerFor[PrintNodeParams], + MethodFormatNodeForInsertion: unmarshallerFor[FormatNodeForInsertionParams], + MethodEmit: unmarshallerFor[EmitParams], + MethodEmitToString: unmarshallerFor[EmitParams], + MethodGetJavaScriptEmit: unmarshallerFor[SelectedFilesEmitParams], + MethodGetDeclarationEmit: unmarshallerFor[SelectedFilesEmitParams], + MethodGetAnyType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetStringType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetNumberType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetBooleanType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetVoidType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetUndefinedType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetNullType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetNeverType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetUnknownType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetBigIntType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetESSymbolType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetNonPrimitiveType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetWellKnownSymbols: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetWellKnownSignatures: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetSyntacticDiagnostics: unmarshallerFor[GetDiagnosticsParams], + MethodGetBindDiagnostics: unmarshallerFor[GetDiagnosticsParams], + MethodGetSemanticDiagnostics: unmarshallerFor[GetDiagnosticsParams], + MethodGetSuggestionDiagnostics: unmarshallerFor[GetDiagnosticsParams], + MethodGetDeclarationDiagnostics: unmarshallerFor[GetDiagnosticsParams], + MethodGetProgramDiagnostics: unmarshallerFor[GetProjectDiagnosticsParams], + MethodGetGlobalDiagnostics: unmarshallerFor[GetProjectDiagnosticsParams], + MethodGetConfigFileParsingDiagnostics: unmarshallerFor[GetProjectDiagnosticsParams], + MethodFormatDiagnostics: unmarshallerFor[FormatDiagnosticsParams], + MethodFormatDiagnosticsWithColorAndContext: unmarshallerFor[FormatDiagnosticsParams], + MethodStartCPUProfile: unmarshallerFor[ProfileParams], + MethodStopCPUProfile: noParams, + MethodSaveHeapProfile: unmarshallerFor[ProfileParams], } type ParseConfigFileParams struct { @@ -1421,6 +1425,8 @@ type DiagnosticResponse struct { Code int32 `json:"code"` // Category is the diagnostic category (error, warning, suggestion, message). Category diagnostics.Category `json:"category"` + // Source is a custom diagnostic-code prefix. An empty value uses the default "TS". + Source string `json:"source,omitempty"` // Text is the localized diagnostic message text. Text string `json:"text"` // ReportsUnnecessary indicates this diagnostic highlights unnecessary code. @@ -1431,6 +1437,11 @@ type DiagnosticResponse struct { MessageChain []*DiagnosticResponse `json:"messageChain,omitempty"` // RelatedInformation contains related diagnostic information, if any. RelatedInformation []*DiagnosticResponse `json:"relatedInformation,omitempty"` + // OriginSnapshot and OriginProject identify the program that produced this diagnostic. + OriginSnapshot SnapshotID `json:"originSnapshot,omitzero"` + OriginProject ProjectID `json:"originProject,omitzero"` + // DisplayFileName is the host-formatted file name used only for diagnostic output. + DisplayFileName string `json:"displayFileName,omitempty"` } // NewDiagnosticResponse converts an ast.Diagnostic to a DiagnosticResponse. @@ -1448,6 +1459,7 @@ func NewDiagnosticResponse(d *ast.Diagnostic) *DiagnosticResponse { End: end, Code: d.Code(), Category: d.Category(), + Source: d.Source(), Text: d.Localize(locale.Default), ReportsUnnecessary: d.ReportsUnnecessary(), ReportsDeprecated: d.ReportsDeprecated(), @@ -1486,6 +1498,20 @@ func NewDiagnosticResponses(diags []*ast.Diagnostic) []*DiagnosticResponse { return result } +// FormatDiagnosticsParams are parameters for diagnostic formatting methods. +type FormatDiagnosticsParams struct { + Snapshot SnapshotID `json:"snapshot"` + Project ProjectID `json:"project"` + Diagnostics []*DiagnosticResponse `json:"diagnostics"` + NewLine string `json:"newLine"` +} + +// FormatDiagnosticsResponse is the response for diagnostic formatting methods. +type FormatDiagnosticsResponse struct { + // Output is the fully formatted diagnostics text. + Output string `json:"output"` +} + func unmarshalPayload(method string, payload json.Value) (any, error) { unmarshaler, ok := unmarshalers[Method(method)] if !ok { diff --git a/tsc/internal/api/session.go b/tsc/internal/api/session.go index e87e02c9b7ca3..384cab2fa039c 100644 --- a/tsc/internal/api/session.go +++ b/tsc/internal/api/session.go @@ -859,6 +859,10 @@ func (s *Session) HandleRequest(ctx context.Context, method string, params json. return s.handleGetGlobalDiagnostics(ctx, parsed.(*GetProjectDiagnosticsParams)) case string(MethodGetConfigFileParsingDiagnostics): return s.handleGetConfigFileParsingDiagnostics(ctx, parsed.(*GetProjectDiagnosticsParams)) + case string(MethodFormatDiagnostics): + return s.handleFormatDiagnostics(ctx, parsed.(*FormatDiagnosticsParams), false /*colorAndContext*/) + case string(MethodFormatDiagnosticsWithColorAndContext): + return s.handleFormatDiagnostics(ctx, parsed.(*FormatDiagnosticsParams), true /*colorAndContext*/) case string(MethodStartCPUProfile): return s.handleStartCPUProfile(ctx, parsed.(*ProfileParams)) case string(MethodStopCPUProfile): diff --git a/tsc/internal/api/session_format_diagnostics_test.go b/tsc/internal/api/session_format_diagnostics_test.go new file mode 100644 index 0000000000000..3bea9603f9568 --- /dev/null +++ b/tsc/internal/api/session_format_diagnostics_test.go @@ -0,0 +1,346 @@ +package api + +import ( + "context" + "strings" + "testing" + + "github.com/microsoft/TypeScript/tsc/internal/bundled" + "github.com/microsoft/TypeScript/tsc/internal/diagnostics" + "github.com/microsoft/TypeScript/tsc/internal/testutil/projecttestutil" + "gotest.tools/v3/assert" +) + +func setupFormatSession(t *testing.T, files map[string]any, mainFile string) (*Session, SnapshotID, ProjectID) { + t.Helper() + projectSession, _ := projecttestutil.Setup(files) + t.Cleanup(projectSession.Close) + session := NewSession(projectSession, nil) + t.Cleanup(session.Close) + + ctx := context.Background() + snap, err := session.handleUpdateSnapshot(ctx, &UpdateSnapshotParams{ + OpenFiles: []DocumentIdentifier{{FileName: mainFile}}, + }) + assert.NilError(t, err) + proj, err := session.handleGetDefaultProjectForFile(ctx, &GetDefaultProjectForFileParams{ + Snapshot: snap.Snapshot, + File: DocumentIdentifier{FileName: mainFile}, + }) + assert.NilError(t, err) + assert.Assert(t, proj != nil, "file should resolve to a default project") + return session, snap.Snapshot, proj.Id +} + +func formatDiagnosticsParams(snapshot SnapshotID, project ProjectID, diagnostics []*DiagnosticResponse) *FormatDiagnosticsParams { + var setOrigin func([]*DiagnosticResponse) + setOrigin = func(diags []*DiagnosticResponse) { + for _, diag := range diags { + diag.OriginSnapshot = snapshot + diag.OriginProject = project + setOrigin(diag.MessageChain) + setOrigin(diag.RelatedInformation) + } + } + setOrigin(diagnostics) + return &FormatDiagnosticsParams{ + Snapshot: snapshot, + Project: project, + Diagnostics: diagnostics, + NewLine: "\n", + } +} + +func TestFormatDiagnostics(t *testing.T) { + t.Parallel() + if !bundled.Embedded { + t.Skip("bundled files are not embedded") + } + + const fileName = "/home/projects/p/src/index.ts" + const content = "const x: number = \"oops\";\n" + session, snapshot, project := setupFormatSession(t, map[string]any{ + "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + fileName: content, + }, fileName) + ctx := context.Background() + + diags, err := session.handleGetSemanticDiagnostics(ctx, &GetDiagnosticsParams{ + Snapshot: snapshot, + Project: project, + Files: []DocumentIdentifier{{FileName: fileName}}, + }) + assert.NilError(t, err) + assert.Equal(t, len(diags), 1) + + plain, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), false /*colorAndContext*/) + assert.NilError(t, err) + assert.Equal(t, plain.Output, + "home/projects/p/src/index.ts(1,7): error TS2322: Type 'string' is not assignable to type 'number'.\n") + + color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), true /*colorAndContext*/) + assert.NilError(t, err) + assert.Assert(t, strings.Contains(color.Output, "home/projects/p/src/index.ts")) + assert.Assert(t, strings.Contains(color.Output, "error")) + assert.Assert(t, strings.Contains(color.Output, "TS2322: ")) + assert.Assert(t, strings.Contains(color.Output, "Type 'string' is not assignable to type 'number'.")) + assert.Assert(t, strings.Contains(color.Output, "const x: number = \"oops\";")) + assert.Assert(t, strings.Contains(color.Output, "~")) + assert.Assert(t, strings.Contains(color.Output, "\x1b[")) +} + +func TestFormatDiagnosticsPreservesHostFormattedAbsolutePath(t *testing.T) { + t.Parallel() + if !bundled.Embedded { + t.Skip("bundled files are not embedded") + } + + const fileName = "/home/projects/p/src/index.ts" + session, snapshot, project := setupFormatSession(t, map[string]any{ + "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + fileName: `const x: number = "oops";`, + }, fileName) + ctx := context.Background() + + diags, err := session.handleGetSemanticDiagnostics(ctx, &GetDiagnosticsParams{ + Snapshot: snapshot, + Project: project, + Files: []DocumentIdentifier{{FileName: fileName}}, + }) + assert.NilError(t, err) + assert.Equal(t, len(diags), 1) + diags[0].DisplayFileName = "/different/root/index.ts" + + params := formatDiagnosticsParams(snapshot, project, diags) + plain, err := session.handleFormatDiagnostics(ctx, params, false) + assert.NilError(t, err) + assert.Assert(t, strings.HasPrefix(plain.Output, "/different/root/index.ts(1,7): ")) + + color, err := session.handleFormatDiagnostics(ctx, params, true) + assert.NilError(t, err) + assert.Assert(t, strings.Contains(color.Output, "\x1b[96m/different/root/index.ts\x1b[0m:")) +} + +func TestFormatDiagnosticsConfigFileContext(t *testing.T) { + t.Parallel() + if !bundled.Embedded { + t.Skip("bundled files are not embedded") + } + + const configFileName = "/home/projects/p/tsconfig.json" + const config = "{ \"compilerOptions\": { \"target\": \"invalid\" } }" + const mainFile = "/home/projects/p/src/index.ts" + session, snapshot, project := setupFormatSession(t, map[string]any{ + configFileName: config, + mainFile: "export const x = 1;\n", + }, mainFile) + ctx := context.Background() + + diags, err := session.handleGetConfigFileParsingDiagnostics(ctx, &GetProjectDiagnosticsParams{ + Snapshot: snapshot, Project: project, + }) + assert.NilError(t, err) + assert.Equal(t, len(diags), 1) + assert.Equal(t, diags[0].FileName, configFileName) + + plain, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), false) + assert.NilError(t, err) + assert.Assert(t, strings.HasPrefix(plain.Output, "home/projects/p/tsconfig.json(1,34): error TS6046: ")) + + color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), true) + assert.NilError(t, err) + assert.Assert(t, strings.Contains(color.Output, "\"target\": \"invalid\"")) + assert.Assert(t, strings.Contains(color.Output, "~~~~~~~~~")) +} + +func TestFormatDiagnosticsWithoutFile(t *testing.T) { + t.Parallel() + if !bundled.Embedded { + t.Skip("bundled files are not embedded") + } + + const fileName = "/home/projects/p/src/index.ts" + session, snapshot, project := setupFormatSession(t, map[string]any{ + "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + fileName: "export const x = 1;\n", + }, fileName) + ctx := context.Background() + + fileless := []*DiagnosticResponse{{ + Code: 1234, + Category: diagnostics.CategoryError, + Text: "Some global problem.", + RelatedInformation: []*DiagnosticResponse{{ + Code: 5678, + Category: diagnostics.CategoryMessage, + Text: "Additional context.", + }}, + }} + + plain, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, fileless), false) + assert.NilError(t, err) + assert.Equal(t, plain.Output, "error TS1234: Some global problem.\n") + + color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, fileless), true) + assert.NilError(t, err) + assert.Equal(t, color.Output, + "\x1b[91merror\x1b[0m\x1b[90m TS1234: \x1b[0mSome global problem.\n\n Additional context.\n") +} + +func TestFormatDiagnosticsClampsOutOfRangePositions(t *testing.T) { + t.Parallel() + if !bundled.Embedded { + t.Skip("bundled files are not embedded") + } + + const fileName = "/home/projects/p/src/index.ts" + session, snapshot, project := setupFormatSession(t, map[string]any{ + "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + fileName: "export const x = 1;\n", + }, fileName) + ctx := context.Background() + + stale := []*DiagnosticResponse{{ + FileName: fileName, + Pos: 100_000, + End: 200_000, + Code: 1234, + Category: diagnostics.CategoryError, + Text: "Stale diagnostic.", + }} + + plain, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, stale), false) + assert.NilError(t, err) + assert.Equal(t, plain.Output, + "home/projects/p/src/index.ts(2,1): error TS1234: Stale diagnostic.\n") + + color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, stale), true) + assert.NilError(t, err) + assert.Assert(t, strings.Contains(color.Output, "TS1234: ")) + assert.Assert(t, strings.Contains(color.Output, "Stale diagnostic.")) +} + +func TestFormatDiagnosticsRejectsMismatchedOrMissingSources(t *testing.T) { + t.Parallel() + if !bundled.Embedded { + t.Skip("bundled files are not embedded") + } + + const fileName = "/home/projects/p/src/index.ts" + session, snapshot, project := setupFormatSession(t, map[string]any{ + "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + fileName: "export const x = 1;\n", + }, fileName) + ctx := context.Background() + + mismatched := formatDiagnosticsParams(snapshot, project, []*DiagnosticResponse{{ + Code: 1234, + Category: diagnostics.CategoryError, + Text: "Wrong program.", + }}) + mismatched.Diagnostics[0].OriginSnapshot++ + _, err := session.handleFormatDiagnostics(ctx, mismatched, false) + assert.ErrorContains(t, err, "diagnostic was not produced by this program") + + missing := formatDiagnosticsParams(snapshot, project, []*DiagnosticResponse{{ + FileName: "/home/projects/p/src/missing.ts", + Code: 1234, + Category: diagnostics.CategoryError, + Text: "Missing source.", + }}) + _, err = session.handleFormatDiagnostics(ctx, missing, false) + assert.ErrorContains(t, err, "diagnostic source file not found") +} + +func TestFormatDiagnosticsNonASCIIPositions(t *testing.T) { + t.Parallel() + if !bundled.Embedded { + t.Skip("bundled files are not embedded") + } + + const fileName = "/home/projects/p/src/index.ts" + // "é" is 2 UTF-8 bytes and 1 UTF-16 code unit. + const content = "const café = 1;\nconst x: number = \"oops\";\n" + session, snapshot, project := setupFormatSession(t, map[string]any{ + "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + fileName: content, + }, fileName) + ctx := context.Background() + + diags, err := session.handleGetSemanticDiagnostics(ctx, &GetDiagnosticsParams{ + Snapshot: snapshot, Project: project, Files: []DocumentIdentifier{{FileName: fileName}}, + }) + assert.NilError(t, err) + assert.Equal(t, len(diags), 1) + + plain, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), false) + assert.NilError(t, err) + assert.Equal(t, plain.Output, + "home/projects/p/src/index.ts(2,7): error TS2322: Type 'string' is not assignable to type 'number'.\n") + + color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), true) + assert.NilError(t, err) + assert.Assert(t, strings.Contains(color.Output, "const x: number = \"oops\";")) + assert.Assert(t, strings.Contains(color.Output, "~")) +} + +func TestFormatDiagnosticsAstralPositions(t *testing.T) { + t.Parallel() + if !bundled.Embedded { + t.Skip("bundled files are not embedded") + } + + const fileName = "/home/projects/p/src/index.ts" + // "😀" is 4 UTF-8 bytes and 2 UTF-16 code units. + const content = "const emoji = \"😀\";\nconst x: number = \"oops\";\n" + session, snapshot, project := setupFormatSession(t, map[string]any{ + "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + fileName: content, + }, fileName) + ctx := context.Background() + + diags, err := session.handleGetSemanticDiagnostics(ctx, &GetDiagnosticsParams{ + Snapshot: snapshot, Project: project, Files: []DocumentIdentifier{{FileName: fileName}}, + }) + assert.NilError(t, err) + assert.Equal(t, len(diags), 1) + + plain, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), false) + assert.NilError(t, err) + assert.Equal(t, plain.Output, + "home/projects/p/src/index.ts(2,7): error TS2322: Type 'string' is not assignable to type 'number'.\n") + + color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), true) + assert.NilError(t, err) + assert.Assert(t, strings.Contains(color.Output, "const x: number = \"oops\";")) + assert.Assert(t, strings.Contains(color.Output, "~")) +} + +func TestFormatDiagnosticsMessageChainAndRelatedInformation(t *testing.T) { + t.Parallel() + if !bundled.Embedded { + t.Skip("bundled files are not embedded") + } + + const fileName = "/home/projects/p/src/index.ts" + const content = "interface Props { callback: (x: string) => void }\nconst p: Props = { callback: (x: number) => {} };\n" + session, snapshot, project := setupFormatSession(t, map[string]any{ + "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + fileName: content, + }, fileName) + ctx := context.Background() + + diags, err := session.handleGetSemanticDiagnostics(ctx, &GetDiagnosticsParams{ + Snapshot: snapshot, Project: project, Files: []DocumentIdentifier{{FileName: fileName}}, + }) + assert.NilError(t, err) + assert.Equal(t, len(diags), 1) + assert.Assert(t, len(diags[0].MessageChain) > 0, "expected a message chain") + assert.Assert(t, len(diags[0].RelatedInformation) > 0, "expected related information") + + color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), true) + assert.NilError(t, err) + assert.Assert(t, strings.Contains(color.Output, "is not assignable to type")) + assert.Assert(t, strings.Contains(color.Output, "Types of parameters 'x' and 'x' are incompatible.")) + assert.Assert(t, strings.Contains(color.Output, "The expected type comes from property 'callback'")) +} diff --git a/tsc/internal/diagnosticwriter/diagnosticwriter.go b/tsc/internal/diagnosticwriter/diagnosticwriter.go index 57aee4053410c..01626fb62a962 100644 --- a/tsc/internal/diagnosticwriter/diagnosticwriter.go +++ b/tsc/internal/diagnosticwriter/diagnosticwriter.go @@ -199,13 +199,7 @@ const ( ) func FormatDiagnosticsWithColorAndContext(output io.Writer, diags []Diagnostic, formatOpts *FormattingOptions) { - if len(diags) == 0 { - return - } - for i, diagnostic := range diags { - if i > 0 { - fmt.Fprint(output, formatOpts.NewLine) - } + for _, diagnostic := range diags { FormatDiagnosticWithColorAndContext(output, diagnostic, formatOpts) } } @@ -225,10 +219,10 @@ func FormatDiagnosticWithColorAndContext(output io.Writer, diagnostic Diagnostic if diagnostic.File() != nil && diagnostic.Code() != diagnostics.File_appears_to_be_binary.Code() { fmt.Fprint(output, formatOpts.NewLine) writeCodeSnippet(output, diagnostic.File(), diagnostic.Pos(), diagnostic.Len(), getCategoryFormat(diagnostic.Category()), "", formatOpts) - fmt.Fprint(output, formatOpts.NewLine) } - if (diagnostic.RelatedInformation() != nil) && (len(diagnostic.RelatedInformation()) > 0) { + if len(diagnostic.RelatedInformation()) > 0 { + fmt.Fprint(output, formatOpts.NewLine) for _, relatedInformation := range diagnostic.RelatedInformation() { file := relatedInformation.File() if file != nil { @@ -236,13 +230,14 @@ func FormatDiagnosticWithColorAndContext(output io.Writer, diagnostic Diagnostic fmt.Fprint(output, " ") pos := relatedInformation.Pos() WriteLocation(output, file, pos, formatOpts, writeWithStyleAndReset) - fmt.Fprint(output, " - ") - WriteFlattenedDiagnosticMessage(output, relatedInformation, formatOpts.NewLine, formatOpts.Locale) writeCodeSnippet(output, file, pos, relatedInformation.Len(), foregroundColorEscapeCyan, " ", formatOpts) } fmt.Fprint(output, formatOpts.NewLine) + fmt.Fprint(output, " ") + WriteFlattenedDiagnosticMessage(output, relatedInformation, formatOpts.NewLine, formatOpts.Locale) } } + fmt.Fprint(output, formatOpts.NewLine) } func writeCodeSnippet(writer io.Writer, sourceFile FileLike, start int, length int, squiggleColor string, indent string, formatOpts *FormattingOptions) { @@ -393,7 +388,7 @@ func writeWithStyleAndReset(output io.Writer, text string, formatStyle string) { func WriteLocation(output io.Writer, file FileLike, pos int, formatOpts *FormattingOptions, writeWithStyleAndReset FormattedWriter) { firstLine, firstChar := scanner.GetECMALineAndUTF16CharacterOfPosition(file, pos) var relativeFileName string - if formatOpts != nil { + if formatOpts != nil && !fileNameIsFormatted(file) { relativeFileName = tspath.ConvertToRelativePath(file.FileName(), formatOpts.ComparePathsOptions) } else { relativeFileName = file.FileName() @@ -556,7 +551,10 @@ func WriteFormatDiagnostic(output io.Writer, diagnostic Diagnostic, formatOpts * if diagnostic.File() != nil { line, character := scanner.GetECMALineAndUTF16CharacterOfPosition(diagnostic.File(), diagnostic.Pos()) fileName := diagnostic.File().FileName() - relativeFileName := tspath.ConvertToRelativePath(fileName, formatOpts.ComparePathsOptions) + relativeFileName := fileName + if !fileNameIsFormatted(diagnostic.File()) { + relativeFileName = tspath.ConvertToRelativePath(fileName, formatOpts.ComparePathsOptions) + } fmt.Fprintf(output, "%s(%d,%d): ", relativeFileName, line+1, int(character)+1) } @@ -565,6 +563,11 @@ func WriteFormatDiagnostic(output io.Writer, diagnostic Diagnostic, formatOpts * fmt.Fprint(output, formatOpts.NewLine) } +func fileNameIsFormatted(file FileLike) bool { + formatted, ok := file.(interface{ FileNameIsFormatted() bool }) + return ok && formatted.FileNameIsFormatted() +} + func FormatDiagnosticsStatusWithColorAndTime(output io.Writer, time string, diag Diagnostic, formatOpts *FormattingOptions) { fmt.Fprint(output, "[") writeWithStyleAndReset(output, time, foregroundColorEscapeGrey) diff --git a/tsc/internal/tsoptions/tsconfigparsing_test.go b/tsc/internal/tsoptions/tsconfigparsing_test.go index 9b4d054bbacec..ead33c504486e 100644 --- a/tsc/internal/tsoptions/tsconfigparsing_test.go +++ b/tsc/internal/tsoptions/tsconfigparsing_test.go @@ -146,7 +146,9 @@ func TestParseConfigFileTextToJson(t *testing.T) { UseCaseSensitiveFileNames: true, }, }) - baselineContent.WriteString("\n") + if len(errors) == 0 { + baselineContent.WriteString("\n") + } if i != len(rec.input)-1 { baselineContent.WriteString("\n") } @@ -1478,7 +1480,9 @@ func baselineParseConfigWith(t *testing.T, baselineFileName string, includeCompi UseCaseSensitiveFileNames: true, }, }) - baselineContent.WriteString("\n") + if len(parsedConfigFileContent.Errors) == 0 { + baselineContent.WriteString("\n") + } if i != len(input)-1 { baselineContent.WriteString("\n") } diff --git a/tsc/testdata/baselines/reference/compiler/contentMapperDiagnosticDirectives.contentmapper b/tsc/testdata/baselines/reference/compiler/contentMapperDiagnosticDirectives.contentmapper index aeafe71315828..b5a663f3e2199 100644 --- a/tsc/testdata/baselines/reference/compiler/contentMapperDiagnosticDirectives.contentmapper +++ b/tsc/testdata/baselines/reference/compiler/contentMapperDiagnosticDirectives.contentmapper @@ -41,27 +41,22 @@ export const broken = undefined 7 // @box-expect-error: Syntax errors do not satisfy expectations. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /widget.box:10:1 - error box2578: Unused second expectation. 10 // @box-expect-error: Unused second expectation. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /widget.box:8:21 - error TS1109: Expression expected. 8 const syntaxError = ; ~ - /widget.box:13:7 - error TS2322: Type 'string' is not assignable to type 'number'. 13 const visible: number = "wrong"; ~~~~~~~ - /widget.box:15:1 - error box2578: Mapper diagnostics do not satisfy expectations. 15 // @box-expect-error: Mapper diagnostics do not satisfy expectations. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /widget.box:16:23 - error box1000: Unclosed interpolation. 16 export const broken = #{unterminated; diff --git a/tsc/testdata/baselines/reference/compiler/contentMapperDiagnostics.contentmapper b/tsc/testdata/baselines/reference/compiler/contentMapperDiagnostics.contentmapper index 223287609cb54..088e43b12d109 100644 --- a/tsc/testdata/baselines/reference/compiler/contentMapperDiagnostics.contentmapper +++ b/tsc/testdata/baselines/reference/compiler/contentMapperDiagnostics.contentmapper @@ -15,12 +15,10 @@ export const broken = undefined 1 export const count: number = "not a number"; ~~~~~ - /widget.box:2:14 - error TS2322: Type 'number' is not assignable to type 'string'. 2 export const label: string = #{target}; ~~~~~ - /widget.box:3:23 - error box1000: Unclosed interpolation. 3 export const broken = #{unterminated; diff --git a/tsc/testdata/baselines/reference/compiler/contentMapperInvalidDiagnosticDirectives.contentmapper b/tsc/testdata/baselines/reference/compiler/contentMapperInvalidDiagnosticDirectives.contentmapper index 8ea467db00dd4..9c5858339f865 100644 --- a/tsc/testdata/baselines/reference/compiler/contentMapperInvalidDiagnosticDirectives.contentmapper +++ b/tsc/testdata/baselines/reference/compiler/contentMapperInvalidDiagnosticDirectives.contentmapper @@ -30,25 +30,21 @@ 1 ~ - /invalidPolicy.invalidpolicy:1:1 - error TS100025: The content mapper 'mapper' failed to transform this file. The content mapper returned a diagnostic directive with invalid policy '2'. 1 ~ - /invalidRange.invalidrange:1:1 - error TS100025: The content mapper 'mapper' failed to transform this file. Diagnostic directive 0 returned by the content mapper has an invalid range. 1 ~ - /invalidUnusedDiagnosticIndex.invalidunusedindex:1:1 - error TS100025: The content mapper 'mapper' failed to transform this file. Diagnostic directive 0 returned by the content mapper has an invalid 'unusedExpectDirectiveIndex'. 1 ~ - /overlap.overlap:1:1 - error TS100025: The content mapper 'mapper' failed to transform this file. The content mapper returned diagnostic directives with overlapping virtual ranges. diff --git a/tsc/testdata/baselines/reference/compiler/deeplyNestedAssignabilityIssue.errors.txt b/tsc/testdata/baselines/reference/compiler/deeplyNestedAssignabilityIssue.errors.txt index 27a65bedc6dbd..5add2fd996c3a 100644 --- a/tsc/testdata/baselines/reference/compiler/deeplyNestedAssignabilityIssue.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/deeplyNestedAssignabilityIssue.errors.txt @@ -3,26 +3,27 @@ 22 thing: {}    ~~~~~ - deeplyNestedAssignabilityIssue.ts:2:5 - 'a' is declared here. + deeplyNestedAssignabilityIssue.ts:2:5 2 a: number;    ~ - - deeplyNestedAssignabilityIssue.ts:9:17 - The expected type comes from property 'thing' which is declared here on type '{ thing: A; }' + 'a' is declared here. + deeplyNestedAssignabilityIssue.ts:9:17 9 thing: A;    ~~~~~ - + The expected type comes from property 'thing' which is declared here on type '{ thing: A; }' deeplyNestedAssignabilityIssue.ts:25:17 - error TS2741: Property 'a' is missing in type '{}' but required in type 'A'. 25 another: {}    ~~~~~~~ - deeplyNestedAssignabilityIssue.ts:2:5 - 'a' is declared here. + deeplyNestedAssignabilityIssue.ts:2:5 2 a: number;    ~ - - deeplyNestedAssignabilityIssue.ts:12:17 - The expected type comes from property 'another' which is declared here on type '{ another: A; }' + 'a' is declared here. + deeplyNestedAssignabilityIssue.ts:12:17 12 another: A;    ~~~~~~~ + The expected type comes from property 'another' which is declared here on type '{ another: A; }' ==== deeplyNestedAssignabilityIssue.ts (2 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans1.errors.txt b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans1.errors.txt index bf30f2c3fc40c..9af458a195d63 100644 --- a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans1.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans1.errors.txt @@ -3,62 +3,63 @@ 1 class Foo { }    ~~~ - file2.ts:1:6 - 'Foo' was also declared here. + file2.ts:1:6 1 type Foo = number;    ~~~ - - file3.ts:1:6 - 'Foo' was also declared here. + 'Foo' was also declared here. + file3.ts:1:6 1 type Foo = 54;    ~~~ - + 'Foo' was also declared here. file1.ts:2:7 - error TS2451: Cannot redeclare block-scoped variable 'Bar'. 2 const Bar = 3;    ~~~ - file2.ts:2:7 - 'Bar' was also declared here. + file2.ts:2:7 2 class Bar {}    ~~~ - - file3.ts:2:5 - 'Bar' was also declared here. + 'Bar' was also declared here. + file3.ts:2:5 2 let Bar = 42    ~~~ - + 'Bar' was also declared here. file2.ts:1:6 - error TS2300: Duplicate identifier 'Foo'. 1 type Foo = number;    ~~~ - file1.ts:1:7 - 'Foo' was also declared here. + file1.ts:1:7 1 class Foo { }    ~~~ - + 'Foo' was also declared here. file2.ts:2:7 - error TS2451: Cannot redeclare block-scoped variable 'Bar'. 2 class Bar {}    ~~~ - file1.ts:2:7 - 'Bar' was also declared here. + file1.ts:2:7 2 const Bar = 3;    ~~~ - + 'Bar' was also declared here. file3.ts:1:6 - error TS2300: Duplicate identifier 'Foo'. 1 type Foo = 54;    ~~~ - file1.ts:1:7 - 'Foo' was also declared here. + file1.ts:1:7 1 class Foo { }    ~~~ - + 'Foo' was also declared here. file3.ts:2:5 - error TS2451: Cannot redeclare block-scoped variable 'Bar'. 2 let Bar = 42    ~~~ - file1.ts:2:7 - 'Bar' was also declared here. + file1.ts:2:7 2 const Bar = 3;    ~~~ + 'Bar' was also declared here. ==== file1.ts (2 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans2.errors.txt b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans2.errors.txt index f26290ce4096f..69e8f479c68ec 100644 --- a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans2.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans2.errors.txt @@ -3,162 +3,163 @@ 1 class A { }    ~ - file2.ts:1:7 - 'A' was also declared here. + file2.ts:1:7 1 class A { }    ~ - + 'A' was also declared here. file1.ts:2:7 - error TS2300: Duplicate identifier 'B'. 2 class B { }    ~ - file2.ts:2:7 - 'B' was also declared here. + file2.ts:2:7 2 class B { }    ~ - + 'B' was also declared here. file1.ts:3:7 - error TS2300: Duplicate identifier 'C'. 3 class C { }    ~ - file2.ts:3:7 - 'C' was also declared here. + file2.ts:3:7 3 class C { }    ~ - + 'C' was also declared here. file1.ts:4:7 - error TS2300: Duplicate identifier 'D'. 4 class D { }    ~ - file2.ts:4:7 - 'D' was also declared here. + file2.ts:4:7 4 class D { }    ~ - + 'D' was also declared here. file1.ts:5:7 - error TS2300: Duplicate identifier 'E'. 5 class E { }    ~ - file2.ts:5:7 - 'E' was also declared here. + file2.ts:5:7 5 class E { }    ~ - + 'E' was also declared here. file1.ts:6:7 - error TS2300: Duplicate identifier 'F'. 6 class F { }    ~ - file2.ts:6:7 - 'F' was also declared here. + file2.ts:6:7 6 class F { }    ~ - + 'F' was also declared here. file1.ts:7:7 - error TS2300: Duplicate identifier 'G'. 7 class G { }    ~ - file2.ts:7:7 - 'G' was also declared here. + file2.ts:7:7 7 class G { }    ~ - + 'G' was also declared here. file1.ts:8:7 - error TS2300: Duplicate identifier 'H'. 8 class H { }    ~ - file2.ts:8:7 - 'H' was also declared here. + file2.ts:8:7 8 class H { }    ~ - + 'H' was also declared here. file1.ts:9:7 - error TS2300: Duplicate identifier 'I'. 9 class I { }    ~ - file2.ts:9:7 - 'I' was also declared here. + file2.ts:9:7 9 class I { }    ~ - + 'I' was also declared here. file2.ts:1:7 - error TS2300: Duplicate identifier 'A'. 1 class A { }    ~ - file1.ts:1:7 - 'A' was also declared here. + file1.ts:1:7 1 class A { }    ~ - + 'A' was also declared here. file2.ts:2:7 - error TS2300: Duplicate identifier 'B'. 2 class B { }    ~ - file1.ts:2:7 - 'B' was also declared here. + file1.ts:2:7 2 class B { }    ~ - + 'B' was also declared here. file2.ts:3:7 - error TS2300: Duplicate identifier 'C'. 3 class C { }    ~ - file1.ts:3:7 - 'C' was also declared here. + file1.ts:3:7 3 class C { }    ~ - + 'C' was also declared here. file2.ts:4:7 - error TS2300: Duplicate identifier 'D'. 4 class D { }    ~ - file1.ts:4:7 - 'D' was also declared here. + file1.ts:4:7 4 class D { }    ~ - + 'D' was also declared here. file2.ts:5:7 - error TS2300: Duplicate identifier 'E'. 5 class E { }    ~ - file1.ts:5:7 - 'E' was also declared here. + file1.ts:5:7 5 class E { }    ~ - + 'E' was also declared here. file2.ts:6:7 - error TS2300: Duplicate identifier 'F'. 6 class F { }    ~ - file1.ts:6:7 - 'F' was also declared here. + file1.ts:6:7 6 class F { }    ~ - + 'F' was also declared here. file2.ts:7:7 - error TS2300: Duplicate identifier 'G'. 7 class G { }    ~ - file1.ts:7:7 - 'G' was also declared here. + file1.ts:7:7 7 class G { }    ~ - + 'G' was also declared here. file2.ts:8:7 - error TS2300: Duplicate identifier 'H'. 8 class H { }    ~ - file1.ts:8:7 - 'H' was also declared here. + file1.ts:8:7 8 class H { }    ~ - + 'H' was also declared here. file2.ts:9:7 - error TS2300: Duplicate identifier 'I'. 9 class I { }    ~ - file1.ts:9:7 - 'I' was also declared here. + file1.ts:9:7 9 class I { }    ~ + 'I' was also declared here. ==== file1.ts (9 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans3.errors.txt b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans3.errors.txt index e61e71853317b..b08664db5ce5a 100644 --- a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans3.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans3.errors.txt @@ -3,54 +3,55 @@ 2 duplicate1: () => string;    ~~~~~~~~~~ - file2.ts:2:5 - 'duplicate1' was also declared here. + file2.ts:2:5 2 duplicate1(): number;    ~~~~~~~~~~ - + 'duplicate1' was also declared here. file1.ts:3:5 - error TS2300: Duplicate identifier 'duplicate2'. 3 duplicate2: () => string;    ~~~~~~~~~~ - file2.ts:3:5 - 'duplicate2' was also declared here. + file2.ts:3:5 3 duplicate2(): number;    ~~~~~~~~~~ - + 'duplicate2' was also declared here. file1.ts:4:5 - error TS2300: Duplicate identifier 'duplicate3'. 4 duplicate3: () => string;    ~~~~~~~~~~ - file2.ts:4:5 - 'duplicate3' was also declared here. + file2.ts:4:5 4 duplicate3(): number;    ~~~~~~~~~~ - + 'duplicate3' was also declared here. file2.ts:2:5 - error TS2300: Duplicate identifier 'duplicate1'. 2 duplicate1(): number;    ~~~~~~~~~~ - file1.ts:2:5 - 'duplicate1' was also declared here. + file1.ts:2:5 2 duplicate1: () => string;    ~~~~~~~~~~ - + 'duplicate1' was also declared here. file2.ts:3:5 - error TS2300: Duplicate identifier 'duplicate2'. 3 duplicate2(): number;    ~~~~~~~~~~ - file1.ts:3:5 - 'duplicate2' was also declared here. + file1.ts:3:5 3 duplicate2: () => string;    ~~~~~~~~~~ - + 'duplicate2' was also declared here. file2.ts:4:5 - error TS2300: Duplicate identifier 'duplicate3'. 4 duplicate3(): number;    ~~~~~~~~~~ - file1.ts:4:5 - 'duplicate3' was also declared here. + file1.ts:4:5 4 duplicate3: () => string;    ~~~~~~~~~~ + 'duplicate3' was also declared here. ==== file1.ts (3 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans4.errors.txt b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans4.errors.txt index 3cf299fdb9d2e..c6088fa352d7c 100644 --- a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans4.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans4.errors.txt @@ -3,144 +3,145 @@ 2 duplicate1: () => string;    ~~~~~~~~~~ - file2.ts:2:5 - 'duplicate1' was also declared here. + file2.ts:2:5 2 duplicate1(): number;    ~~~~~~~~~~ - + 'duplicate1' was also declared here. file1.ts:3:5 - error TS2300: Duplicate identifier 'duplicate2'. 3 duplicate2: () => string;    ~~~~~~~~~~ - file2.ts:3:5 - 'duplicate2' was also declared here. + file2.ts:3:5 3 duplicate2(): number;    ~~~~~~~~~~ - + 'duplicate2' was also declared here. file1.ts:4:5 - error TS2300: Duplicate identifier 'duplicate3'. 4 duplicate3: () => string;    ~~~~~~~~~~ - file2.ts:4:5 - 'duplicate3' was also declared here. + file2.ts:4:5 4 duplicate3(): number;    ~~~~~~~~~~ - + 'duplicate3' was also declared here. file1.ts:5:5 - error TS2300: Duplicate identifier 'duplicate4'. 5 duplicate4: () => string;    ~~~~~~~~~~ - file2.ts:5:5 - 'duplicate4' was also declared here. + file2.ts:5:5 5 duplicate4(): number;    ~~~~~~~~~~ - + 'duplicate4' was also declared here. file1.ts:6:5 - error TS2300: Duplicate identifier 'duplicate5'. 6 duplicate5: () => string;    ~~~~~~~~~~ - file2.ts:6:5 - 'duplicate5' was also declared here. + file2.ts:6:5 6 duplicate5(): number;    ~~~~~~~~~~ - + 'duplicate5' was also declared here. file1.ts:7:5 - error TS2300: Duplicate identifier 'duplicate6'. 7 duplicate6: () => string;    ~~~~~~~~~~ - file2.ts:7:5 - 'duplicate6' was also declared here. + file2.ts:7:5 7 duplicate6(): number;    ~~~~~~~~~~ - + 'duplicate6' was also declared here. file1.ts:8:5 - error TS2300: Duplicate identifier 'duplicate7'. 8 duplicate7: () => string;    ~~~~~~~~~~ - file2.ts:8:5 - 'duplicate7' was also declared here. + file2.ts:8:5 8 duplicate7(): number;    ~~~~~~~~~~ - + 'duplicate7' was also declared here. file1.ts:9:5 - error TS2300: Duplicate identifier 'duplicate8'. 9 duplicate8: () => string;    ~~~~~~~~~~ - file2.ts:9:5 - 'duplicate8' was also declared here. + file2.ts:9:5 9 duplicate8(): number;    ~~~~~~~~~~ - + 'duplicate8' was also declared here. file2.ts:2:5 - error TS2300: Duplicate identifier 'duplicate1'. 2 duplicate1(): number;    ~~~~~~~~~~ - file1.ts:2:5 - 'duplicate1' was also declared here. + file1.ts:2:5 2 duplicate1: () => string;    ~~~~~~~~~~ - + 'duplicate1' was also declared here. file2.ts:3:5 - error TS2300: Duplicate identifier 'duplicate2'. 3 duplicate2(): number;    ~~~~~~~~~~ - file1.ts:3:5 - 'duplicate2' was also declared here. + file1.ts:3:5 3 duplicate2: () => string;    ~~~~~~~~~~ - + 'duplicate2' was also declared here. file2.ts:4:5 - error TS2300: Duplicate identifier 'duplicate3'. 4 duplicate3(): number;    ~~~~~~~~~~ - file1.ts:4:5 - 'duplicate3' was also declared here. + file1.ts:4:5 4 duplicate3: () => string;    ~~~~~~~~~~ - + 'duplicate3' was also declared here. file2.ts:5:5 - error TS2300: Duplicate identifier 'duplicate4'. 5 duplicate4(): number;    ~~~~~~~~~~ - file1.ts:5:5 - 'duplicate4' was also declared here. + file1.ts:5:5 5 duplicate4: () => string;    ~~~~~~~~~~ - + 'duplicate4' was also declared here. file2.ts:6:5 - error TS2300: Duplicate identifier 'duplicate5'. 6 duplicate5(): number;    ~~~~~~~~~~ - file1.ts:6:5 - 'duplicate5' was also declared here. + file1.ts:6:5 6 duplicate5: () => string;    ~~~~~~~~~~ - + 'duplicate5' was also declared here. file2.ts:7:5 - error TS2300: Duplicate identifier 'duplicate6'. 7 duplicate6(): number;    ~~~~~~~~~~ - file1.ts:7:5 - 'duplicate6' was also declared here. + file1.ts:7:5 7 duplicate6: () => string;    ~~~~~~~~~~ - + 'duplicate6' was also declared here. file2.ts:8:5 - error TS2300: Duplicate identifier 'duplicate7'. 8 duplicate7(): number;    ~~~~~~~~~~ - file1.ts:8:5 - 'duplicate7' was also declared here. + file1.ts:8:5 8 duplicate7: () => string;    ~~~~~~~~~~ - + 'duplicate7' was also declared here. file2.ts:9:5 - error TS2300: Duplicate identifier 'duplicate8'. 9 duplicate8(): number;    ~~~~~~~~~~ - file1.ts:9:5 - 'duplicate8' was also declared here. + file1.ts:9:5 9 duplicate8: () => string;    ~~~~~~~~~~ + 'duplicate8' was also declared here. ==== file1.ts (8 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans5.errors.txt b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans5.errors.txt index 21f53eb8eb1a0..558c71feb3c30 100644 --- a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans5.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans5.errors.txt @@ -3,54 +3,55 @@ 3 duplicate1: () => string;    ~~~~~~~~~~ - file2.ts:4:9 - 'duplicate1' was also declared here. + file2.ts:4:9 4 duplicate1(): number;    ~~~~~~~~~~ - + 'duplicate1' was also declared here. file1.ts:4:9 - error TS2300: Duplicate identifier 'duplicate2'. 4 duplicate2: () => string;    ~~~~~~~~~~ - file2.ts:5:9 - 'duplicate2' was also declared here. + file2.ts:5:9 5 duplicate2(): number;    ~~~~~~~~~~ - + 'duplicate2' was also declared here. file1.ts:5:9 - error TS2300: Duplicate identifier 'duplicate3'. 5 duplicate3: () => string;    ~~~~~~~~~~ - file2.ts:6:9 - 'duplicate3' was also declared here. + file2.ts:6:9 6 duplicate3(): number;    ~~~~~~~~~~ - + 'duplicate3' was also declared here. file2.ts:4:9 - error TS2300: Duplicate identifier 'duplicate1'. 4 duplicate1(): number;    ~~~~~~~~~~ - file1.ts:3:9 - 'duplicate1' was also declared here. + file1.ts:3:9 3 duplicate1: () => string;    ~~~~~~~~~~ - + 'duplicate1' was also declared here. file2.ts:5:9 - error TS2300: Duplicate identifier 'duplicate2'. 5 duplicate2(): number;    ~~~~~~~~~~ - file1.ts:4:9 - 'duplicate2' was also declared here. + file1.ts:4:9 4 duplicate2: () => string;    ~~~~~~~~~~ - + 'duplicate2' was also declared here. file2.ts:6:9 - error TS2300: Duplicate identifier 'duplicate3'. 6 duplicate3(): number;    ~~~~~~~~~~ - file1.ts:5:9 - 'duplicate3' was also declared here. + file1.ts:5:9 5 duplicate3: () => string;    ~~~~~~~~~~ + 'duplicate3' was also declared here. ==== file1.ts (3 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans6.errors.txt b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans6.errors.txt index 3466d69b043ff..f0c25f2c3ebcc 100644 --- a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans6.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans6.errors.txt @@ -3,54 +3,55 @@ 3 duplicate1: () => string;    ~~~~~~~~~~ - file2.ts:5:9 - 'duplicate1' was also declared here. + file2.ts:5:9 5 duplicate1(): number;    ~~~~~~~~~~ - + 'duplicate1' was also declared here. file1.ts:4:9 - error TS2300: Duplicate identifier 'duplicate2'. 4 duplicate2: () => string;    ~~~~~~~~~~ - file2.ts:6:9 - 'duplicate2' was also declared here. + file2.ts:6:9 6 duplicate2(): number;    ~~~~~~~~~~ - + 'duplicate2' was also declared here. file1.ts:5:9 - error TS2300: Duplicate identifier 'duplicate3'. 5 duplicate3: () => string;    ~~~~~~~~~~ - file2.ts:7:9 - 'duplicate3' was also declared here. + file2.ts:7:9 7 duplicate3(): number;    ~~~~~~~~~~ - + 'duplicate3' was also declared here. file2.ts:5:9 - error TS2300: Duplicate identifier 'duplicate1'. 5 duplicate1(): number;    ~~~~~~~~~~ - file1.ts:3:9 - 'duplicate1' was also declared here. + file1.ts:3:9 3 duplicate1: () => string;    ~~~~~~~~~~ - + 'duplicate1' was also declared here. file2.ts:6:9 - error TS2300: Duplicate identifier 'duplicate2'. 6 duplicate2(): number;    ~~~~~~~~~~ - file1.ts:4:9 - 'duplicate2' was also declared here. + file1.ts:4:9 4 duplicate2: () => string;    ~~~~~~~~~~ - + 'duplicate2' was also declared here. file2.ts:7:9 - error TS2300: Duplicate identifier 'duplicate3'. 7 duplicate3(): number;    ~~~~~~~~~~ - file1.ts:5:9 - 'duplicate3' was also declared here. + file1.ts:5:9 5 duplicate3: () => string;    ~~~~~~~~~~ + 'duplicate3' was also declared here. ==== file2.ts (3 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans7.errors.txt b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans7.errors.txt index 9381fbbeed026..4025d50fba249 100644 --- a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans7.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans7.errors.txt @@ -3,162 +3,163 @@ 3 duplicate1: () => string;    ~~~~~~~~~~ - file2.ts:5:9 - 'duplicate1' was also declared here. + file2.ts:5:9 5 duplicate1(): number;    ~~~~~~~~~~ - + 'duplicate1' was also declared here. file1.ts:4:9 - error TS2300: Duplicate identifier 'duplicate2'. 4 duplicate2: () => string;    ~~~~~~~~~~ - file2.ts:6:9 - 'duplicate2' was also declared here. + file2.ts:6:9 6 duplicate2(): number;    ~~~~~~~~~~ - + 'duplicate2' was also declared here. file1.ts:5:9 - error TS2300: Duplicate identifier 'duplicate3'. 5 duplicate3: () => string;    ~~~~~~~~~~ - file2.ts:7:9 - 'duplicate3' was also declared here. + file2.ts:7:9 7 duplicate3(): number;    ~~~~~~~~~~ - + 'duplicate3' was also declared here. file1.ts:6:9 - error TS2300: Duplicate identifier 'duplicate4'. 6 duplicate4: () => string;    ~~~~~~~~~~ - file2.ts:8:9 - 'duplicate4' was also declared here. + file2.ts:8:9 8 duplicate4(): number;    ~~~~~~~~~~ - + 'duplicate4' was also declared here. file1.ts:7:9 - error TS2300: Duplicate identifier 'duplicate5'. 7 duplicate5: () => string;    ~~~~~~~~~~ - file2.ts:9:9 - 'duplicate5' was also declared here. + file2.ts:9:9 9 duplicate5(): number;    ~~~~~~~~~~ - + 'duplicate5' was also declared here. file1.ts:8:9 - error TS2300: Duplicate identifier 'duplicate6'. 8 duplicate6: () => string;    ~~~~~~~~~~ - file2.ts:10:9 - 'duplicate6' was also declared here. + file2.ts:10:9 10 duplicate6(): number;    ~~~~~~~~~~ - + 'duplicate6' was also declared here. file1.ts:9:9 - error TS2300: Duplicate identifier 'duplicate7'. 9 duplicate7: () => string;    ~~~~~~~~~~ - file2.ts:11:9 - 'duplicate7' was also declared here. + file2.ts:11:9 11 duplicate7(): number;    ~~~~~~~~~~ - + 'duplicate7' was also declared here. file1.ts:10:9 - error TS2300: Duplicate identifier 'duplicate8'. 10 duplicate8: () => string;    ~~~~~~~~~~ - file2.ts:12:9 - 'duplicate8' was also declared here. + file2.ts:12:9 12 duplicate8(): number;    ~~~~~~~~~~ - + 'duplicate8' was also declared here. file1.ts:11:9 - error TS2300: Duplicate identifier 'duplicate9'. 11 duplicate9: () => string;    ~~~~~~~~~~ - file2.ts:13:9 - 'duplicate9' was also declared here. + file2.ts:13:9 13 duplicate9(): number;    ~~~~~~~~~~ - + 'duplicate9' was also declared here. file2.ts:5:9 - error TS2300: Duplicate identifier 'duplicate1'. 5 duplicate1(): number;    ~~~~~~~~~~ - file1.ts:3:9 - 'duplicate1' was also declared here. + file1.ts:3:9 3 duplicate1: () => string;    ~~~~~~~~~~ - + 'duplicate1' was also declared here. file2.ts:6:9 - error TS2300: Duplicate identifier 'duplicate2'. 6 duplicate2(): number;    ~~~~~~~~~~ - file1.ts:4:9 - 'duplicate2' was also declared here. + file1.ts:4:9 4 duplicate2: () => string;    ~~~~~~~~~~ - + 'duplicate2' was also declared here. file2.ts:7:9 - error TS2300: Duplicate identifier 'duplicate3'. 7 duplicate3(): number;    ~~~~~~~~~~ - file1.ts:5:9 - 'duplicate3' was also declared here. + file1.ts:5:9 5 duplicate3: () => string;    ~~~~~~~~~~ - + 'duplicate3' was also declared here. file2.ts:8:9 - error TS2300: Duplicate identifier 'duplicate4'. 8 duplicate4(): number;    ~~~~~~~~~~ - file1.ts:6:9 - 'duplicate4' was also declared here. + file1.ts:6:9 6 duplicate4: () => string;    ~~~~~~~~~~ - + 'duplicate4' was also declared here. file2.ts:9:9 - error TS2300: Duplicate identifier 'duplicate5'. 9 duplicate5(): number;    ~~~~~~~~~~ - file1.ts:7:9 - 'duplicate5' was also declared here. + file1.ts:7:9 7 duplicate5: () => string;    ~~~~~~~~~~ - + 'duplicate5' was also declared here. file2.ts:10:9 - error TS2300: Duplicate identifier 'duplicate6'. 10 duplicate6(): number;    ~~~~~~~~~~ - file1.ts:8:9 - 'duplicate6' was also declared here. + file1.ts:8:9 8 duplicate6: () => string;    ~~~~~~~~~~ - + 'duplicate6' was also declared here. file2.ts:11:9 - error TS2300: Duplicate identifier 'duplicate7'. 11 duplicate7(): number;    ~~~~~~~~~~ - file1.ts:9:9 - 'duplicate7' was also declared here. + file1.ts:9:9 9 duplicate7: () => string;    ~~~~~~~~~~ - + 'duplicate7' was also declared here. file2.ts:12:9 - error TS2300: Duplicate identifier 'duplicate8'. 12 duplicate8(): number;    ~~~~~~~~~~ - file1.ts:10:9 - 'duplicate8' was also declared here. + file1.ts:10:9 10 duplicate8: () => string;    ~~~~~~~~~~ - + 'duplicate8' was also declared here. file2.ts:13:9 - error TS2300: Duplicate identifier 'duplicate9'. 13 duplicate9(): number;    ~~~~~~~~~~ - file1.ts:11:9 - 'duplicate9' was also declared here. + file1.ts:11:9 11 duplicate9: () => string;    ~~~~~~~~~~ + 'duplicate9' was also declared here. ==== file2.ts (9 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/esModuleInteropPrettyErrorRelatedInformation.errors.txt b/tsc/testdata/baselines/reference/compiler/esModuleInteropPrettyErrorRelatedInformation.errors.txt index 0fb5881599cf4..d17bb54d2aa2f 100644 --- a/tsc/testdata/baselines/reference/compiler/esModuleInteropPrettyErrorRelatedInformation.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/esModuleInteropPrettyErrorRelatedInformation.errors.txt @@ -4,9 +4,10 @@ 3 invoke(foo);    ~~~ - index.ts:1:1 - Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead. + index.ts:1:1 1 import * as foo from "./foo";   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead. ==== foo.d.ts (0 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/manyCompilerErrorsInTheTwoFiles.errors.txt b/tsc/testdata/baselines/reference/compiler/manyCompilerErrorsInTheTwoFiles.errors.txt index b7461fff03671..ca96d5ebf11b7 100644 --- a/tsc/testdata/baselines/reference/compiler/manyCompilerErrorsInTheTwoFiles.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/manyCompilerErrorsInTheTwoFiles.errors.txt @@ -2,92 +2,74 @@ 1 const a =!@#!@$    ~~ - a.ts:1:13 - error TS1134: Variable declaration expected. 1 const a =!@#!@$    ~ - a.ts:1:16 - error TS1109: Expression expected. 1 const a =!@#!@$    ~ - a.ts:2:13 - error TS18026: '#!' can only be used at the start of a file. 2 const b = !@#!@#!@#!    ~~ - a.ts:2:14 - error TS1134: Variable declaration expected. 2 const b = !@#!@#!@#!    ~ - a.ts:2:16 - error TS18026: '#!' can only be used at the start of a file. 2 const b = !@#!@#!@#!    ~~ - a.ts:2:19 - error TS18026: '#!' can only be used at the start of a file. 2 const b = !@#!@#!@#!    ~~ - a.ts:3:1 - error TS2304: Cannot find name 'OK'. 3 OK!   ~~ - a.ts:4:1 - error TS1434: Unexpected keyword or identifier. 4 HERE's A shouty thing   ~~~~ - a.ts:4:1 - error TS2304: Cannot find name 'HERE'. 4 HERE's A shouty thing   ~~~~ - a.ts:4:22 - error TS1002: Unterminated string literal. 4 HERE's A shouty thing    ~ - a.ts:5:1 - error TS1434: Unexpected keyword or identifier. 5 GOTTA GO FAST   ~~~~~ - a.ts:5:1 - error TS2304: Cannot find name 'GOTTA'. 5 GOTTA GO FAST   ~~~~~ - a.ts:5:7 - error TS1434: Unexpected keyword or identifier. 5 GOTTA GO FAST    ~~ - a.ts:5:7 - error TS2304: Cannot find name 'GO'. 5 GOTTA GO FAST    ~~ - a.ts:5:10 - error TS2304: Cannot find name 'FAST'. 5 GOTTA GO FAST    ~~~~ - b.ts:1:1 - error TS2304: Cannot find name 'fhqwhgads'. 1 fhqwhgads   ~~~~~~~~~ - b.ts:2:1 - error TS2304: Cannot find name 'to'. 2 to   ~~ - b.ts:3:1 - error TS2304: Cannot find name 'limit'. 3 limit diff --git a/tsc/testdata/baselines/reference/compiler/prettyContextNotDebugAssertion.errors.txt b/tsc/testdata/baselines/reference/compiler/prettyContextNotDebugAssertion.errors.txt index 2c68ee24aa16d..7ed50695b4f32 100644 --- a/tsc/testdata/baselines/reference/compiler/prettyContextNotDebugAssertion.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/prettyContextNotDebugAssertion.errors.txt @@ -3,9 +3,10 @@ 2   ~ - index.ts:1:11 - The parser expected to find a '}' to match the '{' token here. + index.ts:1:11 1 if (true) {    ~ + The parser expected to find a '}' to match the '{' token here. ==== index.ts (1 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/prettyFileWithErrorsAndTabs.errors.txt b/tsc/testdata/baselines/reference/compiler/prettyFileWithErrorsAndTabs.errors.txt index 810c38262b7cb..38509fcc0902d 100644 --- a/tsc/testdata/baselines/reference/compiler/prettyFileWithErrorsAndTabs.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/prettyFileWithErrorsAndTabs.errors.txt @@ -2,12 +2,10 @@ 3 const x: string = 12;    ~ - prettyFileWithErrorsAndTabs.ts:4:9 - error TS2322: Type 'number' is not assignable to type 'string'. 4 const y: string = 12;    ~ - prettyFileWithErrorsAndTabs.ts:5:9 - error TS2322: Type 'number' is not assignable to type 'string'. 5 const z: string = 12; diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js index 8add78656eff9..082733b22c032 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js @@ -31,4 +31,4 @@ TypeAcquisition:: FileNames:: /apath/a.ts,/apath/b.ts Errors:: -error TS17010: Unknown type acquisition option 'enableAutoDiscovy'. +error TS17010: Unknown type acquisition option 'enableAutoDiscovy'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js index 97ac7deef094f..a2da4c1909bb9 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -35,4 +35,3 @@ Errors:: 3 "enableAutoDiscovy": true,    ~~~~~~~~~~~~~~~~~~~ - diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js index d6e32be5ddbfe..ef39f5660ac17 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js @@ -25,4 +25,4 @@ TypeAcquisition:: FileNames:: /apath/a.ts,/apath/b.ts Errors:: -error TS17010: Unknown type acquisition option 'enableAutoDiscovy'. +error TS17010: Unknown type acquisition option 'enableAutoDiscovy'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js index 5558dd2a1f1cb..e25a3467059d0 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -29,4 +29,3 @@ Errors:: 3 "enableAutoDiscovy": true,    ~~~~~~~~~~~~~~~~~~~ - diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js index 385937b528ec2..cf7fe7917f062 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js @@ -11,4 +11,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js index 385937b528ec2..cf7fe7917f062 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js @@ -11,4 +11,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js index 10da1e28a9f93..f46c33ad62302 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js @@ -11,4 +11,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js index 10da1e28a9f93..f46c33ad62302 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js @@ -11,4 +11,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js index e290c4c786d60..2686b9c407aad 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js @@ -13,4 +13,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18002: The 'files' list in config file '/apath/tsconfig.json' is empty. +error TS18002: The 'files' list in config file '/apath/tsconfig.json' is empty. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js index b3b115a909683..0db9e6e89e4d3 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js @@ -17,4 +17,3 @@ Errors:: 2 "files": [],    ~~ - diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js index d6c070663e130..cf7944c9e280b 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js @@ -12,4 +12,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18002: The 'files' list in config file '/apath/tsconfig.json' is empty. +error TS18002: The 'files' list in config file '/apath/tsconfig.json' is empty. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js index 51b3a5ec6f053..2649820a5bf7d 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js @@ -16,4 +16,3 @@ Errors:: 2 "files": []    ~~ - diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js index 9b23e6b9e8585..1f0351e2dabe5 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js @@ -12,4 +12,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[]' and 'exclude' paths were '[]'. +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js index 9b23e6b9e8585..1f0351e2dabe5 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js @@ -12,4 +12,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[]' and 'exclude' paths were '[]'. +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with json api.js index 348ef1309a490..90013462152b5 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with json api.js @@ -13,4 +13,4 @@ FileNames:: Errors:: error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/../*.ts'. -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/../*.ts"]' and 'exclude' paths were '[]'. +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/../*.ts"]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with jsonSourceFile api.js index fd1b7ee08c416..e70c343768f58 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with jsonSourceFile api.js @@ -16,5 +16,4 @@ Errors:: 2 "include": ["**/../*.ts"]    ~~~~~~~~~~~~ - -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/../*.ts"]' and 'exclude' paths were '[]'. +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/../*.ts"]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js index 6224f4c9e1c6c..6bfe4f41ed6f7 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js @@ -15,4 +15,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["/apath"]'. +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["/apath"]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js index 6224f4c9e1c6c..6bfe4f41ed6f7 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js @@ -15,4 +15,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["/apath"]'. +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["/apath"]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js index 687d07172e1c5..600f42a73c123 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js @@ -14,4 +14,4 @@ configFileName:: /apath/tsconfig.json FileNames:: /apath/a.ts Errors:: -error TS6266: Option 'help' can only be specified on command line. +error TS6266: Option 'help' can only be specified on command line. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with jsonSourceFile api.js index b33d215d5c225..c4968e277a0e8 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with jsonSourceFile api.js @@ -18,4 +18,3 @@ Errors:: 3 "help": true    ~~~~~~ - diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js index 862250c5c77e5..3c0c6e0806db4 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js @@ -19,4 +19,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS5024: Compiler option 'files' requires a value of type string. +error TS5024: Compiler option 'files' requires a value of type string. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js index db8d6cd9d8c5a..6d7916c01e0a1 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js @@ -30,4 +30,3 @@ Errors::   ~~~~~~~  8 }   ~~~~~ - diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js index 70c5e06e9eed9..16c08f98d6ef2 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js @@ -17,4 +17,4 @@ FileNames:: Errors:: error TS5024: Compiler option 'include' requires a value of type string. -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[["./**/*.ts"]]' and 'exclude' paths were '[]'. +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[["./**/*.ts"]]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js index b80ebe19dbb9d..c7202d0880dba 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js @@ -24,5 +24,4 @@ Errors::   ~~~~~~~~~~~~~~~~~ 5 ]   ~~~~~ - -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[["./**/*.ts"]]' and 'exclude' paths were '[]'. +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[["./**/*.ts"]]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js index d07c2c117ec84..bd5f035edcff4 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js @@ -14,4 +14,4 @@ configFileName:: tsconfig.json FileNames:: /app.ts Errors:: -error TS5023: Unknown compiler option 'unknown'. +error TS5023: Unknown compiler option 'unknown'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with jsonSourceFile api.js index b076bb4ed9c79..9741d7f77e99d 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with jsonSourceFile api.js @@ -18,4 +18,3 @@ Errors:: 3 "unknown": true    ~~~~~~~~~ - diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with json api.js index fb63985a902e6..45bbfe8a2a669 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with json api.js @@ -40,4 +40,4 @@ Errors:: error TS5025: Unknown compiler option 'nouncheckedsideeffectimports'. Did you mean 'noUncheckedSideEffectImports'? error TS5025: Unknown compiler option 'moduledetection'. Did you mean 'moduleDetection'? error TS5025: Unknown compiler option 'skiplibcheck'. Did you mean 'skipLibCheck'? -error TS5025: Unknown compiler option 'checkjs'. Did you mean 'checkJs'? +error TS5025: Unknown compiler option 'checkjs'. Did you mean 'checkJs'? diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with jsonSourceFile api.js index b0719d4b7f4cf..e3e0b5592d815 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with jsonSourceFile api.js @@ -35,49 +35,39 @@ Errors:: 3 "sourcemap": true,    ~~~~~~~~~~~ - tsconfig.json:4:5 - error TS5025: Unknown compiler option 'declarationmap'. Did you mean 'declarationMap'? 4 "declarationmap": true,    ~~~~~~~~~~~~~~~~ - tsconfig.json:5:5 - error TS5025: Unknown compiler option 'nouncheckedindexedaccess'. Did you mean 'noUncheckedIndexedAccess'? 5 "nouncheckedindexedaccess": true,    ~~~~~~~~~~~~~~~~~~~~~~~~~~ - tsconfig.json:6:5 - error TS5025: Unknown compiler option 'exactoptionalpropertytypes'. Did you mean 'exactOptionalPropertyTypes'? 6 "exactoptionalpropertytypes": true,    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - tsconfig.json:7:5 - error TS5025: Unknown compiler option 'verbatimmodulesyntax'. Did you mean 'verbatimModuleSyntax'? 7 "verbatimmodulesyntax": true,    ~~~~~~~~~~~~~~~~~~~~~~ - tsconfig.json:8:5 - error TS5025: Unknown compiler option 'isolatedmodules'. Did you mean 'isolatedModules'? 8 "isolatedmodules": true,    ~~~~~~~~~~~~~~~~~ - tsconfig.json:9:5 - error TS5025: Unknown compiler option 'nouncheckedsideeffectimports'. Did you mean 'noUncheckedSideEffectImports'? 9 "nouncheckedsideeffectimports": true,    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - tsconfig.json:10:5 - error TS5025: Unknown compiler option 'moduledetection'. Did you mean 'moduleDetection'? 10 "moduledetection": "force",    ~~~~~~~~~~~~~~~~~ - tsconfig.json:11:5 - error TS5025: Unknown compiler option 'skiplibcheck'. Did you mean 'skipLibCheck'? 11 "skiplibcheck": true,    ~~~~~~~~~~~~~~ - tsconfig.json:12:5 - error TS5025: Unknown compiler option 'checkjs'. Did you mean 'checkJs'? 12 "checkjs": true    ~~~~~~~~~ - diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js index 9ad898f4d6399..5c3e71d5b20a1 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js @@ -18,4 +18,4 @@ FileNames:: Errors:: error TS6046: Argument for '--target' option must be: 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'es2025', 'esnext'. error TS5024: Compiler option 'removeComments' requires a value of type boolean. -error TS6046: Argument for '--moduleResolution' option must be: 'node16', 'nodenext', 'bundler'. +error TS6046: Argument for '--moduleResolution' option must be: 'node16', 'nodenext', 'bundler'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js index a32648be78659..d20dc3e2f0575 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js @@ -20,14 +20,11 @@ Errors:: 3 "target": "invalid value",    ~~~~~~~~~~~~~~~ - tsconfig.json:4:23 - error TS5024: Compiler option 'removeComments' requires a value of type boolean. 4 "removeComments": "should be a boolean",    ~~~~~~~~~~~~~~~~~~~~~ - tsconfig.json:5:25 - error TS6046: Argument for '--moduleResolution' option must be: 'node16', 'nodenext', 'bundler'. 5 "moduleResolution": "invalid value"    ~~~~~~~~~~~~~~~ - diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with json api.js index b79c50099efe3..9991b2ef71eb0 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with json api.js @@ -14,4 +14,4 @@ configFileName:: tsconfig.json FileNames:: /app.ts Errors:: -error TS5025: Unknown compiler option 'targt'. Did you mean 'target'? +error TS5025: Unknown compiler option 'targt'. Did you mean 'target'? diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with jsonSourceFile api.js index 882a1f6ce8a81..8159111918760 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with jsonSourceFile api.js @@ -18,4 +18,3 @@ Errors:: 3 "targt": 1    ~~~~~~~ - diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js index f1ec52ed93f99..087df87cdbb43 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js @@ -20,4 +20,4 @@ configFileName:: tsconfig.json FileNames:: /apath/foge.ts,/apath/test.ts Errors:: -error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? +error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js index 7e0de849d67b8..f308c3fe49528 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js @@ -24,4 +24,3 @@ Errors:: 5 "excludes": [    ~~~~~~~~~~ - diff --git a/tsc/testdata/baselines/reference/conformance/typedefCrossModule5.errors.txt b/tsc/testdata/baselines/reference/conformance/typedefCrossModule5.errors.txt index 748c5510b8d78..d557f9ab1eb76 100644 --- a/tsc/testdata/baselines/reference/conformance/typedefCrossModule5.errors.txt +++ b/tsc/testdata/baselines/reference/conformance/typedefCrossModule5.errors.txt @@ -3,36 +3,37 @@ 1 /** @typedef {number} Foo */    ~~~ - mod2.js:1:7 - 'Foo' was also declared here. + mod2.js:1:7 1 class Foo { } // should error    ~~~ - + 'Foo' was also declared here. mod1.js:2:7 - error TS2451: Cannot redeclare block-scoped variable 'Bar'. 2 class Bar {}    ~~~ - mod2.js:2:7 - 'Bar' was also declared here. + mod2.js:2:7 2 const Bar = 3;    ~~~ - + 'Bar' was also declared here. mod2.js:1:7 - error TS2300: Duplicate identifier 'Foo'. 1 class Foo { } // should error    ~~~ - mod1.js:1:23 - 'Foo' was also declared here. + mod1.js:1:23 1 /** @typedef {number} Foo */    ~~~ - + 'Foo' was also declared here. mod2.js:2:7 - error TS2451: Cannot redeclare block-scoped variable 'Bar'. 2 const Bar = 3;    ~~~ - mod1.js:2:7 - 'Bar' was also declared here. + mod1.js:2:7 2 class Bar {}    ~~~ + 'Bar' was also declared here. ==== mod1.js (2 errors) ==== diff --git a/tsc/testdata/baselines/reference/tsbuild/commandLine/bad-locale.js b/tsc/testdata/baselines/reference/tsbuild/commandLine/bad-locale.js index f85b09a8f91b0..41ce42d0822cf 100644 --- a/tsc/testdata/baselines/reference/tsbuild/commandLine/bad-locale.js +++ b/tsc/testdata/baselines/reference/tsbuild/commandLine/bad-locale.js @@ -7,3 +7,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS6048: Locale must be an IETF BCP 47 language tag. Examples: 'en', 'ja-jp'. + diff --git a/tsc/testdata/baselines/reference/tsbuild/commandLine/when-build-not-first-argument.js b/tsc/testdata/baselines/reference/tsbuild/commandLine/when-build-not-first-argument.js index d44964311b2eb..1b6af49f54f0d 100644 --- a/tsc/testdata/baselines/reference/tsbuild/commandLine/when-build-not-first-argument.js +++ b/tsc/testdata/baselines/reference/tsbuild/commandLine/when-build-not-first-argument.js @@ -6,5 +6,7 @@ tsgo --verbose --build ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5093: Compiler option '--verbose' may only be used with '--build'. + error TS6369: Option '--build' must be the first command line argument. + diff --git a/tsc/testdata/baselines/reference/tsbuild/configFileErrors/missing-config-file.js b/tsc/testdata/baselines/reference/tsbuild/configFileErrors/missing-config-file.js index c194821e7e3a0..8d1d180950b1c 100644 --- a/tsc/testdata/baselines/reference/tsbuild/configFileErrors/missing-config-file.js +++ b/tsc/testdata/baselines/reference/tsbuild/configFileErrors/missing-config-file.js @@ -7,6 +7,7 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS6053: File '/home/src/workspaces/project/bogus.json' not found. + Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js b/tsc/testdata/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js index 04120bd116f8a..83ba10640a7b8 100644 --- a/tsc/testdata/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js +++ b/tsc/testdata/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js @@ -30,10 +30,14 @@ tsgo --b ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: error TS5083: Cannot read file '/home/src/workspaces/project/foobar.json'. + error TS18003: No inputs were found in config file '/home/src/workspaces/project/tsconfig.first.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + error TS5083: Cannot read file '/home/src/workspaces/project/foobar.json'. + error TS18003: No inputs were found in config file '/home/src/workspaces/project/tsconfig.second.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + Found 4 errors. //// [/home/src/workspaces/project/tsconfig.first.tsbuildinfo] *new* diff --git a/tsc/testdata/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js b/tsc/testdata/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js index 6753102212018..bcc735c0c26b2 100644 --- a/tsc/testdata/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js +++ b/tsc/testdata/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js @@ -128,6 +128,7 @@ Output:: /user/username/projects/demo/zoo/tsconfig.json /user/username/projects/demo/animals/tsconfig.json + Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js b/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js index bbb460196c3bb..7317ea74d8899 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js @@ -28,9 +28,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -189,9 +190,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -446,9 +448,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -579,9 +582,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -610,9 +614,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -1040,9 +1045,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors.js b/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors.js index a1c925662626e..be71f7f25d0e0 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors.js +++ b/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors.js @@ -28,9 +28,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... @@ -120,9 +121,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... @@ -300,9 +302,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... @@ -366,9 +369,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... @@ -407,9 +411,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... @@ -637,9 +642,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js index 5e30488659633..2a5ed7dde09e7 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js @@ -365,18 +365,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -980,18 +982,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1262,18 +1266,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1311,18 +1317,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1360,18 +1368,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1409,18 +1419,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js index edc7612baca6a..d9ca79fa2b2a7 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js @@ -364,18 +364,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -955,18 +957,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1239,18 +1243,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1288,18 +1294,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1337,18 +1345,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1386,18 +1396,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js index 44116bd52c4a7..d8b3a3979c423 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js @@ -306,18 +306,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -873,18 +875,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1130,18 +1134,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1179,18 +1185,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1228,18 +1236,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1277,18 +1287,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js index 90722985262a1..5b4df4b9c1042 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js @@ -524,18 +524,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js index 2ee26d6b550a1..2ce86dff240ed 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js @@ -497,18 +497,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js index ebf7151afa8a1..c3d8097f3cb78 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js @@ -436,18 +436,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js index f3f845431f1d5..e937dbec56714 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js @@ -146,9 +146,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -276,9 +277,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -420,9 +422,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js index d104050739f79..490e73f31cccf 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js @@ -133,9 +133,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -250,9 +251,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -381,9 +383,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js index b4897da99ae1f..5ccc29291276d 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -178,27 +178,30 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 - Add a type annotation to the variable c. + c.ts:1:14 1 export const c = class { private p = 10; };    ~ + Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 - Add a type annotation to the variable d. + d.ts:1:14 1 export const d = class { private p = 10; };    ~ + Add a type annotation to the variable d. Found 3 errors in 3 files. @@ -417,27 +420,30 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 - Add a type annotation to the variable c. + c.ts:1:14 1 export const c = class { private p = 10; };    ~ + Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 - Add a type annotation to the variable d. + d.ts:1:14 1 export const d = class { private p = 10; };    ~ + Add a type annotation to the variable d. Found 3 errors in 3 files. @@ -670,27 +676,30 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 - Add a type annotation to the variable c. + c.ts:1:14 1 export const c = class { private p = 10; };    ~ + Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 - Add a type annotation to the variable d. + d.ts:1:14 1 export const d = class { private p = 10; };    ~ + Add a type annotation to the variable d. Found 3 errors in 3 files. @@ -1063,18 +1072,20 @@ Output:: 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 - Add a type annotation to the variable c. + c.ts:1:14 1 export const c = class { private p = 10; };    ~ + Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 - Add a type annotation to the variable d. + d.ts:1:14 1 export const d = class { private p = 10; };    ~ + Add a type annotation to the variable d. Found 2 errors in 2 files. @@ -1275,18 +1286,20 @@ Output:: 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 - Add a type annotation to the variable c. + c.ts:1:14 1 export const c = class { private p = 10; };    ~ + Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 - Add a type annotation to the variable d. + d.ts:1:14 1 export const d = class { private p = 10; };    ~ + Add a type annotation to the variable d. Found 2 errors in 2 files. @@ -1490,9 +1503,10 @@ Output:: 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 - Add a type annotation to the variable d. + d.ts:1:14 1 export const d = class { private p = 10; };    ~ + Add a type annotation to the variable d. Found 1 error in d.ts:1 diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes.js index 58527768b2b86..bd48227f7755d 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes.js @@ -105,9 +105,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -153,9 +154,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -222,9 +224,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js index dd20817117c4a..72f5632b7fcf2 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js @@ -28,9 +28,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -184,9 +185,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -434,9 +436,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -581,9 +584,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -713,9 +717,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js index c719ef150f4d8..d9506c4bd6a3f 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js @@ -26,9 +26,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -168,9 +169,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -382,9 +384,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -503,9 +506,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -617,9 +621,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors.js index 6ea5a365d78c4..d2addd198b59f 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors.js @@ -26,9 +26,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -97,9 +98,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -234,9 +236,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -282,9 +285,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... @@ -325,9 +329,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js b/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js index 80bca24844738..e3e9765a8d774 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js @@ -36,9 +36,10 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 - Add a type annotation to the variable a. + src/main.ts:2:14 2 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in src/main.ts:2 @@ -221,9 +222,10 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 - Add a type annotation to the variable a. + src/main.ts:2:14 2 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in src/main.ts:2 diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration.js b/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration.js index 1c5fe2ab6db76..8615949e8e748 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration.js @@ -36,9 +36,10 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 - Add a type annotation to the variable a. + src/main.ts:2:14 2 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in src/main.ts:2 @@ -121,9 +122,10 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 - Add a type annotation to the variable a. + src/main.ts:2:14 2 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in src/main.ts:2 diff --git a/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js b/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js index 64dfdb89976d2..2ae7a6dece635 100644 --- a/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js +++ b/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js @@ -28,6 +28,7 @@ Output:: The file is in the program because: Matched by default include pattern '**/*' + Found 1 error. //// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib* @@ -164,6 +165,7 @@ Output:: The file is in the program because: Matched by default include pattern '**/*' + Found 1 error. @@ -184,6 +186,7 @@ Output:: The file is in the program because: Matched by default include pattern '**/*' + Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js b/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js index ef89e37d1413c..fb88da9a58094 100644 --- a/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js +++ b/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js @@ -27,6 +27,7 @@ Output:: The file is in the program because: Matched by default include pattern '**/*' + Found 1 error. //// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib* @@ -105,6 +106,7 @@ Output:: The file is in the program because: Matched by default include pattern '**/*' + Found 1 error. //// [/home/src/workspaces/project/dist/index.js] *rewrite with same content* @@ -129,6 +131,7 @@ Output:: The file is in the program because: Matched by default include pattern '**/*' + Found 1 error. //// [/home/src/workspaces/project/dist/index.js] *rewrite with same content* diff --git a/tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js b/tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js index 91ded68a14bbe..fe10e5b98a911 100644 --- a/tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js +++ b/tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js @@ -55,6 +55,7 @@ Output:: [HH:MM:SS AM] Building project 'project/strings/tsconfig.json'... error TS5108: Option 'target=ES5' has been removed. Please remove it from your configuration. + ../../tslibs/TS/Lib/lib.d.ts Default library for target 'ES5' project/strings/foo.json @@ -64,6 +65,7 @@ project/strings/foo.json [HH:MM:SS AM] Building project 'project/main/tsconfig.json'... error TS5108: Option 'target=ES5' has been removed. Please remove it from your configuration. + ../../tslibs/TS/Lib/lib.d.ts Default library for target 'ES5' project/strings/foo.json @@ -270,6 +272,7 @@ Output:: [HH:MM:SS AM] Building project 'project/strings/tsconfig.json'... error TS5108: Option 'target=ES5' has been removed. Please remove it from your configuration. + ../../tslibs/TS/Lib/lib.d.ts Default library for target 'ES5' project/strings/foo.json @@ -279,6 +282,7 @@ project/strings/foo.json [HH:MM:SS AM] Building project 'project/main/tsconfig.json'... error TS5108: Option 'target=ES5' has been removed. Please remove it from your configuration. + ../../tslibs/TS/Lib/lib.d.ts Default library for target 'ES5' project/strings/foo.json diff --git a/tsc/testdata/baselines/reference/tsbuild/sample/building-project-in-not-build-order-doesnt-throw-error.js b/tsc/testdata/baselines/reference/tsbuild/sample/building-project-in-not-build-order-doesnt-throw-error.js index bda501271aebb..89bf911460ba4 100644 --- a/tsc/testdata/baselines/reference/tsbuild/sample/building-project-in-not-build-order-doesnt-throw-error.js +++ b/tsc/testdata/baselines/reference/tsbuild/sample/building-project-in-not-build-order-doesnt-throw-error.js @@ -70,6 +70,7 @@ Output:: error TS6053: File '/user/username/projects/sample1/logic2/tsconfig.json' not found. + Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsbuild/sample/cleaning-project-in-not-build-order-doesnt-throw-error.js b/tsc/testdata/baselines/reference/tsbuild/sample/cleaning-project-in-not-build-order-doesnt-throw-error.js index 5a1bbd8d55785..cd0e6fb6b413b 100644 --- a/tsc/testdata/baselines/reference/tsbuild/sample/cleaning-project-in-not-build-order-doesnt-throw-error.js +++ b/tsc/testdata/baselines/reference/tsbuild/sample/cleaning-project-in-not-build-order-doesnt-throw-error.js @@ -65,6 +65,7 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS6053: File '/user/username/projects/sample1/logic2/tsconfig.json' not found. + Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js b/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js index aca525d206f64..14cdedc21f3a1 100644 --- a/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js +++ b/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js @@ -69,9 +69,11 @@ Output:: error TS6053: File '/user/username/projects/sample1/core/anotherModule.ts' not found. The file is in the program because: Part of 'files' list in tsconfig.json - core/tsconfig.json:3:16 - File is matched by 'files' list specified here. + + core/tsconfig.json:3:16 3 "files": ["anotherModule.ts", "index.ts", "some_decl.d.ts"],    ~~~~~~~~~~~~~~~~~~ + File is matched by 'files' list specified here. [HH:MM:SS AM] Project 'logic/tsconfig.json' is being forcibly rebuilt diff --git a/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js b/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js index 48909bacf674f..81f11be9100b8 100644 --- a/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js +++ b/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js @@ -69,9 +69,11 @@ Output:: error TS6053: File '/user/username/projects/sample1/core/anotherModule.ts' not found. The file is in the program because: Part of 'files' list in tsconfig.json - core/tsconfig.json:3:16 - File is matched by 'files' list specified here. + + core/tsconfig.json:3:16 3 "files": ["anotherModule.ts", "index.ts", "some_decl.d.ts"],    ~~~~~~~~~~~~~~~~~~ + File is matched by 'files' list specified here. [HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist diff --git a/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js b/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js index 3ea7785e80104..5a9d28fca3d8d 100644 --- a/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js +++ b/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js @@ -76,9 +76,10 @@ Output:: 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~ - core/index.ts:3:26 - An argument for 'a' was not provided. + core/index.ts:3:26 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~~ + An argument for 'a' was not provided. [HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors @@ -277,9 +278,10 @@ Output:: 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~ - core/index.ts:3:26 - An argument for 'a' was not provided. + core/index.ts:3:26 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~~ + An argument for 'a' was not provided. [HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors diff --git a/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js b/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js index f8439919cb630..83989c3f96c1c 100644 --- a/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js +++ b/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js @@ -77,9 +77,10 @@ Output:: 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~ - core/index.ts:3:26 - An argument for 'a' was not provided. + core/index.ts:3:26 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~~ + An argument for 'a' was not provided. [HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors @@ -278,9 +279,10 @@ Output:: 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~ - core/index.ts:3:26 - An argument for 'a' was not provided. + core/index.ts:3:26 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~~ + An argument for 'a' was not provided. [HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js b/tsc/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js index 0ff2c58725af6..f05ffcbbf76a3 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js @@ -129,6 +129,7 @@ Output:: /user/username/projects/demo/core/tsconfig.json /user/username/projects/demo/zoo/tsconfig.json /user/username/projects/demo/animals/tsconfig.json + [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js b/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js index 265f254afb9fe..c020d1d30f47e 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js @@ -30,9 +30,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -440,9 +441,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -598,9 +600,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -741,9 +744,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js b/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js index 5f8d8bba4132d..039461c4ad11d 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js @@ -28,9 +28,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -388,9 +389,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -520,9 +522,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -645,9 +648,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js b/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js index 78428c9996a7f..fc71aa91ec852 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js @@ -28,9 +28,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -224,9 +225,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -282,9 +284,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... @@ -335,9 +338,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js b/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js index 167a5b6ded6e4..9c69b168009c3 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js @@ -731,9 +731,10 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 - Add a type annotation to the variable a. + src/main.ts:2:14 2 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -895,9 +896,10 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 - Add a type annotation to the variable a. + src/main.ts:2:14 2 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js b/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js index 430db82e70af3..0071c86b73b50 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js @@ -488,9 +488,10 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 - Add a type annotation to the variable a. + src/main.ts:2:14 2 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -554,9 +555,10 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 - Add a type annotation to the variable a. + src/main.ts:2:14 2 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js index c29ff1a88a093..2398fd6998e06 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js @@ -161,9 +161,10 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. + app/fileWithError.ts:1:12 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ + Add a type annotation to the variable myClassWithError. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -302,9 +303,10 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. + app/fileWithError.ts:1:12 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ + Add a type annotation to the variable myClassWithError. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js index 27e5d2018aeb8..f8fb35d19a78b 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js @@ -161,9 +161,10 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. + app/fileWithError.ts:1:12 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ + Add a type annotation to the variable myClassWithError. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js index 7d854c571330c..b19de72392db6 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js @@ -25,9 +25,10 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. + app/fileWithError.ts:1:12 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ + Add a type annotation to the variable myClassWithError. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -190,9 +191,10 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. + app/fileWithError.ts:1:12 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ + Add a type annotation to the variable myClassWithError. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js index d99e8d2345cda..d314748adb740 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js @@ -25,9 +25,10 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. + app/fileWithError.ts:1:12 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ + Add a type annotation to the variable myClassWithError. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js index cfba79d6835b6..d53e0620d4ed5 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js @@ -183,9 +183,10 @@ Output:: 2 createSomeObject().message;    ~~~~~~~ - Library/library.d.ts:2:5 - 'message2' is declared here. + Library/library.d.ts:2:5 2 message2: string;    ~~~~~~~~ + 'message2' is declared here. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js index 9d62bab02b1b0..ae50819dd158f 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js @@ -611,6 +611,7 @@ Output:: [HH:MM:SS AM] Project 'project3.tsconfig.json' is up to date because newest input 'other2.ts' is older than output 'project3.tsconfig.tsbuildinfo' error TS5083: Cannot read file '/user/username/projects/project/extendsConfig2.tsconfig.json'. + [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js b/tsc/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js index e763e740bf64d..5fd9f7e1a78bd 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js @@ -249,9 +249,10 @@ Output:: 3 export const session: Session = {    ~~~~~~~ - out/pure/session.d.ts:3:5 - 'bar' is declared here. + out/pure/session.d.ts:3:5 3 bar: number;    ~~~ + 'bar' is declared here. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js b/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js index e428153fc5354..3f5f319baf05e 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js @@ -78,9 +78,10 @@ Output:: 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~ - core/index.ts:3:26 - An argument for 'a' was not provided. + core/index.ts:3:26 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~~ + An argument for 'a' was not provided. [HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js b/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js index 24ee4890e7ad0..26adb0086f507 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js @@ -79,9 +79,10 @@ Output:: 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~ - core/index.ts:3:26 - An argument for 'a' was not provided. + core/index.ts:3:26 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~~ + An argument for 'a' was not provided. [HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js b/tsc/testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js index f726961eaf767..8ab1914a6e512 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js @@ -54,6 +54,7 @@ Output:: [HH:MM:SS AM] Starting compilation in watch mode... error TS6053: File '/user/username/projects/sample1/logic/tsconfig.json' not found. + tests/tsconfig.json:4:9 - error TS6053: File '/user/username/projects/sample1/logic' not found. 4 { "path": "../logic" }, diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option-value.js b/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option-value.js index a5717b385b1ad..e2a0f039d1534 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option-value.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option-value.js @@ -7,3 +7,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'es2025', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'es2025.collection', 'es2025.float16', 'es2025.intl', 'es2025.iterator', 'es2025.promise', 'es2025.regexp', 'esnext.asynciterable', 'esnext.symbol', 'esnext.bigint', 'esnext.weakref', 'esnext.object', 'esnext.regexp', 'esnext.string', 'esnext.float16', 'esnext.iterator', 'esnext.promise', 'esnext.array', 'esnext.collection', 'esnext.date', 'esnext.decorators', 'esnext.disposable', 'esnext.error', 'esnext.intl', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.typedarrays', 'decorators', 'decorators.legacy'. + diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option.js b/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option.js index c31779e874f48..ab4cf00b46ddc 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option.js @@ -7,3 +7,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5023: Unknown compiler option '--someNonExistOption'. + diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-tsconfig.json.js b/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-tsconfig.json.js index 543a4d4988002..c422ba28acf9a 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-tsconfig.json.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-tsconfig.json.js @@ -16,3 +16,4 @@ ExitStatus:: Success Output:: error TS5054: A 'tsconfig.json' file is already defined at: '/home/src/workspaces/project/tsconfig.json'. + diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js b/tsc/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js index b717b2f59c748..4de743b46dda3 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js @@ -9,6 +9,7 @@ Output:: The file is in the program because: Root file specified for compilation + Found 1 error. //// [/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts] *Lib* diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/bad-locale.js b/tsc/testdata/baselines/reference/tsc/commandLine/bad-locale.js index 5d1ad434cd988..1444c0edb4086 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/bad-locale.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/bad-locale.js @@ -7,3 +7,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS6048: Locale must be an IETF BCP 47 language tag. Examples: 'en', 'ja-jp'. + diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-extended-tsconfig-in-different-folder-does-not-exist.js b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-extended-tsconfig-in-different-folder-does-not-exist.js index 117c61bb6b919..dca7ad9a8bbcc 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-extended-tsconfig-in-different-folder-does-not-exist.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-extended-tsconfig-in-different-folder-does-not-exist.js @@ -19,6 +19,7 @@ Output:: The file is in the program because: Part of 'files' list in tsconfig.json + Found 1 error. //// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib* diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-does-not-exist.js b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-does-not-exist.js index df87dd1cf194d..9700068259c1f 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-does-not-exist.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-does-not-exist.js @@ -12,9 +12,11 @@ Output:: error TS6231: Could not resolve the path '/home/src/workspaces/project/src/doesNotExist' with the extensions: '.ts', '.tsx', '.d.ts', '.cts', '.d.cts', '.mts', '.d.mts'. The file is in the program because: Part of 'files' list in tsconfig.json - tsconfig.json:2:31 - File is matched by 'files' list specified here. + + tsconfig.json:2:31 2 "files": ["./src/doesNotExist"]    ~~~~~~~~~~~~~~~~~~~~ + File is matched by 'files' list specified here. Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-exists.js b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-exists.js index 1bb69d8e84d93..4137c78adecd9 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-exists.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-exists.js @@ -14,9 +14,11 @@ Output:: error TS6231: Could not resolve the path '/home/src/workspaces/project/src/script' with the extensions: '.ts', '.tsx', '.d.ts', '.cts', '.d.cts', '.mts', '.d.mts'. The file is in the program because: Part of 'files' list in tsconfig.json - tsconfig.json:2:31 - File is matched by 'files' list specified here. + + tsconfig.json:2:31 2 "files": ["./src/script"]    ~~~~~~~~~~~~~~ + File is matched by 'files' list specified here. Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-on-command-line-exists.js b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-on-command-line-exists.js index 7689ac253590b..ae0eb00de4fc0 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-on-command-line-exists.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-on-command-line-exists.js @@ -11,6 +11,7 @@ Output:: The file is in the program because: Root file specified for compilation + Found 1 error. //// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib* diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/file-in-tsconfig-does-not-exist.js b/tsc/testdata/baselines/reference/tsc/commandLine/file-in-tsconfig-does-not-exist.js index c80648cdf5fc0..0ae1d15323df1 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/file-in-tsconfig-does-not-exist.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/file-in-tsconfig-does-not-exist.js @@ -12,9 +12,11 @@ Output:: error TS6053: File '/home/src/workspaces/project/src/doesNotExist.ts' not found. The file is in the program because: Part of 'files' list in tsconfig.json - tsconfig.json:2:31 - File is matched by 'files' list specified here. + + tsconfig.json:2:31 2 "files": ["./src/doesNotExist.ts"]    ~~~~~~~~~~~~~~~~~~~~~~~ + File is matched by 'files' list specified here. Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/non-object-config-root.js b/tsc/testdata/baselines/reference/tsc/commandLine/non-object-config-root.js index c6d3698f57e9c..47c0e30593c69 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/non-object-config-root.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/non-object-config-root.js @@ -8,6 +8,7 @@ tsgo ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: error TS18003: No inputs were found in config file '/home/src/workspaces/project/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + tsconfig.json:1:1 - error TS5092: The root value of a 'tsconfig.json' file must be an object. 1 [] diff --git a/tsc/testdata/baselines/reference/tsc/contentMapperFailures/initialization-failure-reports-one-project-error.js b/tsc/testdata/baselines/reference/tsc/contentMapperFailures/initialization-failure-reports-one-project-error.js index 71ba40313f864..22c0e3d09a871 100644 --- a/tsc/testdata/baselines/reference/tsc/contentMapperFailures/initialization-failure-reports-one-project-error.js +++ b/tsc/testdata/baselines/reference/tsc/contentMapperFailures/initialization-failure-reports-one-project-error.js @@ -39,6 +39,7 @@ Output:: error TS100057: The content mapper 'missing' could not be initialized. The content mapper command 'missing-mapper' could not be started: contentmappertest: unknown mapper command [missing-mapper] + Found 1 error. //// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib* diff --git a/tsc/testdata/baselines/reference/tsc/contentMapperFailures/mapper-is-disabled-after-repeated-failures.js b/tsc/testdata/baselines/reference/tsc/contentMapperFailures/mapper-is-disabled-after-repeated-failures.js index 9aed4ac03b683..ece8f82a664d3 100644 --- a/tsc/testdata/baselines/reference/tsc/contentMapperFailures/mapper-is-disabled-after-repeated-failures.js +++ b/tsc/testdata/baselines/reference/tsc/contentMapperFailures/mapper-is-disabled-after-repeated-failures.js @@ -40,6 +40,7 @@ tsgo --runExternalCode --singleThreaded ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: error TS100026: The content mapper 'fail' failed 5 times and will not be used. + c.vue:1:1 - error TS100025: The content mapper 'fail' failed to transform this file. The content mapper process failed while handling the transform request. diff --git a/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/two-files-exist-on-disk-that-differs-only-in-casing.js b/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/two-files-exist-on-disk-that-differs-only-in-casing.js index f726afec245e9..c648ddc9ff1d2 100644 --- a/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/two-files-exist-on-disk-that-differs-only-in-casing.js +++ b/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/two-files-exist-on-disk-that-differs-only-in-casing.js @@ -23,9 +23,10 @@ Output:: 1 import {x} from "./D"    ~~~~~ - tsconfig.json:2:23 - File is matched by 'files' list specified here. + tsconfig.json:2:23 2 "files": ["c.ts", "d.ts"]    ~~~~~~ + File is matched by 'files' list specified here. Found 1 error in c.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/when-file-is-included-from-multiple-places-with-different-casing.js b/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/when-file-is-included-from-multiple-places-with-different-casing.js index 5c31260cf9c03..254c084931dda 100644 --- a/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/when-file-is-included-from-multiple-places-with-different-casing.js +++ b/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/when-file-is-included-from-multiple-places-with-different-casing.js @@ -36,25 +36,26 @@ Output:: 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - src/anotherFile.ts:1:22 - File is included via import here. + src/anotherFile.ts:1:22 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - - src/anotherFile.ts:2:22 - File is included via import here. + File is included via import here. + src/anotherFile.ts:2:22 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - - src/Struct.d.ts:1:22 - File is included via import here. + File is included via import here. + src/Struct.d.ts:1:22 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - - src/oneMore.ts:1:22 - File is included via import here. + File is included via import here. + src/oneMore.ts:1:22 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - - src/oneMore.ts:2:22 - File is included via import here. + File is included via import here. + src/oneMore.ts:2:22 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ + File is included via import here. src/Struct.d.ts:4:22 - error TS1149: File name '/home/src/projects/project/src/struct.d.ts' differs from already included file name '/home/src/projects/project/src/Struct.d.ts' only in casing. The file is in the program because: @@ -69,25 +70,26 @@ Output:: 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - src/anotherFile.ts:3:22 - File is included via import here. + src/anotherFile.ts:3:22 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - - src/Struct.d.ts:3:22 - File is included via import here. + File is included via import here. + src/Struct.d.ts:3:22 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - - src/anotherFile.ts:4:22 - File is included via import here. + File is included via import here. + src/anotherFile.ts:4:22 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - - src/oneMore.ts:3:22 - File is included via import here. + File is included via import here. + src/oneMore.ts:3:22 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - - src/oneMore.ts:4:22 - File is included via import here. + File is included via import here. + src/oneMore.ts:4:22 4 import * as xs4 from "./struct";    ~~~~~~~~~~ + File is included via import here. src/anotherFile.ts:2:22 - error TS1149: File name '/home/src/projects/project/node_modules/fp-ts/lib/struct.d.ts' differs from already included file name '/home/src/projects/project/node_modules/fp-ts/lib/Struct.d.ts' only in casing. The file is in the program because: @@ -101,25 +103,26 @@ Output:: 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - src/anotherFile.ts:1:22 - File is included via import here. + src/anotherFile.ts:1:22 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - - src/Struct.d.ts:1:22 - File is included via import here. + File is included via import here. + src/Struct.d.ts:1:22 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - - src/Struct.d.ts:2:22 - File is included via import here. + File is included via import here. + src/Struct.d.ts:2:22 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - - src/oneMore.ts:1:22 - File is included via import here. + File is included via import here. + src/oneMore.ts:1:22 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - - src/oneMore.ts:2:22 - File is included via import here. + File is included via import here. + src/oneMore.ts:2:22 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ + File is included via import here. src/anotherFile.ts:3:22 - error TS1261: Already included file name '/home/src/projects/project/src/Struct.d.ts' differs from file name '/home/src/projects/project/src/struct.d.ts' only in casing. The file is in the program because: @@ -134,25 +137,26 @@ Output:: 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - src/Struct.d.ts:3:22 - File is included via import here. + src/Struct.d.ts:3:22 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - - src/Struct.d.ts:4:22 - File is included via import here. + File is included via import here. + src/Struct.d.ts:4:22 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - - src/anotherFile.ts:4:22 - File is included via import here. + File is included via import here. + src/anotherFile.ts:4:22 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - - src/oneMore.ts:3:22 - File is included via import here. + File is included via import here. + src/oneMore.ts:3:22 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - - src/oneMore.ts:4:22 - File is included via import here. + File is included via import here. + src/oneMore.ts:4:22 4 import * as xs4 from "./struct";    ~~~~~~~~~~ + File is included via import here. src/anotherFile.ts:4:22 - error TS1149: File name '/home/src/projects/project/src/struct.d.ts' differs from already included file name '/home/src/projects/project/src/Struct.d.ts' only in casing. The file is in the program because: @@ -167,25 +171,26 @@ Output:: 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - src/anotherFile.ts:3:22 - File is included via import here. + src/anotherFile.ts:3:22 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - - src/Struct.d.ts:3:22 - File is included via import here. + File is included via import here. + src/Struct.d.ts:3:22 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - - src/Struct.d.ts:4:22 - File is included via import here. + File is included via import here. + src/Struct.d.ts:4:22 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - - src/oneMore.ts:3:22 - File is included via import here. + File is included via import here. + src/oneMore.ts:3:22 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - - src/oneMore.ts:4:22 - File is included via import here. + File is included via import here. + src/oneMore.ts:4:22 4 import * as xs4 from "./struct";    ~~~~~~~~~~ + File is included via import here. src/oneMore.ts:2:22 - error TS1149: File name '/home/src/projects/project/node_modules/fp-ts/lib/struct.d.ts' differs from already included file name '/home/src/projects/project/node_modules/fp-ts/lib/Struct.d.ts' only in casing. The file is in the program because: @@ -199,25 +204,26 @@ Output:: 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - src/anotherFile.ts:1:22 - File is included via import here. + src/anotherFile.ts:1:22 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - - src/anotherFile.ts:2:22 - File is included via import here. + File is included via import here. + src/anotherFile.ts:2:22 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - - src/Struct.d.ts:1:22 - File is included via import here. + File is included via import here. + src/Struct.d.ts:1:22 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - - src/Struct.d.ts:2:22 - File is included via import here. + File is included via import here. + src/Struct.d.ts:2:22 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - - src/oneMore.ts:1:22 - File is included via import here. + File is included via import here. + src/oneMore.ts:1:22 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ + File is included via import here. src/oneMore.ts:4:22 - error TS1149: File name '/home/src/projects/project/src/struct.d.ts' differs from already included file name '/home/src/projects/project/src/Struct.d.ts' only in casing. The file is in the program because: @@ -232,25 +238,26 @@ Output:: 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - src/anotherFile.ts:3:22 - File is included via import here. + src/anotherFile.ts:3:22 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - - src/Struct.d.ts:3:22 - File is included via import here. + File is included via import here. + src/Struct.d.ts:3:22 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - - src/Struct.d.ts:4:22 - File is included via import here. + File is included via import here. + src/Struct.d.ts:4:22 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - - src/anotherFile.ts:4:22 - File is included via import here. + File is included via import here. + src/anotherFile.ts:4:22 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - - src/oneMore.ts:3:22 - File is included via import here. + File is included via import here. + src/oneMore.ts:3:22 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ + File is included via import here. ../../tslibs/TS/Lib/lib.es2025.full.d.ts Default library for target 'ES2025' diff --git a/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/with-relative-and-non-relative-file-resolutions.js b/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/with-relative-and-non-relative-file-resolutions.js index cb332937d4fa1..f4808d4d1fdc1 100644 --- a/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/with-relative-and-non-relative-file-resolutions.js +++ b/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/with-relative-and-non-relative-file-resolutions.js @@ -20,9 +20,10 @@ Output:: 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - src/struct.d.ts:1:22 - File is included via import here. + src/struct.d.ts:1:22 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ + File is included via import here. src/struct.d.ts:3:22 - error TS1149: File name '/user/username/projects/myproject/src/Struct.d.ts' differs from already included file name '/user/username/projects/myproject/src/struct.d.ts' only in casing. The file is in the program because: @@ -33,9 +34,10 @@ Output:: 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - src/struct.d.ts:4:22 - File is included via import here. + src/struct.d.ts:4:22 4 import * as xs4 from "./struct";    ~~~~~~~~~~ + File is included via import here. ../../../../home/src/tslibs/TS/Lib/lib.es2025.full.d.ts Default library for target 'ES2025' diff --git a/tsc/testdata/baselines/reference/tsc/generateTrace/generateTrace-with-multiple-files-and-complex-types.js b/tsc/testdata/baselines/reference/tsc/generateTrace/generateTrace-with-multiple-files-and-complex-types.js index befa8be5368c2..b2f228804fd92 100644 --- a/tsc/testdata/baselines/reference/tsc/generateTrace/generateTrace-with-multiple-files-and-complex-types.js +++ b/tsc/testdata/baselines/reference/tsc/generateTrace/generateTrace-with-multiple-files-and-complex-types.js @@ -31,9 +31,10 @@ Output:: 2 const c: Container = { value: 42, map: (fn) => ({ value: fn(42), map: c.map }) };    ~~~ - types.ts:3:5 - The expected type comes from property 'map' which is declared here on type 'Container' + types.ts:3:5 3 map(fn: (x: T) => U): Container;    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + The expected type comes from property 'map' which is declared here on type 'Container' Found 1 error in main.ts:2 diff --git a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent-with---ignoreConfig.js b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent-with---ignoreConfig.js index 74d6e078632f8..36d1767af4c7d 100644 --- a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent-with---ignoreConfig.js +++ b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent-with---ignoreConfig.js @@ -13,3 +13,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5042: Option 'project' cannot be mixed with source files on a command line. + diff --git a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent.js b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent.js index c557a4537a6d2..de5d158171559 100644 --- a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent.js +++ b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent.js @@ -13,3 +13,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5042: Option 'project' cannot be mixed with source files on a command line. + diff --git a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-with---ignoreConfig.js b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-with---ignoreConfig.js index f325237920c83..e8f3de2c08556 100644 --- a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-with---ignoreConfig.js +++ b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-with---ignoreConfig.js @@ -17,3 +17,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5042: Option 'project' cannot be mixed with source files on a command line. + diff --git a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files.js b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files.js index 35141cbcc6df7..38658f4416efa 100644 --- a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files.js +++ b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files.js @@ -17,3 +17,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5042: Option 'project' cannot be mixed with source files on a command line. + diff --git a/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-files.js b/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-files.js index fab3875627728..823191d8e5859 100644 --- a/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-files.js +++ b/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-files.js @@ -17,3 +17,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5112: tsconfig.json is present but will not be loaded if files are specified on commandline. Use '--ignoreConfig' to skip this error. + diff --git a/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent-with---ignoreConfig.js b/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent-with---ignoreConfig.js index ed09be7914a74..5c8058ed0117a 100644 --- a/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent-with---ignoreConfig.js +++ b/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent-with---ignoreConfig.js @@ -13,3 +13,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project/tsconfig.json. + diff --git a/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent.js b/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent.js index c8d7560ae5573..4a2bdf2b1c817 100644 --- a/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent.js +++ b/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent.js @@ -13,3 +13,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project/tsconfig.json. + diff --git a/tsc/testdata/baselines/reference/tsc/incremental/Compile-incremental-with-case-insensitive-file-names.js b/tsc/testdata/baselines/reference/tsc/incremental/Compile-incremental-with-case-insensitive-file-names.js index 3d384abf36137..922fd45f1e736 100644 --- a/tsc/testdata/baselines/reference/tsc/incremental/Compile-incremental-with-case-insensitive-file-names.js +++ b/tsc/testdata/baselines/reference/tsc/incremental/Compile-incremental-with-case-insensitive-file-names.js @@ -52,9 +52,10 @@ Output:: 1 import type { Foo } from 'somelib';    ~~~~~~~~~ - ../node_modules/lib1/index.d.ts:1:26 - File is included via import here. + ../node_modules/lib1/index.d.ts:1:26 1 import type { Foo } from 'someLib';    ~~~~~~~~~ + File is included via import here. Found 1 error in ../node_modules/lib2/index.d.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js b/tsc/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js index 4a7e96ec311d9..8577ec9763930 100644 --- a/tsc/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js +++ b/tsc/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js @@ -269,9 +269,10 @@ Output:: 6 const wrapper = () => Messageable();    ~~~~~~~ - MessageablePerson.ts:6:7 - Add a type annotation to the variable wrapper. + MessageablePerson.ts:6:7 6 const wrapper = () => Messageable();    ~~~~~~~ + Add a type annotation to the variable wrapper. MessageablePerson.ts:7:26 - error TS2304: Cannot find name 'InstanceType'. @@ -439,9 +440,10 @@ Output:: 6 const wrapper = () => Messageable();    ~~~~~~~ - MessageablePerson.ts:6:7 - Add a type annotation to the variable wrapper. + MessageablePerson.ts:6:7 6 const wrapper = () => Messageable();    ~~~~~~~ + Add a type annotation to the variable wrapper. MessageablePerson.ts:7:26 - error TS2304: Cannot find name 'InstanceType'. diff --git a/tsc/testdata/baselines/reference/tsc/incremental/internal-symbolname-in-tsbuildInfo.js b/tsc/testdata/baselines/reference/tsc/incremental/internal-symbolname-in-tsbuildInfo.js index e33fcabf4b84f..9ca161633691c 100644 --- a/tsc/testdata/baselines/reference/tsc/incremental/internal-symbolname-in-tsbuildInfo.js +++ b/tsc/testdata/baselines/reference/tsc/incremental/internal-symbolname-in-tsbuildInfo.js @@ -100,9 +100,10 @@ Output:: 3 length: files.length,    ~~~~~~~~~~~~~~~~~~~~ - a.ts:8:5 - This spread always overwrites this property. + a.ts:8:5 8 ...files,    ~~~~~~~~ + This spread always overwrites this property. a.ts:5:5 - error TS2783: '�@iterator@' is specified more than once, so this usage will be overwritten. @@ -113,9 +114,10 @@ Output:: 7 },   ~~~~~ - a.ts:8:5 - This spread always overwrites this property. + a.ts:8:5 8 ...files,    ~~~~~~~~ + This spread always overwrites this property. Found 2 errors in the same file, starting at: a.ts:3 @@ -143,9 +145,10 @@ Output:: 3 length: files.length,    ~~~~~~~~~~~~~~~~~~~~ - a.ts:8:5 - This spread always overwrites this property. + a.ts:8:5 8 ...files,    ~~~~~~~~ + This spread always overwrites this property. a.ts:5:5 - error TS2783: '�@iterator@' is specified more than once, so this usage will be overwritten. @@ -156,9 +159,10 @@ Output:: 7 },   ~~~~~ - a.ts:8:5 - This spread always overwrites this property. + a.ts:8:5 8 ...files,    ~~~~~~~~ + This spread always overwrites this property. Found 2 errors in the same file, starting at: a.ts:3 @@ -177,9 +181,10 @@ Output:: 3 length: files.length,    ~~~~~~~~~~~~~~~~~~~~ - a.ts:8:5 - This spread always overwrites this property. + a.ts:8:5 8 ...files,    ~~~~~~~~ + This spread always overwrites this property. a.ts:5:5 - error TS2783: '�@iterator@' is specified more than once, so this usage will be overwritten. @@ -190,9 +195,10 @@ Output:: 7 },   ~~~~~ - a.ts:8:5 - This spread always overwrites this property. + a.ts:8:5 8 ...files,    ~~~~~~~~ + This spread always overwrites this property. Found 2 errors in the same file, starting at: a.ts:3 @@ -325,9 +331,10 @@ Output:: 3 length: files.length,    ~~~~~~~~~~~~~~~~~~~~ - a.ts:8:5 - This spread always overwrites this property. + a.ts:8:5 8 ...files,    ~~~~~~~~ + This spread always overwrites this property. a.ts:5:5 - error TS2783: '�@iterator@' is specified more than once, so this usage will be overwritten. @@ -338,9 +345,10 @@ Output:: 7 },   ~~~~~ - a.ts:8:5 - This spread always overwrites this property. + a.ts:8:5 8 ...files,    ~~~~~~~~ + This spread always overwrites this property. Found 2 errors in the same file, starting at: a.ts:3 diff --git a/tsc/testdata/baselines/reference/tsc/incremental/js-file-with-import-in-jsdoc-in-composite-project.js b/tsc/testdata/baselines/reference/tsc/incremental/js-file-with-import-in-jsdoc-in-composite-project.js index 2cacb067b1ce2..36dd0315a0246 100644 --- a/tsc/testdata/baselines/reference/tsc/incremental/js-file-with-import-in-jsdoc-in-composite-project.js +++ b/tsc/testdata/baselines/reference/tsc/incremental/js-file-with-import-in-jsdoc-in-composite-project.js @@ -32,6 +32,7 @@ ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: error TS2318: Cannot find global type 'Promise'. + Found 1 error. //// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib* diff --git a/tsc/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js b/tsc/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js index 8d4c59f060791..3ec10629a3531 100644 --- a/tsc/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js +++ b/tsc/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js @@ -37,9 +37,10 @@ Output:: 10 (    ~~~~~~~~~ - index.tsx:9:18 - The last overload is declared here. + index.tsx:9:18 9 declare function Component(props: { children?: number }): any;    ~~~~~~~~~ + The last overload is declared here. Found 1 error in index.tsx:10 @@ -215,9 +216,10 @@ Output:: 10 (    ~~~~~~~~~ - index.tsx:9:18 - The last overload is declared here. + index.tsx:9:18 9 declare function Component(props: { children?: number }): any;    ~~~~~~~~~ + The last overload is declared here. Found 1 error in index.tsx:10 diff --git a/tsc/testdata/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js b/tsc/testdata/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js index 1b616dd558d32..f431804b71919 100644 --- a/tsc/testdata/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js +++ b/tsc/testdata/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js @@ -129,15 +129,25 @@ tsgo --noLib ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: error TS2318: Cannot find global type 'Array'. + error TS2318: Cannot find global type 'Boolean'. + error TS2318: Cannot find global type 'CallableFunction'. + error TS2318: Cannot find global type 'Function'. + error TS2318: Cannot find global type 'IArguments'. + error TS2318: Cannot find global type 'NewableFunction'. + error TS2318: Cannot find global type 'Number'. + error TS2318: Cannot find global type 'Object'. + error TS2318: Cannot find global type 'RegExp'. + error TS2318: Cannot find global type 'String'. + tsconfig.json:5:9 - error TS5053: Option 'lib' cannot be specified with option 'noLib'. 5 "lib": ["es6"], diff --git a/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js b/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js index 1a8b5b0cabf41..1c72c4656f665 100644 --- a/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js @@ -21,9 +21,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -175,9 +176,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -408,9 +410,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -534,9 +537,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -558,9 +562,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -960,9 +965,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors.js b/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors.js index 860941f8f918d..023d11545620a 100644 --- a/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors.js +++ b/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors.js @@ -21,9 +21,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -75,9 +76,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -166,9 +168,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -193,9 +196,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -216,9 +220,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -297,9 +302,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/changes-composite.js b/tsc/testdata/baselines/reference/tsc/noEmit/changes-composite.js index f0dbfd1471c69..64fdb8d4fa1c2 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/changes-composite.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/changes-composite.js @@ -337,18 +337,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -910,18 +912,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1185,18 +1189,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1227,18 +1233,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1269,18 +1277,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1311,18 +1321,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js b/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js index 5f3fc47d20272..ecc408c9f6017 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js @@ -336,18 +336,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -885,18 +887,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1162,18 +1166,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1204,18 +1210,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1246,18 +1254,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1288,18 +1298,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental.js b/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental.js index bb3c5c7a2c2d0..c43702d84746f 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental.js @@ -278,18 +278,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -803,18 +805,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1053,18 +1057,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1095,18 +1101,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1137,18 +1145,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1179,18 +1189,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js b/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js index ecf00bb71e79e..84c9317bfba8f 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js @@ -503,18 +503,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js b/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js index b09fc9259fdb2..941ecb922a353 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js @@ -476,18 +476,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js b/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js index 138d0771c84bf..2c8d04e9aef50 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js @@ -415,18 +415,20 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. 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/class.ts:2:5 - 'prop1' is declared here. + src/class.ts:2:5 2 prop1 = 1;    ~~~~~ + 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js index 8c767972d02b3..2ff505456cdc3 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -162,27 +162,30 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 - Add a type annotation to the variable c. + c.ts:1:14 1 export const c = class { private p = 10; };    ~ + Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 - Add a type annotation to the variable d. + d.ts:1:14 1 export const d = class { private p = 10; };    ~ + Add a type annotation to the variable d. Found 3 errors in 3 files. @@ -394,27 +397,30 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 - Add a type annotation to the variable c. + c.ts:1:14 1 export const c = class { private p = 10; };    ~ + Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 - Add a type annotation to the variable d. + d.ts:1:14 1 export const d = class { private p = 10; };    ~ + Add a type annotation to the variable d. Found 3 errors in 3 files. @@ -638,27 +644,30 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 - Add a type annotation to the variable c. + c.ts:1:14 1 export const c = class { private p = 10; };    ~ + Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 - Add a type annotation to the variable d. + d.ts:1:14 1 export const d = class { private p = 10; };    ~ + Add a type annotation to the variable d. Found 3 errors in 3 files. @@ -1017,18 +1026,20 @@ Output:: 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 - Add a type annotation to the variable c. + c.ts:1:14 1 export const c = class { private p = 10; };    ~ + Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 - Add a type annotation to the variable d. + d.ts:1:14 1 export const d = class { private p = 10; };    ~ + Add a type annotation to the variable d. Found 2 errors in 2 files. @@ -1222,18 +1233,20 @@ Output:: 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 - Add a type annotation to the variable c. + c.ts:1:14 1 export const c = class { private p = 10; };    ~ + Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 - Add a type annotation to the variable d. + d.ts:1:14 1 export const d = class { private p = 10; };    ~ + Add a type annotation to the variable d. Found 2 errors in 2 files. @@ -1430,9 +1443,10 @@ Output:: 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 - Add a type annotation to the variable d. + d.ts:1:14 1 export const d = class { private p = 10; };    ~ + Add a type annotation to the variable d. Found 1 error in d.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js index 883fa4cd4945f..d389e09e987eb 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js @@ -21,9 +21,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -170,9 +171,10 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 - Add a type annotation to the variable a. + a.ts:1:14 1 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -395,9 +397,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -535,9 +538,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -660,9 +664,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js index 7f8fd52fd1db0..4a41de5c3b6ea 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js @@ -19,9 +19,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -154,9 +155,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -343,9 +345,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -457,9 +460,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -564,9 +568,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors.js b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors.js index 299fdcb8dacde..531ebea6d489c 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors.js @@ -19,9 +19,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -62,9 +63,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -125,9 +127,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -145,9 +148,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -171,9 +175,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js b/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js index b1e3920ac2372..a7186d8a190ef 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js @@ -29,9 +29,10 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 - Add a type annotation to the variable a. + src/main.ts:2:14 2 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in src/main.ts:2 @@ -207,9 +208,10 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 - Add a type annotation to the variable a. + src/main.ts:2:14 2 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in src/main.ts:2 diff --git a/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration.js b/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration.js index 75a34f056ecbe..7c0b3491e0c37 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration.js +++ b/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration.js @@ -29,9 +29,10 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 - Add a type annotation to the variable a. + src/main.ts:2:14 2 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in src/main.ts:2 @@ -72,9 +73,10 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 - Add a type annotation to the variable a. + src/main.ts:2:14 2 export const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in src/main.ts:2 diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Default-initialized-TSConfig.js b/tsc/testdata/baselines/reference/tsc/showConfig/Default-initialized-TSConfig.js index b61895595f13b..b25098501b866 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Default-initialized-TSConfig.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Default-initialized-TSConfig.js @@ -7,3 +7,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project. + diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-advanced-options.js b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-advanced-options.js index df5a6782c2511..c9da5e87c69f4 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-advanced-options.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-advanced-options.js @@ -7,3 +7,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project. + diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-boolean-value-compiler-options.js b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-boolean-value-compiler-options.js index da30c08a19cfb..ef73c3042b511 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-boolean-value-compiler-options.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-boolean-value-compiler-options.js @@ -7,3 +7,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project. + diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-enum-value-compiler-options.js b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-enum-value-compiler-options.js index bf3ed802f92a2..0a6957c4d5b27 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-enum-value-compiler-options.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-enum-value-compiler-options.js @@ -7,3 +7,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project. + diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option-value.js b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option-value.js index 7902a5f89cdfd..0ae2a3ab700cb 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option-value.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option-value.js @@ -7,3 +7,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'es2025', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'es2025.collection', 'es2025.float16', 'es2025.intl', 'es2025.iterator', 'es2025.promise', 'es2025.regexp', 'esnext.asynciterable', 'esnext.symbol', 'esnext.bigint', 'esnext.weakref', 'esnext.object', 'esnext.regexp', 'esnext.string', 'esnext.float16', 'esnext.iterator', 'esnext.promise', 'esnext.array', 'esnext.collection', 'esnext.date', 'esnext.decorators', 'esnext.disposable', 'esnext.error', 'esnext.intl', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.typedarrays', 'decorators', 'decorators.legacy'. + diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option.js b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option.js index d922215b52019..a01eddac525c2 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option.js @@ -7,3 +7,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5023: Unknown compiler option '--someNonExistOption'. + diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options-with-enum-value.js b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options-with-enum-value.js index 2677c20cc1436..9a2c1c938b110 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options-with-enum-value.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options-with-enum-value.js @@ -7,3 +7,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project. + diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options.js b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options.js index 82fb9636f8fba..7ecf617395dca 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options.js @@ -7,3 +7,4 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project. + diff --git a/tsc/testdata/baselines/reference/tsc/typeAcquisition/parse-tsconfig-with-typeAcquisition.js b/tsc/testdata/baselines/reference/tsc/typeAcquisition/parse-tsconfig-with-typeAcquisition.js index 5c89ebdf9aa8d..274d196898080 100644 --- a/tsc/testdata/baselines/reference/tsc/typeAcquisition/parse-tsconfig-with-typeAcquisition.js +++ b/tsc/testdata/baselines/reference/tsc/typeAcquisition/parse-tsconfig-with-typeAcquisition.js @@ -20,6 +20,7 @@ ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: error TS18003: No inputs were found in config file '/home/src/workspaces/project/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + Found 1 error. //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* diff --git a/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-detects-nested-subdirectory-removed-and-recreated.js b/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-detects-nested-subdirectory-removed-and-recreated.js index 4cdb0864eaa82..9939bf70ffaee 100644 --- a/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-detects-nested-subdirectory-removed-and-recreated.js +++ b/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-detects-nested-subdirectory-removed-and-recreated.js @@ -77,9 +77,10 @@ Signatures:: Diff:: incremental has prior state and does not report no-inputs error --- nonIncremental.output.txt +++ incremental.output.txt -@@ -1,4 +0,0 @@ +@@ -1,5 +0,0 @@ -error TS18003: No inputs were found in config file '/home/src/workspaces/project/tsconfig.json'. Specified 'include' paths were '["src/**/*.ts"]' and 'exclude' paths were '[]'. - +- -Found 1 error. - diff --git a/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-handles-tsconfig-deleted.js b/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-handles-tsconfig-deleted.js index 7c3ab632e031c..18d8af2db3364 100644 --- a/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-handles-tsconfig-deleted.js +++ b/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-handles-tsconfig-deleted.js @@ -58,6 +58,7 @@ Edit [0]:: delete tsconfig Output:: error TS5083: Cannot read file '/home/src/workspaces/project/tsconfig.json'. + [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -70,7 +71,7 @@ Directory watches:: Diff:: incremental reports config read error while clean build without tsconfig prints usage help --- nonIncremental.output.txt +++ incremental.output.txt -@@ -1,144 +1,1 @@ +@@ -1,144 +1,2 @@ -Version FakeTSVersion -tsc: The TypeScript Compiler - Version FakeTSVersion - @@ -214,5 +215,4 @@ Diff:: incremental reports config read error while clean build without tsconfig -default: true - -You can learn about all of the compiler options at https://aka.ms/tsc -- -+error TS5083: Cannot read file '/home/src/workspaces/project/tsconfig.json'. \ No newline at end of file ++error TS5083: Cannot read file '/home/src/workspaces/project/tsconfig.json'. diff --git a/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-with-tsconfig-files-list-entry-deleted.js b/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-with-tsconfig-files-list-entry-deleted.js index 1b0917365955e..e48f05f7a5c8c 100644 --- a/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-with-tsconfig-files-list-entry-deleted.js +++ b/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-with-tsconfig-files-list-entry-deleted.js @@ -70,9 +70,11 @@ Output:: error TS6053: File '/home/src/workspaces/project/b.ts' not found. The file is in the program because: Part of 'files' list in tsconfig.json - tsconfig.json:3:20 - File is matched by 'files' list specified here. + + tsconfig.json:3:20 3 "files": ["a.ts", "b.ts"]    ~~~~~~ + File is matched by 'files' list specified here. Found 1 error. diff --git a/tsc/testdata/baselines/reference/tscWatch/noEmit/dts-errors.js b/tsc/testdata/baselines/reference/tscWatch/noEmit/dts-errors.js index c0a2db979bfec..569570c44d951 100644 --- a/tsc/testdata/baselines/reference/tscWatch/noEmit/dts-errors.js +++ b/tsc/testdata/baselines/reference/tscWatch/noEmit/dts-errors.js @@ -21,9 +21,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -157,9 +158,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -196,9 +198,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -239,9 +242,10 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 - Add a type annotation to the variable a. + a.ts:1:7 1 const a = class { private p = 10; };    ~ + Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/submoduleAccepted.txt b/tsc/testdata/submoduleAccepted.txt index b2c6f97649d0a..34729fd0ffea5 100644 --- a/tsc/testdata/submoduleAccepted.txt +++ b/tsc/testdata/submoduleAccepted.txt @@ -671,10 +671,7 @@ conformance/circular1.errors.txt.diff conformance/circular3.errors.txt.diff ## Related spans in various errors changed (these baselines are all --pretty) -compiler/deeplyNestedAssignabilityIssue.errors.txt.diff -compiler/esModuleInteropPrettyErrorRelatedInformation.errors.txt.diff compiler/prettyContextNotDebugAssertion.errors.txt.diff -compiler/prettyFileWithErrorsAndTabs.errors.txt.diff compiler/manyCompilerErrorsInTheTwoFiles.errors.txt.diff ## "Call signature return type" layer removed from error pyramid From e60dc774a2e1783d8cde866454ba6196cac995da Mon Sep 17 00:00:00 2001 From: John Favret <64748847+johnfav03@users.noreply.github.com> Date: Thu, 20 Aug 2026 16:48:14 -0500 Subject: [PATCH 2/6] restore config baseline spacing --- tsc/internal/tsoptions/tsconfigparsing_test.go | 8 ++------ ...mat jsconfig.json to typeAcquisition with json api.js | 1 + ...ig.json to typeAcquisition with jsonSourceFile api.js | 1 + ...mat tsconfig.json to typeAcquisition with json api.js | 1 + ...ig.json to typeAcquisition with jsonSourceFile api.js | 1 + ...rrors for directory with no .ts files with json api.js | 1 + ...directory with no .ts files with jsonSourceFile api.js | 1 + .../generates errors for empty directory with json api.js | 1 + ... errors for empty directory with jsonSourceFile api.js | 1 + ... list when no references are provided with json api.js | 1 + ... no references are provided with jsonSourceFile api.js | 1 + ...generates errors for empty files list with json api.js | 1 + ...errors for empty files list with jsonSourceFile api.js | 1 + .../generates errors for empty include with json api.js | 1 + ...es errors for empty include with jsonSourceFile api.js | 1 + ...nt directory after recursive wildcard with json api.js | 1 + ...ry after recursive wildcard with jsonSourceFile api.js | 1 + ...rates errors for includes with outDir with json api.js | 1 + ...rs for includes with outDir with jsonSourceFile api.js | 1 + ...hen commandline option is in tsconfig with json api.js | 1 + ...dline option is in tsconfig with jsonSourceFile api.js | 1 + ...rates errors when files is not string with json api.js | 1 + ...rs when files is not string with jsonSourceFile api.js | 1 + ...tes errors when include is not string with json api.js | 1 + ... when include is not string with jsonSourceFile api.js | 1 + .../reports error for an unknown option with json api.js | 1 + ...error for an unknown option with jsonSourceFile api.js | 1 + ...rs for incorrectly cased option names with json api.js | 1 + ...orrectly cased option names with jsonSourceFile api.js | 1 + ...ng type option and invalid enum value with json api.js | 1 + ...tion and invalid enum value with jsonSourceFile api.js | 1 + ...ling suggestion for an unknown option with json api.js | 1 + ...stion for an unknown option with jsonSourceFile api.js | 1 + ...rns error when tsconfig have excludes with json api.js | 1 + ...when tsconfig have excludes with jsonSourceFile api.js | 1 + 35 files changed, 36 insertions(+), 6 deletions(-) diff --git a/tsc/internal/tsoptions/tsconfigparsing_test.go b/tsc/internal/tsoptions/tsconfigparsing_test.go index ead33c504486e..9b4d054bbacec 100644 --- a/tsc/internal/tsoptions/tsconfigparsing_test.go +++ b/tsc/internal/tsoptions/tsconfigparsing_test.go @@ -146,9 +146,7 @@ func TestParseConfigFileTextToJson(t *testing.T) { UseCaseSensitiveFileNames: true, }, }) - if len(errors) == 0 { - baselineContent.WriteString("\n") - } + baselineContent.WriteString("\n") if i != len(rec.input)-1 { baselineContent.WriteString("\n") } @@ -1480,9 +1478,7 @@ func baselineParseConfigWith(t *testing.T, baselineFileName string, includeCompi UseCaseSensitiveFileNames: true, }, }) - if len(parsedConfigFileContent.Errors) == 0 { - baselineContent.WriteString("\n") - } + baselineContent.WriteString("\n") if i != len(input)-1 { baselineContent.WriteString("\n") } diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js index 082733b22c032..7c34c87276cef 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js @@ -32,3 +32,4 @@ FileNames:: /apath/a.ts,/apath/b.ts Errors:: error TS17010: Unknown type acquisition option 'enableAutoDiscovy'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js index a2da4c1909bb9..97ac7deef094f 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -35,3 +35,4 @@ Errors:: 3 "enableAutoDiscovy": true,    ~~~~~~~~~~~~~~~~~~~ + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js index ef39f5660ac17..8a0986bdadb62 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js @@ -26,3 +26,4 @@ FileNames:: /apath/a.ts,/apath/b.ts Errors:: error TS17010: Unknown type acquisition option 'enableAutoDiscovy'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js index e25a3467059d0..5558dd2a1f1cb 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with jsonSourceFile api.js @@ -29,3 +29,4 @@ Errors:: 3 "enableAutoDiscovy": true,    ~~~~~~~~~~~~~~~~~~~ + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js index cf7fe7917f062..997bf7716e28d 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js @@ -12,3 +12,4 @@ FileNames:: Errors:: error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js index cf7fe7917f062..997bf7716e28d 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js @@ -12,3 +12,4 @@ FileNames:: Errors:: error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js index f46c33ad62302..30621abe1050d 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js @@ -12,3 +12,4 @@ FileNames:: Errors:: error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js index f46c33ad62302..30621abe1050d 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js @@ -12,3 +12,4 @@ FileNames:: Errors:: error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js index 2686b9c407aad..9f5abbd52f4c4 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js @@ -14,3 +14,4 @@ FileNames:: Errors:: error TS18002: The 'files' list in config file '/apath/tsconfig.json' is empty. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js index 0db9e6e89e4d3..b3b115a909683 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with jsonSourceFile api.js @@ -17,3 +17,4 @@ Errors:: 2 "files": [],    ~~ + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js index cf7944c9e280b..ae92900487d30 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js @@ -13,3 +13,4 @@ FileNames:: Errors:: error TS18002: The 'files' list in config file '/apath/tsconfig.json' is empty. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js index 2649820a5bf7d..51b3a5ec6f053 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with jsonSourceFile api.js @@ -16,3 +16,4 @@ Errors:: 2 "files": []    ~~ + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js index 1f0351e2dabe5..b22486c178a36 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js @@ -13,3 +13,4 @@ FileNames:: Errors:: error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[]' and 'exclude' paths were '[]'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js index 1f0351e2dabe5..b22486c178a36 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js @@ -13,3 +13,4 @@ FileNames:: Errors:: error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[]' and 'exclude' paths were '[]'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with json api.js index 90013462152b5..0cc47503753c8 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with json api.js @@ -14,3 +14,4 @@ FileNames:: Errors:: error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/../*.ts'. error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/../*.ts"]' and 'exclude' paths were '[]'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with jsonSourceFile api.js index e70c343768f58..91aca843db251 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with jsonSourceFile api.js @@ -17,3 +17,4 @@ Errors:: 2 "include": ["**/../*.ts"]    ~~~~~~~~~~~~ error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/../*.ts"]' and 'exclude' paths were '[]'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js index 6bfe4f41ed6f7..fd6a9ae4ac50e 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js @@ -16,3 +16,4 @@ FileNames:: Errors:: error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["/apath"]'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js index 6bfe4f41ed6f7..fd6a9ae4ac50e 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js @@ -16,3 +16,4 @@ FileNames:: Errors:: error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["/apath"]'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js index 600f42a73c123..26382641787bb 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js @@ -15,3 +15,4 @@ FileNames:: /apath/a.ts Errors:: error TS6266: Option 'help' can only be specified on command line. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with jsonSourceFile api.js index c4968e277a0e8..b33d215d5c225 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with jsonSourceFile api.js @@ -18,3 +18,4 @@ Errors:: 3 "help": true    ~~~~~~ + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js index 3c0c6e0806db4..84e229b6d89fc 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js @@ -20,3 +20,4 @@ FileNames:: Errors:: error TS5024: Compiler option 'files' requires a value of type string. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js index 6d7916c01e0a1..db8d6cd9d8c5a 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with jsonSourceFile api.js @@ -30,3 +30,4 @@ Errors::   ~~~~~~~  8 }   ~~~~~ + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js index 16c08f98d6ef2..e4e6af740d50a 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js @@ -18,3 +18,4 @@ FileNames:: Errors:: error TS5024: Compiler option 'include' requires a value of type string. error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[["./**/*.ts"]]' and 'exclude' paths were '[]'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js index c7202d0880dba..14386748b3be6 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js @@ -25,3 +25,4 @@ Errors:: 5 ]   ~~~~~ error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[["./**/*.ts"]]' and 'exclude' paths were '[]'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js index bd5f035edcff4..ca5b9b0e7f5bb 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js @@ -15,3 +15,4 @@ FileNames:: /app.ts Errors:: error TS5023: Unknown compiler option 'unknown'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with jsonSourceFile api.js index 9741d7f77e99d..b076bb4ed9c79 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with jsonSourceFile api.js @@ -18,3 +18,4 @@ Errors:: 3 "unknown": true    ~~~~~~~~~ + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with json api.js index 45bbfe8a2a669..fe83886909fe4 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with json api.js @@ -41,3 +41,4 @@ Errors:: error TS5025: Unknown compiler option 'moduledetection'. Did you mean 'moduleDetection'? error TS5025: Unknown compiler option 'skiplibcheck'. Did you mean 'skipLibCheck'? error TS5025: Unknown compiler option 'checkjs'. Did you mean 'checkJs'? + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with jsonSourceFile api.js index e3e0b5592d815..41a5b1a2bf7d9 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with jsonSourceFile api.js @@ -71,3 +71,4 @@ Errors:: 12 "checkjs": true    ~~~~~~~~~ + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js index 5c3e71d5b20a1..f51e477c660e1 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js @@ -19,3 +19,4 @@ Errors:: error TS6046: Argument for '--target' option must be: 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'es2025', 'esnext'. error TS5024: Compiler option 'removeComments' requires a value of type boolean. error TS6046: Argument for '--moduleResolution' option must be: 'node16', 'nodenext', 'bundler'. + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js index d20dc3e2f0575..422e4c3c9f352 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js @@ -28,3 +28,4 @@ Errors:: 5 "moduleResolution": "invalid value"    ~~~~~~~~~~~~~~~ + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with json api.js index 9991b2ef71eb0..a5d32b708c15d 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with json api.js @@ -15,3 +15,4 @@ FileNames:: /app.ts Errors:: error TS5025: Unknown compiler option 'targt'. Did you mean 'target'? + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with jsonSourceFile api.js index 8159111918760..882a1f6ce8a81 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with jsonSourceFile api.js @@ -18,3 +18,4 @@ Errors:: 3 "targt": 1    ~~~~~~~ + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js index 087df87cdbb43..eb0f0e1d547cb 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js @@ -21,3 +21,4 @@ FileNames:: /apath/foge.ts,/apath/test.ts Errors:: error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? + diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js index f308c3fe49528..7e0de849d67b8 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with jsonSourceFile api.js @@ -24,3 +24,4 @@ Errors:: 5 "excludes": [    ~~~~~~~~~~ + From ee667c52e850c112cb8d18c4afc4d59f54b257a1 Mon Sep 17 00:00:00 2001 From: John Favret <64748847+johnfav03@users.noreply.github.com> Date: Thu, 20 Aug 2026 17:26:08 -0500 Subject: [PATCH 3/6] addressed feedback --- tsc/internal/api/format_diagnostics.go | 2 +- .../diagnosticwriter/diagnosticwriter.go | 49 ++++++- ...ntMapperDiagnosticDirectives.contentmapper | 5 + .../contentMapperDiagnostics.contentmapper | 2 + ...rInvalidDiagnosticDirectives.contentmapper | 4 + .../deeplyNestedAssignabilityIssue.errors.txt | 15 +- ...uplicateIdentifierRelatedSpans1.errors.txt | 31 ++-- ...uplicateIdentifierRelatedSpans2.errors.txt | 71 +++++----- ...uplicateIdentifierRelatedSpans3.errors.txt | 23 ++- ...uplicateIdentifierRelatedSpans4.errors.txt | 63 ++++----- ...uplicateIdentifierRelatedSpans5.errors.txt | 23 ++- ...uplicateIdentifierRelatedSpans6.errors.txt | 23 ++- ...uplicateIdentifierRelatedSpans7.errors.txt | 71 +++++----- ...opPrettyErrorRelatedInformation.errors.txt | 3 +- ...manyCompilerErrorsInTheTwoFiles.errors.txt | 18 +++ .../prettyContextNotDebugAssertion.errors.txt | 3 +- .../prettyFileWithErrorsAndTabs.errors.txt | 2 + ....json to typeAcquisition with json api.js | 3 +- ....json to typeAcquisition with json api.js | 3 +- ...rectory with no .ts files with json api.js | 3 +- ...th no .ts files with jsonSourceFile api.js | 3 +- ...rrors for empty directory with json api.js | 3 +- ...empty directory with jsonSourceFile api.js | 3 +- ...o references are provided with json api.js | 3 +- ...rors for empty files list with json api.js | 3 +- ... errors for empty include with json api.js | 3 +- ...r empty include with jsonSourceFile api.js | 3 +- ... after recursive wildcard with json api.js | 3 +- ...ursive wildcard with jsonSourceFile api.js | 4 +- ... for includes with outDir with json api.js | 3 +- ...des with outDir with jsonSourceFile api.js | 3 +- ...ine option is in tsconfig with json api.js | 3 +- ... when files is not string with json api.js | 3 +- ...hen include is not string with json api.js | 3 +- ...e is not string with jsonSourceFile api.js | 4 +- ...ror for an unknown option with json api.js | 3 +- ...rectly cased option names with json api.js | 3 +- ...ed option names with jsonSourceFile api.js | 9 ++ ...on and invalid enum value with json api.js | 3 +- ...alid enum value with jsonSourceFile api.js | 2 + ...ion for an unknown option with json api.js | 3 +- ...en tsconfig have excludes with json api.js | 3 +- .../typedefCrossModule5.errors.txt | 15 +- .../tsbuild/commandLine/bad-locale.js | 1 - .../when-build-not-first-argument.js | 2 - .../configFileErrors/missing-config-file.js | 1 - .../when-tsconfig-extends-the-missing-file.js | 4 - ...ts-the-error-about-it-by-stopping-build.js | 1 - .../noCheck/dts-errors-with-incremental.js | 18 +-- .../reference/tsbuild/noCheck/dts-errors.js | 18 +-- .../tsbuild/noEmit/changes-composite.js | 36 ++--- .../noEmit/changes-incremental-declaration.js | 36 ++--- .../tsbuild/noEmit/changes-incremental.js | 36 ++--- .../changes-with-initial-noEmit-composite.js | 6 +- ...-initial-noEmit-incremental-declaration.js | 6 +- ...changes-with-initial-noEmit-incremental.js | 6 +- ...ble-changes-with-incremental-as-modules.js | 9 +- ...aration-enable-changes-with-incremental.js | 9 +- ...tion-enable-changes-with-multiple-files.js | 42 ++---- ...-errors-with-declaration-enable-changes.js | 9 +- .../dts-errors-with-incremental-as-modules.js | 15 +- .../noEmit/dts-errors-with-incremental.js | 15 +- .../reference/tsbuild/noEmit/dts-errors.js | 15 +- ...rrors-with-declaration-with-incremental.js | 6 +- .../dts-errors-with-declaration.js | 6 +- ...iles-belong-to-rootDir-and-is-composite.js | 3 - ...ied-but-not-all-files-belong-to-rootDir.js | 3 - ...ting-json-module-from-project-reference.js | 4 - ...t-in-not-build-order-doesnt-throw-error.js | 1 - ...t-in-not-build-order-doesnt-throw-error.js | 1 - ...ror-if-input-file-is-missing-with-force.js | 4 +- .../reports-error-if-input-file-is-missing.js | 4 +- ...rrors-when-test-does-not-reference-core.js | 6 +- ...ects-have-errors-with-stopBuildOnErrors.js | 6 +- .../demo/updates-with-circular-reference.js | 1 - .../dts-errors-with-incremental-as-modules.js | 12 +- .../noEmit/dts-errors-with-incremental.js | 12 +- .../tsbuildWatch/noEmit/dts-errors.js | 12 +- ...Error-with-declaration-with-incremental.js | 6 +- .../noEmitOnError-with-declaration.js | 6 +- ...ceError-when-file-with-no-error-changes.js | 6 +- ...ing-errors-only-changed-file-is-emitted.js | 3 +- ...tErrors-when-file-with-no-error-changes.js | 6 +- ...ixing-error-files-all-files-are-emitted.js | 3 +- ...e-down-stream-project-and-then-fixes-it.js | 3 +- .../works-with-extended-source-files.js | 1 - .../reexport/Reports-errors-correctly.js | 3 +- ...rrors-when-test-does-not-reference-core.js | 3 +- ...ects-have-errors-with-stopBuildOnErrors.js | 3 +- ...tches-config-files-that-are-not-present.js | 1 - ...ig-with-incorrect-compiler-option-value.js | 1 - ...TSConfig-with-incorrect-compiler-option.js | 1 - ...Initialized-TSConfig-with-tsconfig.json.js | 1 - .../commandLine/Parse-enum-type-options.js | 1 - .../reference/tsc/commandLine/bad-locale.js | 1 - ...nfig-in-different-folder-does-not-exist.js | 1 - ...ionless-file-in-tsconfig-does-not-exist.js | 4 +- .../extensionless-file-in-tsconfig-exists.js | 4 +- ...tensionless-file-on-command-line-exists.js | 1 - .../file-in-tsconfig-does-not-exist.js | 4 +- .../tsc/commandLine/non-object-config-root.js | 1 - ...ation-failure-reports-one-project-error.js | 1 - ...per-is-disabled-after-repeated-failures.js | 1 - ...ist-on-disk-that-differs-only-in-casing.js | 3 +- ...m-multiple-places-with-different-casing.js | 133 +++++++++--------- ...ative-and-non-relative-file-resolutions.js | 6 +- ...e-with-multiple-files-and-complex-types.js | 3 +- ...-config-file-absent-with---ignoreConfig.js | 1 - ...oject-and-files-when-config-file-absent.js | 1 - ...g-project-and-files-with---ignoreConfig.js | 1 - .../ignoreConfig/mixing-project-and-files.js | 1 - .../tsc/ignoreConfig/specifying-files.js | 1 - ...-config-file-absent-with---ignoreConfig.js | 1 - ...cifying-project-when-config-file-absent.js | 1 - ...mental-with-case-insensitive-file-names.js | 3 +- ...ion-field-with-declaration-emit-enabled.js | 6 +- .../internal-symbolname-in-tsbuildInfo.js | 24 ++-- ...th-import-in-jsdoc-in-composite-project.js | 1 - .../incremental/serializing-error-chain.js | 6 +- .../libraryResolution/when-noLib-toggles.js | 10 -- .../noCheck/dts-errors-with-incremental.js | 18 +-- .../reference/tsc/noCheck/dts-errors.js | 18 +-- .../reference/tsc/noEmit/changes-composite.js | 36 ++--- .../noEmit/changes-incremental-declaration.js | 36 ++--- .../tsc/noEmit/changes-incremental.js | 36 ++--- .../changes-with-initial-noEmit-composite.js | 6 +- ...-initial-noEmit-incremental-declaration.js | 6 +- ...changes-with-initial-noEmit-incremental.js | 6 +- ...tion-enable-changes-with-multiple-files.js | 42 ++---- .../dts-errors-with-incremental-as-modules.js | 15 +- .../tsc/noEmit/dts-errors-with-incremental.js | 15 +- .../reference/tsc/noEmit/dts-errors.js | 15 +- ...rrors-with-declaration-with-incremental.js | 6 +- .../dts-errors-with-declaration.js | 6 +- .../Default-initialized-TSConfig.js | 1 - .../Show-TSConfig-with-advanced-options.js | 1 - ...fig-with-boolean-value-compiler-options.js | 1 - ...Config-with-enum-value-compiler-options.js | 1 - ...ig-with-incorrect-compiler-option-value.js | 1 - ...TSConfig-with-incorrect-compiler-option.js | 1 - ...h-list-compiler-options-with-enum-value.js | 1 - ...how-TSConfig-with-list-compiler-options.js | 1 - .../parse-tsconfig-with-typeAcquisition.js | 1 - ...sted-subdirectory-removed-and-recreated.js | 3 +- .../watch-handles-tsconfig-deleted.js | 6 +- ...-with-tsconfig-files-list-entry-deleted.js | 4 +- .../reference/tscWatch/noEmit/dts-errors.js | 12 +- tsc/testdata/submoduleAccepted.txt | 3 + 148 files changed, 591 insertions(+), 846 deletions(-) diff --git a/tsc/internal/api/format_diagnostics.go b/tsc/internal/api/format_diagnostics.go index 83162229983d7..4f735a4a7a2bc 100644 --- a/tsc/internal/api/format_diagnostics.go +++ b/tsc/internal/api/format_diagnostics.go @@ -46,7 +46,7 @@ func (s *Session) handleFormatDiagnostics(ctx context.Context, params *FormatDia var sb strings.Builder if colorAndContext { - diagnosticwriter.FormatDiagnosticsWithColorAndContext(&sb, diags, formatOpts) + diagnosticwriter.FormatDiagnosticsWithColorAndContextForAPI(&sb, diags, formatOpts) } else { diagnosticwriter.WriteFormatDiagnostics(&sb, diags, formatOpts) } diff --git a/tsc/internal/diagnosticwriter/diagnosticwriter.go b/tsc/internal/diagnosticwriter/diagnosticwriter.go index 01626fb62a962..7abd29ad063c7 100644 --- a/tsc/internal/diagnosticwriter/diagnosticwriter.go +++ b/tsc/internal/diagnosticwriter/diagnosticwriter.go @@ -199,7 +199,13 @@ const ( ) func FormatDiagnosticsWithColorAndContext(output io.Writer, diags []Diagnostic, formatOpts *FormattingOptions) { - for _, diagnostic := range diags { + if len(diags) == 0 { + return + } + for i, diagnostic := range diags { + if i > 0 { + fmt.Fprint(output, formatOpts.NewLine) + } FormatDiagnosticWithColorAndContext(output, diagnostic, formatOpts) } } @@ -216,6 +222,47 @@ func FormatDiagnosticWithColorAndContext(output io.Writer, diagnostic Diagnostic fmt.Fprintf(output, "%s %s%d: %s", foregroundColorEscapeGrey, diagnosticPrefix(diagnostic), diagnostic.Code(), resetEscapeSequence) WriteFlattenedDiagnosticMessage(output, diagnostic, formatOpts.NewLine, formatOpts.Locale) + if diagnostic.File() != nil && diagnostic.Code() != diagnostics.File_appears_to_be_binary.Code() { + fmt.Fprint(output, formatOpts.NewLine) + writeCodeSnippet(output, diagnostic.File(), diagnostic.Pos(), diagnostic.Len(), getCategoryFormat(diagnostic.Category()), "", formatOpts) + fmt.Fprint(output, formatOpts.NewLine) + } + + if (diagnostic.RelatedInformation() != nil) && (len(diagnostic.RelatedInformation()) > 0) { + for _, relatedInformation := range diagnostic.RelatedInformation() { + file := relatedInformation.File() + if file != nil { + fmt.Fprint(output, formatOpts.NewLine) + fmt.Fprint(output, " ") + pos := relatedInformation.Pos() + WriteLocation(output, file, pos, formatOpts, writeWithStyleAndReset) + fmt.Fprint(output, " - ") + WriteFlattenedDiagnosticMessage(output, relatedInformation, formatOpts.NewLine, formatOpts.Locale) + writeCodeSnippet(output, file, pos, relatedInformation.Len(), foregroundColorEscapeCyan, " ", formatOpts) + } + fmt.Fprint(output, formatOpts.NewLine) + } + } +} + +func FormatDiagnosticsWithColorAndContextForAPI(output io.Writer, diags []Diagnostic, formatOpts *FormattingOptions) { + for _, diagnostic := range diags { + formatDiagnosticWithColorAndContextForAPI(output, diagnostic, formatOpts) + } +} + +func formatDiagnosticWithColorAndContextForAPI(output io.Writer, diagnostic Diagnostic, formatOpts *FormattingOptions) { + if diagnostic.File() != nil { + file := diagnostic.File() + pos := diagnostic.Pos() + WriteLocation(output, file, pos, formatOpts, writeWithStyleAndReset) + fmt.Fprint(output, " - ") + } + + writeWithStyleAndReset(output, diagnostic.Category().Name(), getCategoryFormat(diagnostic.Category())) + fmt.Fprintf(output, "%s %s%d: %s", foregroundColorEscapeGrey, diagnosticPrefix(diagnostic), diagnostic.Code(), resetEscapeSequence) + WriteFlattenedDiagnosticMessage(output, diagnostic, formatOpts.NewLine, formatOpts.Locale) + if diagnostic.File() != nil && diagnostic.Code() != diagnostics.File_appears_to_be_binary.Code() { fmt.Fprint(output, formatOpts.NewLine) writeCodeSnippet(output, diagnostic.File(), diagnostic.Pos(), diagnostic.Len(), getCategoryFormat(diagnostic.Category()), "", formatOpts) diff --git a/tsc/testdata/baselines/reference/compiler/contentMapperDiagnosticDirectives.contentmapper b/tsc/testdata/baselines/reference/compiler/contentMapperDiagnosticDirectives.contentmapper index b5a663f3e2199..aeafe71315828 100644 --- a/tsc/testdata/baselines/reference/compiler/contentMapperDiagnosticDirectives.contentmapper +++ b/tsc/testdata/baselines/reference/compiler/contentMapperDiagnosticDirectives.contentmapper @@ -41,22 +41,27 @@ export const broken = undefined 7 // @box-expect-error: Syntax errors do not satisfy expectations. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /widget.box:10:1 - error box2578: Unused second expectation. 10 // @box-expect-error: Unused second expectation. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /widget.box:8:21 - error TS1109: Expression expected. 8 const syntaxError = ; ~ + /widget.box:13:7 - error TS2322: Type 'string' is not assignable to type 'number'. 13 const visible: number = "wrong"; ~~~~~~~ + /widget.box:15:1 - error box2578: Mapper diagnostics do not satisfy expectations. 15 // @box-expect-error: Mapper diagnostics do not satisfy expectations. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /widget.box:16:23 - error box1000: Unclosed interpolation. 16 export const broken = #{unterminated; diff --git a/tsc/testdata/baselines/reference/compiler/contentMapperDiagnostics.contentmapper b/tsc/testdata/baselines/reference/compiler/contentMapperDiagnostics.contentmapper index 088e43b12d109..223287609cb54 100644 --- a/tsc/testdata/baselines/reference/compiler/contentMapperDiagnostics.contentmapper +++ b/tsc/testdata/baselines/reference/compiler/contentMapperDiagnostics.contentmapper @@ -15,10 +15,12 @@ export const broken = undefined 1 export const count: number = "not a number"; ~~~~~ + /widget.box:2:14 - error TS2322: Type 'number' is not assignable to type 'string'. 2 export const label: string = #{target}; ~~~~~ + /widget.box:3:23 - error box1000: Unclosed interpolation. 3 export const broken = #{unterminated; diff --git a/tsc/testdata/baselines/reference/compiler/contentMapperInvalidDiagnosticDirectives.contentmapper b/tsc/testdata/baselines/reference/compiler/contentMapperInvalidDiagnosticDirectives.contentmapper index 9c5858339f865..8ea467db00dd4 100644 --- a/tsc/testdata/baselines/reference/compiler/contentMapperInvalidDiagnosticDirectives.contentmapper +++ b/tsc/testdata/baselines/reference/compiler/contentMapperInvalidDiagnosticDirectives.contentmapper @@ -30,21 +30,25 @@ 1 ~ + /invalidPolicy.invalidpolicy:1:1 - error TS100025: The content mapper 'mapper' failed to transform this file. The content mapper returned a diagnostic directive with invalid policy '2'. 1 ~ + /invalidRange.invalidrange:1:1 - error TS100025: The content mapper 'mapper' failed to transform this file. Diagnostic directive 0 returned by the content mapper has an invalid range. 1 ~ + /invalidUnusedDiagnosticIndex.invalidunusedindex:1:1 - error TS100025: The content mapper 'mapper' failed to transform this file. Diagnostic directive 0 returned by the content mapper has an invalid 'unusedExpectDirectiveIndex'. 1 ~ + /overlap.overlap:1:1 - error TS100025: The content mapper 'mapper' failed to transform this file. The content mapper returned diagnostic directives with overlapping virtual ranges. diff --git a/tsc/testdata/baselines/reference/compiler/deeplyNestedAssignabilityIssue.errors.txt b/tsc/testdata/baselines/reference/compiler/deeplyNestedAssignabilityIssue.errors.txt index 5add2fd996c3a..27a65bedc6dbd 100644 --- a/tsc/testdata/baselines/reference/compiler/deeplyNestedAssignabilityIssue.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/deeplyNestedAssignabilityIssue.errors.txt @@ -3,27 +3,26 @@ 22 thing: {}    ~~~~~ - deeplyNestedAssignabilityIssue.ts:2:5 + deeplyNestedAssignabilityIssue.ts:2:5 - 'a' is declared here. 2 a: number;    ~ - 'a' is declared here. - deeplyNestedAssignabilityIssue.ts:9:17 + + deeplyNestedAssignabilityIssue.ts:9:17 - The expected type comes from property 'thing' which is declared here on type '{ thing: A; }' 9 thing: A;    ~~~~~ - The expected type comes from property 'thing' which is declared here on type '{ thing: A; }' + deeplyNestedAssignabilityIssue.ts:25:17 - error TS2741: Property 'a' is missing in type '{}' but required in type 'A'. 25 another: {}    ~~~~~~~ - deeplyNestedAssignabilityIssue.ts:2:5 + deeplyNestedAssignabilityIssue.ts:2:5 - 'a' is declared here. 2 a: number;    ~ - 'a' is declared here. - deeplyNestedAssignabilityIssue.ts:12:17 + + deeplyNestedAssignabilityIssue.ts:12:17 - The expected type comes from property 'another' which is declared here on type '{ another: A; }' 12 another: A;    ~~~~~~~ - The expected type comes from property 'another' which is declared here on type '{ another: A; }' ==== deeplyNestedAssignabilityIssue.ts (2 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans1.errors.txt b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans1.errors.txt index 9af458a195d63..bf30f2c3fc40c 100644 --- a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans1.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans1.errors.txt @@ -3,63 +3,62 @@ 1 class Foo { }    ~~~ - file2.ts:1:6 + file2.ts:1:6 - 'Foo' was also declared here. 1 type Foo = number;    ~~~ - 'Foo' was also declared here. - file3.ts:1:6 + + file3.ts:1:6 - 'Foo' was also declared here. 1 type Foo = 54;    ~~~ - 'Foo' was also declared here. + file1.ts:2:7 - error TS2451: Cannot redeclare block-scoped variable 'Bar'. 2 const Bar = 3;    ~~~ - file2.ts:2:7 + file2.ts:2:7 - 'Bar' was also declared here. 2 class Bar {}    ~~~ - 'Bar' was also declared here. - file3.ts:2:5 + + file3.ts:2:5 - 'Bar' was also declared here. 2 let Bar = 42    ~~~ - 'Bar' was also declared here. + file2.ts:1:6 - error TS2300: Duplicate identifier 'Foo'. 1 type Foo = number;    ~~~ - file1.ts:1:7 + file1.ts:1:7 - 'Foo' was also declared here. 1 class Foo { }    ~~~ - 'Foo' was also declared here. + file2.ts:2:7 - error TS2451: Cannot redeclare block-scoped variable 'Bar'. 2 class Bar {}    ~~~ - file1.ts:2:7 + file1.ts:2:7 - 'Bar' was also declared here. 2 const Bar = 3;    ~~~ - 'Bar' was also declared here. + file3.ts:1:6 - error TS2300: Duplicate identifier 'Foo'. 1 type Foo = 54;    ~~~ - file1.ts:1:7 + file1.ts:1:7 - 'Foo' was also declared here. 1 class Foo { }    ~~~ - 'Foo' was also declared here. + file3.ts:2:5 - error TS2451: Cannot redeclare block-scoped variable 'Bar'. 2 let Bar = 42    ~~~ - file1.ts:2:7 + file1.ts:2:7 - 'Bar' was also declared here. 2 const Bar = 3;    ~~~ - 'Bar' was also declared here. ==== file1.ts (2 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans2.errors.txt b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans2.errors.txt index 69e8f479c68ec..f26290ce4096f 100644 --- a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans2.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans2.errors.txt @@ -3,163 +3,162 @@ 1 class A { }    ~ - file2.ts:1:7 + file2.ts:1:7 - 'A' was also declared here. 1 class A { }    ~ - 'A' was also declared here. + file1.ts:2:7 - error TS2300: Duplicate identifier 'B'. 2 class B { }    ~ - file2.ts:2:7 + file2.ts:2:7 - 'B' was also declared here. 2 class B { }    ~ - 'B' was also declared here. + file1.ts:3:7 - error TS2300: Duplicate identifier 'C'. 3 class C { }    ~ - file2.ts:3:7 + file2.ts:3:7 - 'C' was also declared here. 3 class C { }    ~ - 'C' was also declared here. + file1.ts:4:7 - error TS2300: Duplicate identifier 'D'. 4 class D { }    ~ - file2.ts:4:7 + file2.ts:4:7 - 'D' was also declared here. 4 class D { }    ~ - 'D' was also declared here. + file1.ts:5:7 - error TS2300: Duplicate identifier 'E'. 5 class E { }    ~ - file2.ts:5:7 + file2.ts:5:7 - 'E' was also declared here. 5 class E { }    ~ - 'E' was also declared here. + file1.ts:6:7 - error TS2300: Duplicate identifier 'F'. 6 class F { }    ~ - file2.ts:6:7 + file2.ts:6:7 - 'F' was also declared here. 6 class F { }    ~ - 'F' was also declared here. + file1.ts:7:7 - error TS2300: Duplicate identifier 'G'. 7 class G { }    ~ - file2.ts:7:7 + file2.ts:7:7 - 'G' was also declared here. 7 class G { }    ~ - 'G' was also declared here. + file1.ts:8:7 - error TS2300: Duplicate identifier 'H'. 8 class H { }    ~ - file2.ts:8:7 + file2.ts:8:7 - 'H' was also declared here. 8 class H { }    ~ - 'H' was also declared here. + file1.ts:9:7 - error TS2300: Duplicate identifier 'I'. 9 class I { }    ~ - file2.ts:9:7 + file2.ts:9:7 - 'I' was also declared here. 9 class I { }    ~ - 'I' was also declared here. + file2.ts:1:7 - error TS2300: Duplicate identifier 'A'. 1 class A { }    ~ - file1.ts:1:7 + file1.ts:1:7 - 'A' was also declared here. 1 class A { }    ~ - 'A' was also declared here. + file2.ts:2:7 - error TS2300: Duplicate identifier 'B'. 2 class B { }    ~ - file1.ts:2:7 + file1.ts:2:7 - 'B' was also declared here. 2 class B { }    ~ - 'B' was also declared here. + file2.ts:3:7 - error TS2300: Duplicate identifier 'C'. 3 class C { }    ~ - file1.ts:3:7 + file1.ts:3:7 - 'C' was also declared here. 3 class C { }    ~ - 'C' was also declared here. + file2.ts:4:7 - error TS2300: Duplicate identifier 'D'. 4 class D { }    ~ - file1.ts:4:7 + file1.ts:4:7 - 'D' was also declared here. 4 class D { }    ~ - 'D' was also declared here. + file2.ts:5:7 - error TS2300: Duplicate identifier 'E'. 5 class E { }    ~ - file1.ts:5:7 + file1.ts:5:7 - 'E' was also declared here. 5 class E { }    ~ - 'E' was also declared here. + file2.ts:6:7 - error TS2300: Duplicate identifier 'F'. 6 class F { }    ~ - file1.ts:6:7 + file1.ts:6:7 - 'F' was also declared here. 6 class F { }    ~ - 'F' was also declared here. + file2.ts:7:7 - error TS2300: Duplicate identifier 'G'. 7 class G { }    ~ - file1.ts:7:7 + file1.ts:7:7 - 'G' was also declared here. 7 class G { }    ~ - 'G' was also declared here. + file2.ts:8:7 - error TS2300: Duplicate identifier 'H'. 8 class H { }    ~ - file1.ts:8:7 + file1.ts:8:7 - 'H' was also declared here. 8 class H { }    ~ - 'H' was also declared here. + file2.ts:9:7 - error TS2300: Duplicate identifier 'I'. 9 class I { }    ~ - file1.ts:9:7 + file1.ts:9:7 - 'I' was also declared here. 9 class I { }    ~ - 'I' was also declared here. ==== file1.ts (9 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans3.errors.txt b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans3.errors.txt index b08664db5ce5a..e61e71853317b 100644 --- a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans3.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans3.errors.txt @@ -3,55 +3,54 @@ 2 duplicate1: () => string;    ~~~~~~~~~~ - file2.ts:2:5 + file2.ts:2:5 - 'duplicate1' was also declared here. 2 duplicate1(): number;    ~~~~~~~~~~ - 'duplicate1' was also declared here. + file1.ts:3:5 - error TS2300: Duplicate identifier 'duplicate2'. 3 duplicate2: () => string;    ~~~~~~~~~~ - file2.ts:3:5 + file2.ts:3:5 - 'duplicate2' was also declared here. 3 duplicate2(): number;    ~~~~~~~~~~ - 'duplicate2' was also declared here. + file1.ts:4:5 - error TS2300: Duplicate identifier 'duplicate3'. 4 duplicate3: () => string;    ~~~~~~~~~~ - file2.ts:4:5 + file2.ts:4:5 - 'duplicate3' was also declared here. 4 duplicate3(): number;    ~~~~~~~~~~ - 'duplicate3' was also declared here. + file2.ts:2:5 - error TS2300: Duplicate identifier 'duplicate1'. 2 duplicate1(): number;    ~~~~~~~~~~ - file1.ts:2:5 + file1.ts:2:5 - 'duplicate1' was also declared here. 2 duplicate1: () => string;    ~~~~~~~~~~ - 'duplicate1' was also declared here. + file2.ts:3:5 - error TS2300: Duplicate identifier 'duplicate2'. 3 duplicate2(): number;    ~~~~~~~~~~ - file1.ts:3:5 + file1.ts:3:5 - 'duplicate2' was also declared here. 3 duplicate2: () => string;    ~~~~~~~~~~ - 'duplicate2' was also declared here. + file2.ts:4:5 - error TS2300: Duplicate identifier 'duplicate3'. 4 duplicate3(): number;    ~~~~~~~~~~ - file1.ts:4:5 + file1.ts:4:5 - 'duplicate3' was also declared here. 4 duplicate3: () => string;    ~~~~~~~~~~ - 'duplicate3' was also declared here. ==== file1.ts (3 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans4.errors.txt b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans4.errors.txt index c6088fa352d7c..3cf299fdb9d2e 100644 --- a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans4.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans4.errors.txt @@ -3,145 +3,144 @@ 2 duplicate1: () => string;    ~~~~~~~~~~ - file2.ts:2:5 + file2.ts:2:5 - 'duplicate1' was also declared here. 2 duplicate1(): number;    ~~~~~~~~~~ - 'duplicate1' was also declared here. + file1.ts:3:5 - error TS2300: Duplicate identifier 'duplicate2'. 3 duplicate2: () => string;    ~~~~~~~~~~ - file2.ts:3:5 + file2.ts:3:5 - 'duplicate2' was also declared here. 3 duplicate2(): number;    ~~~~~~~~~~ - 'duplicate2' was also declared here. + file1.ts:4:5 - error TS2300: Duplicate identifier 'duplicate3'. 4 duplicate3: () => string;    ~~~~~~~~~~ - file2.ts:4:5 + file2.ts:4:5 - 'duplicate3' was also declared here. 4 duplicate3(): number;    ~~~~~~~~~~ - 'duplicate3' was also declared here. + file1.ts:5:5 - error TS2300: Duplicate identifier 'duplicate4'. 5 duplicate4: () => string;    ~~~~~~~~~~ - file2.ts:5:5 + file2.ts:5:5 - 'duplicate4' was also declared here. 5 duplicate4(): number;    ~~~~~~~~~~ - 'duplicate4' was also declared here. + file1.ts:6:5 - error TS2300: Duplicate identifier 'duplicate5'. 6 duplicate5: () => string;    ~~~~~~~~~~ - file2.ts:6:5 + file2.ts:6:5 - 'duplicate5' was also declared here. 6 duplicate5(): number;    ~~~~~~~~~~ - 'duplicate5' was also declared here. + file1.ts:7:5 - error TS2300: Duplicate identifier 'duplicate6'. 7 duplicate6: () => string;    ~~~~~~~~~~ - file2.ts:7:5 + file2.ts:7:5 - 'duplicate6' was also declared here. 7 duplicate6(): number;    ~~~~~~~~~~ - 'duplicate6' was also declared here. + file1.ts:8:5 - error TS2300: Duplicate identifier 'duplicate7'. 8 duplicate7: () => string;    ~~~~~~~~~~ - file2.ts:8:5 + file2.ts:8:5 - 'duplicate7' was also declared here. 8 duplicate7(): number;    ~~~~~~~~~~ - 'duplicate7' was also declared here. + file1.ts:9:5 - error TS2300: Duplicate identifier 'duplicate8'. 9 duplicate8: () => string;    ~~~~~~~~~~ - file2.ts:9:5 + file2.ts:9:5 - 'duplicate8' was also declared here. 9 duplicate8(): number;    ~~~~~~~~~~ - 'duplicate8' was also declared here. + file2.ts:2:5 - error TS2300: Duplicate identifier 'duplicate1'. 2 duplicate1(): number;    ~~~~~~~~~~ - file1.ts:2:5 + file1.ts:2:5 - 'duplicate1' was also declared here. 2 duplicate1: () => string;    ~~~~~~~~~~ - 'duplicate1' was also declared here. + file2.ts:3:5 - error TS2300: Duplicate identifier 'duplicate2'. 3 duplicate2(): number;    ~~~~~~~~~~ - file1.ts:3:5 + file1.ts:3:5 - 'duplicate2' was also declared here. 3 duplicate2: () => string;    ~~~~~~~~~~ - 'duplicate2' was also declared here. + file2.ts:4:5 - error TS2300: Duplicate identifier 'duplicate3'. 4 duplicate3(): number;    ~~~~~~~~~~ - file1.ts:4:5 + file1.ts:4:5 - 'duplicate3' was also declared here. 4 duplicate3: () => string;    ~~~~~~~~~~ - 'duplicate3' was also declared here. + file2.ts:5:5 - error TS2300: Duplicate identifier 'duplicate4'. 5 duplicate4(): number;    ~~~~~~~~~~ - file1.ts:5:5 + file1.ts:5:5 - 'duplicate4' was also declared here. 5 duplicate4: () => string;    ~~~~~~~~~~ - 'duplicate4' was also declared here. + file2.ts:6:5 - error TS2300: Duplicate identifier 'duplicate5'. 6 duplicate5(): number;    ~~~~~~~~~~ - file1.ts:6:5 + file1.ts:6:5 - 'duplicate5' was also declared here. 6 duplicate5: () => string;    ~~~~~~~~~~ - 'duplicate5' was also declared here. + file2.ts:7:5 - error TS2300: Duplicate identifier 'duplicate6'. 7 duplicate6(): number;    ~~~~~~~~~~ - file1.ts:7:5 + file1.ts:7:5 - 'duplicate6' was also declared here. 7 duplicate6: () => string;    ~~~~~~~~~~ - 'duplicate6' was also declared here. + file2.ts:8:5 - error TS2300: Duplicate identifier 'duplicate7'. 8 duplicate7(): number;    ~~~~~~~~~~ - file1.ts:8:5 + file1.ts:8:5 - 'duplicate7' was also declared here. 8 duplicate7: () => string;    ~~~~~~~~~~ - 'duplicate7' was also declared here. + file2.ts:9:5 - error TS2300: Duplicate identifier 'duplicate8'. 9 duplicate8(): number;    ~~~~~~~~~~ - file1.ts:9:5 + file1.ts:9:5 - 'duplicate8' was also declared here. 9 duplicate8: () => string;    ~~~~~~~~~~ - 'duplicate8' was also declared here. ==== file1.ts (8 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans5.errors.txt b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans5.errors.txt index 558c71feb3c30..21f53eb8eb1a0 100644 --- a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans5.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans5.errors.txt @@ -3,55 +3,54 @@ 3 duplicate1: () => string;    ~~~~~~~~~~ - file2.ts:4:9 + file2.ts:4:9 - 'duplicate1' was also declared here. 4 duplicate1(): number;    ~~~~~~~~~~ - 'duplicate1' was also declared here. + file1.ts:4:9 - error TS2300: Duplicate identifier 'duplicate2'. 4 duplicate2: () => string;    ~~~~~~~~~~ - file2.ts:5:9 + file2.ts:5:9 - 'duplicate2' was also declared here. 5 duplicate2(): number;    ~~~~~~~~~~ - 'duplicate2' was also declared here. + file1.ts:5:9 - error TS2300: Duplicate identifier 'duplicate3'. 5 duplicate3: () => string;    ~~~~~~~~~~ - file2.ts:6:9 + file2.ts:6:9 - 'duplicate3' was also declared here. 6 duplicate3(): number;    ~~~~~~~~~~ - 'duplicate3' was also declared here. + file2.ts:4:9 - error TS2300: Duplicate identifier 'duplicate1'. 4 duplicate1(): number;    ~~~~~~~~~~ - file1.ts:3:9 + file1.ts:3:9 - 'duplicate1' was also declared here. 3 duplicate1: () => string;    ~~~~~~~~~~ - 'duplicate1' was also declared here. + file2.ts:5:9 - error TS2300: Duplicate identifier 'duplicate2'. 5 duplicate2(): number;    ~~~~~~~~~~ - file1.ts:4:9 + file1.ts:4:9 - 'duplicate2' was also declared here. 4 duplicate2: () => string;    ~~~~~~~~~~ - 'duplicate2' was also declared here. + file2.ts:6:9 - error TS2300: Duplicate identifier 'duplicate3'. 6 duplicate3(): number;    ~~~~~~~~~~ - file1.ts:5:9 + file1.ts:5:9 - 'duplicate3' was also declared here. 5 duplicate3: () => string;    ~~~~~~~~~~ - 'duplicate3' was also declared here. ==== file1.ts (3 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans6.errors.txt b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans6.errors.txt index f0c25f2c3ebcc..3466d69b043ff 100644 --- a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans6.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans6.errors.txt @@ -3,55 +3,54 @@ 3 duplicate1: () => string;    ~~~~~~~~~~ - file2.ts:5:9 + file2.ts:5:9 - 'duplicate1' was also declared here. 5 duplicate1(): number;    ~~~~~~~~~~ - 'duplicate1' was also declared here. + file1.ts:4:9 - error TS2300: Duplicate identifier 'duplicate2'. 4 duplicate2: () => string;    ~~~~~~~~~~ - file2.ts:6:9 + file2.ts:6:9 - 'duplicate2' was also declared here. 6 duplicate2(): number;    ~~~~~~~~~~ - 'duplicate2' was also declared here. + file1.ts:5:9 - error TS2300: Duplicate identifier 'duplicate3'. 5 duplicate3: () => string;    ~~~~~~~~~~ - file2.ts:7:9 + file2.ts:7:9 - 'duplicate3' was also declared here. 7 duplicate3(): number;    ~~~~~~~~~~ - 'duplicate3' was also declared here. + file2.ts:5:9 - error TS2300: Duplicate identifier 'duplicate1'. 5 duplicate1(): number;    ~~~~~~~~~~ - file1.ts:3:9 + file1.ts:3:9 - 'duplicate1' was also declared here. 3 duplicate1: () => string;    ~~~~~~~~~~ - 'duplicate1' was also declared here. + file2.ts:6:9 - error TS2300: Duplicate identifier 'duplicate2'. 6 duplicate2(): number;    ~~~~~~~~~~ - file1.ts:4:9 + file1.ts:4:9 - 'duplicate2' was also declared here. 4 duplicate2: () => string;    ~~~~~~~~~~ - 'duplicate2' was also declared here. + file2.ts:7:9 - error TS2300: Duplicate identifier 'duplicate3'. 7 duplicate3(): number;    ~~~~~~~~~~ - file1.ts:5:9 + file1.ts:5:9 - 'duplicate3' was also declared here. 5 duplicate3: () => string;    ~~~~~~~~~~ - 'duplicate3' was also declared here. ==== file2.ts (3 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans7.errors.txt b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans7.errors.txt index 4025d50fba249..9381fbbeed026 100644 --- a/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans7.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/duplicateIdentifierRelatedSpans7.errors.txt @@ -3,163 +3,162 @@ 3 duplicate1: () => string;    ~~~~~~~~~~ - file2.ts:5:9 + file2.ts:5:9 - 'duplicate1' was also declared here. 5 duplicate1(): number;    ~~~~~~~~~~ - 'duplicate1' was also declared here. + file1.ts:4:9 - error TS2300: Duplicate identifier 'duplicate2'. 4 duplicate2: () => string;    ~~~~~~~~~~ - file2.ts:6:9 + file2.ts:6:9 - 'duplicate2' was also declared here. 6 duplicate2(): number;    ~~~~~~~~~~ - 'duplicate2' was also declared here. + file1.ts:5:9 - error TS2300: Duplicate identifier 'duplicate3'. 5 duplicate3: () => string;    ~~~~~~~~~~ - file2.ts:7:9 + file2.ts:7:9 - 'duplicate3' was also declared here. 7 duplicate3(): number;    ~~~~~~~~~~ - 'duplicate3' was also declared here. + file1.ts:6:9 - error TS2300: Duplicate identifier 'duplicate4'. 6 duplicate4: () => string;    ~~~~~~~~~~ - file2.ts:8:9 + file2.ts:8:9 - 'duplicate4' was also declared here. 8 duplicate4(): number;    ~~~~~~~~~~ - 'duplicate4' was also declared here. + file1.ts:7:9 - error TS2300: Duplicate identifier 'duplicate5'. 7 duplicate5: () => string;    ~~~~~~~~~~ - file2.ts:9:9 + file2.ts:9:9 - 'duplicate5' was also declared here. 9 duplicate5(): number;    ~~~~~~~~~~ - 'duplicate5' was also declared here. + file1.ts:8:9 - error TS2300: Duplicate identifier 'duplicate6'. 8 duplicate6: () => string;    ~~~~~~~~~~ - file2.ts:10:9 + file2.ts:10:9 - 'duplicate6' was also declared here. 10 duplicate6(): number;    ~~~~~~~~~~ - 'duplicate6' was also declared here. + file1.ts:9:9 - error TS2300: Duplicate identifier 'duplicate7'. 9 duplicate7: () => string;    ~~~~~~~~~~ - file2.ts:11:9 + file2.ts:11:9 - 'duplicate7' was also declared here. 11 duplicate7(): number;    ~~~~~~~~~~ - 'duplicate7' was also declared here. + file1.ts:10:9 - error TS2300: Duplicate identifier 'duplicate8'. 10 duplicate8: () => string;    ~~~~~~~~~~ - file2.ts:12:9 + file2.ts:12:9 - 'duplicate8' was also declared here. 12 duplicate8(): number;    ~~~~~~~~~~ - 'duplicate8' was also declared here. + file1.ts:11:9 - error TS2300: Duplicate identifier 'duplicate9'. 11 duplicate9: () => string;    ~~~~~~~~~~ - file2.ts:13:9 + file2.ts:13:9 - 'duplicate9' was also declared here. 13 duplicate9(): number;    ~~~~~~~~~~ - 'duplicate9' was also declared here. + file2.ts:5:9 - error TS2300: Duplicate identifier 'duplicate1'. 5 duplicate1(): number;    ~~~~~~~~~~ - file1.ts:3:9 + file1.ts:3:9 - 'duplicate1' was also declared here. 3 duplicate1: () => string;    ~~~~~~~~~~ - 'duplicate1' was also declared here. + file2.ts:6:9 - error TS2300: Duplicate identifier 'duplicate2'. 6 duplicate2(): number;    ~~~~~~~~~~ - file1.ts:4:9 + file1.ts:4:9 - 'duplicate2' was also declared here. 4 duplicate2: () => string;    ~~~~~~~~~~ - 'duplicate2' was also declared here. + file2.ts:7:9 - error TS2300: Duplicate identifier 'duplicate3'. 7 duplicate3(): number;    ~~~~~~~~~~ - file1.ts:5:9 + file1.ts:5:9 - 'duplicate3' was also declared here. 5 duplicate3: () => string;    ~~~~~~~~~~ - 'duplicate3' was also declared here. + file2.ts:8:9 - error TS2300: Duplicate identifier 'duplicate4'. 8 duplicate4(): number;    ~~~~~~~~~~ - file1.ts:6:9 + file1.ts:6:9 - 'duplicate4' was also declared here. 6 duplicate4: () => string;    ~~~~~~~~~~ - 'duplicate4' was also declared here. + file2.ts:9:9 - error TS2300: Duplicate identifier 'duplicate5'. 9 duplicate5(): number;    ~~~~~~~~~~ - file1.ts:7:9 + file1.ts:7:9 - 'duplicate5' was also declared here. 7 duplicate5: () => string;    ~~~~~~~~~~ - 'duplicate5' was also declared here. + file2.ts:10:9 - error TS2300: Duplicate identifier 'duplicate6'. 10 duplicate6(): number;    ~~~~~~~~~~ - file1.ts:8:9 + file1.ts:8:9 - 'duplicate6' was also declared here. 8 duplicate6: () => string;    ~~~~~~~~~~ - 'duplicate6' was also declared here. + file2.ts:11:9 - error TS2300: Duplicate identifier 'duplicate7'. 11 duplicate7(): number;    ~~~~~~~~~~ - file1.ts:9:9 + file1.ts:9:9 - 'duplicate7' was also declared here. 9 duplicate7: () => string;    ~~~~~~~~~~ - 'duplicate7' was also declared here. + file2.ts:12:9 - error TS2300: Duplicate identifier 'duplicate8'. 12 duplicate8(): number;    ~~~~~~~~~~ - file1.ts:10:9 + file1.ts:10:9 - 'duplicate8' was also declared here. 10 duplicate8: () => string;    ~~~~~~~~~~ - 'duplicate8' was also declared here. + file2.ts:13:9 - error TS2300: Duplicate identifier 'duplicate9'. 13 duplicate9(): number;    ~~~~~~~~~~ - file1.ts:11:9 + file1.ts:11:9 - 'duplicate9' was also declared here. 11 duplicate9: () => string;    ~~~~~~~~~~ - 'duplicate9' was also declared here. ==== file2.ts (9 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/esModuleInteropPrettyErrorRelatedInformation.errors.txt b/tsc/testdata/baselines/reference/compiler/esModuleInteropPrettyErrorRelatedInformation.errors.txt index d17bb54d2aa2f..0fb5881599cf4 100644 --- a/tsc/testdata/baselines/reference/compiler/esModuleInteropPrettyErrorRelatedInformation.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/esModuleInteropPrettyErrorRelatedInformation.errors.txt @@ -4,10 +4,9 @@ 3 invoke(foo);    ~~~ - index.ts:1:1 + index.ts:1:1 - Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead. 1 import * as foo from "./foo";   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead. ==== foo.d.ts (0 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/manyCompilerErrorsInTheTwoFiles.errors.txt b/tsc/testdata/baselines/reference/compiler/manyCompilerErrorsInTheTwoFiles.errors.txt index ca96d5ebf11b7..b7461fff03671 100644 --- a/tsc/testdata/baselines/reference/compiler/manyCompilerErrorsInTheTwoFiles.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/manyCompilerErrorsInTheTwoFiles.errors.txt @@ -2,74 +2,92 @@ 1 const a =!@#!@$    ~~ + a.ts:1:13 - error TS1134: Variable declaration expected. 1 const a =!@#!@$    ~ + a.ts:1:16 - error TS1109: Expression expected. 1 const a =!@#!@$    ~ + a.ts:2:13 - error TS18026: '#!' can only be used at the start of a file. 2 const b = !@#!@#!@#!    ~~ + a.ts:2:14 - error TS1134: Variable declaration expected. 2 const b = !@#!@#!@#!    ~ + a.ts:2:16 - error TS18026: '#!' can only be used at the start of a file. 2 const b = !@#!@#!@#!    ~~ + a.ts:2:19 - error TS18026: '#!' can only be used at the start of a file. 2 const b = !@#!@#!@#!    ~~ + a.ts:3:1 - error TS2304: Cannot find name 'OK'. 3 OK!   ~~ + a.ts:4:1 - error TS1434: Unexpected keyword or identifier. 4 HERE's A shouty thing   ~~~~ + a.ts:4:1 - error TS2304: Cannot find name 'HERE'. 4 HERE's A shouty thing   ~~~~ + a.ts:4:22 - error TS1002: Unterminated string literal. 4 HERE's A shouty thing    ~ + a.ts:5:1 - error TS1434: Unexpected keyword or identifier. 5 GOTTA GO FAST   ~~~~~ + a.ts:5:1 - error TS2304: Cannot find name 'GOTTA'. 5 GOTTA GO FAST   ~~~~~ + a.ts:5:7 - error TS1434: Unexpected keyword or identifier. 5 GOTTA GO FAST    ~~ + a.ts:5:7 - error TS2304: Cannot find name 'GO'. 5 GOTTA GO FAST    ~~ + a.ts:5:10 - error TS2304: Cannot find name 'FAST'. 5 GOTTA GO FAST    ~~~~ + b.ts:1:1 - error TS2304: Cannot find name 'fhqwhgads'. 1 fhqwhgads   ~~~~~~~~~ + b.ts:2:1 - error TS2304: Cannot find name 'to'. 2 to   ~~ + b.ts:3:1 - error TS2304: Cannot find name 'limit'. 3 limit diff --git a/tsc/testdata/baselines/reference/compiler/prettyContextNotDebugAssertion.errors.txt b/tsc/testdata/baselines/reference/compiler/prettyContextNotDebugAssertion.errors.txt index 7ed50695b4f32..2c68ee24aa16d 100644 --- a/tsc/testdata/baselines/reference/compiler/prettyContextNotDebugAssertion.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/prettyContextNotDebugAssertion.errors.txt @@ -3,10 +3,9 @@ 2   ~ - index.ts:1:11 + index.ts:1:11 - The parser expected to find a '}' to match the '{' token here. 1 if (true) {    ~ - The parser expected to find a '}' to match the '{' token here. ==== index.ts (1 errors) ==== diff --git a/tsc/testdata/baselines/reference/compiler/prettyFileWithErrorsAndTabs.errors.txt b/tsc/testdata/baselines/reference/compiler/prettyFileWithErrorsAndTabs.errors.txt index 38509fcc0902d..810c38262b7cb 100644 --- a/tsc/testdata/baselines/reference/compiler/prettyFileWithErrorsAndTabs.errors.txt +++ b/tsc/testdata/baselines/reference/compiler/prettyFileWithErrorsAndTabs.errors.txt @@ -2,10 +2,12 @@ 3 const x: string = 12;    ~ + prettyFileWithErrorsAndTabs.ts:4:9 - error TS2322: Type 'number' is not assignable to type 'string'. 4 const y: string = 12;    ~ + prettyFileWithErrorsAndTabs.ts:5:9 - error TS2322: Type 'number' is not assignable to type 'string'. 5 const z: string = 12; diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js index 7c34c87276cef..8add78656eff9 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format jsconfig.json to typeAcquisition with json api.js @@ -31,5 +31,4 @@ TypeAcquisition:: FileNames:: /apath/a.ts,/apath/b.ts Errors:: -error TS17010: Unknown type acquisition option 'enableAutoDiscovy'. - +error TS17010: Unknown type acquisition option 'enableAutoDiscovy'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js index 8a0986bdadb62..d6e32be5ddbfe 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/Convert incorrect format tsconfig.json to typeAcquisition with json api.js @@ -25,5 +25,4 @@ TypeAcquisition:: FileNames:: /apath/a.ts,/apath/b.ts Errors:: -error TS17010: Unknown type acquisition option 'enableAutoDiscovy'. - +error TS17010: Unknown type acquisition option 'enableAutoDiscovy'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js index 997bf7716e28d..385937b528ec2 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with json api.js @@ -11,5 +11,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. - +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js index 997bf7716e28d..385937b528ec2 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for directory with no .ts files with jsonSourceFile api.js @@ -11,5 +11,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. - +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js index 30621abe1050d..10da1e28a9f93 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with json api.js @@ -11,5 +11,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. - +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js index 30621abe1050d..10da1e28a9f93 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty directory with jsonSourceFile api.js @@ -11,5 +11,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. - +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js index 9f5abbd52f4c4..e290c4c786d60 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list when no references are provided with json api.js @@ -13,5 +13,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18002: The 'files' list in config file '/apath/tsconfig.json' is empty. - +error TS18002: The 'files' list in config file '/apath/tsconfig.json' is empty. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js index ae92900487d30..d6c070663e130 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty files list with json api.js @@ -12,5 +12,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18002: The 'files' list in config file '/apath/tsconfig.json' is empty. - +error TS18002: The 'files' list in config file '/apath/tsconfig.json' is empty. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js index b22486c178a36..9b23e6b9e8585 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with json api.js @@ -12,5 +12,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[]' and 'exclude' paths were '[]'. - +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js index b22486c178a36..9b23e6b9e8585 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for empty include with jsonSourceFile api.js @@ -12,5 +12,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[]' and 'exclude' paths were '[]'. - +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with json api.js index 0cc47503753c8..348ef1309a490 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with json api.js @@ -13,5 +13,4 @@ FileNames:: Errors:: error TS5065: File specification cannot contain a parent directory ('..') that appears after a recursive directory wildcard ('**'): '**/../*.ts'. -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/../*.ts"]' and 'exclude' paths were '[]'. - +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/../*.ts"]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with jsonSourceFile api.js index 91aca843db251..fd1b7ee08c416 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for include with parent directory after recursive wildcard with jsonSourceFile api.js @@ -16,5 +16,5 @@ Errors:: 2 "include": ["**/../*.ts"]    ~~~~~~~~~~~~ -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/../*.ts"]' and 'exclude' paths were '[]'. - + +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/../*.ts"]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js index fd6a9ae4ac50e..6224f4c9e1c6c 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with json api.js @@ -15,5 +15,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["/apath"]'. - +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["/apath"]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js index fd6a9ae4ac50e..6224f4c9e1c6c 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors for includes with outDir with jsonSourceFile api.js @@ -15,5 +15,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["/apath"]'. - +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["/apath"]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js index 26382641787bb..687d07172e1c5 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when commandline option is in tsconfig with json api.js @@ -14,5 +14,4 @@ configFileName:: /apath/tsconfig.json FileNames:: /apath/a.ts Errors:: -error TS6266: Option 'help' can only be specified on command line. - +error TS6266: Option 'help' can only be specified on command line. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js index 84e229b6d89fc..862250c5c77e5 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when files is not string with json api.js @@ -19,5 +19,4 @@ configFileName:: /apath/tsconfig.json FileNames:: Errors:: -error TS5024: Compiler option 'files' requires a value of type string. - +error TS5024: Compiler option 'files' requires a value of type string. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js index e4e6af740d50a..70c5e06e9eed9 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with json api.js @@ -17,5 +17,4 @@ FileNames:: Errors:: error TS5024: Compiler option 'include' requires a value of type string. -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[["./**/*.ts"]]' and 'exclude' paths were '[]'. - +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[["./**/*.ts"]]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js index 14386748b3be6..b80ebe19dbb9d 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/generates errors when include is not string with jsonSourceFile api.js @@ -24,5 +24,5 @@ Errors::   ~~~~~~~~~~~~~~~~~ 5 ]   ~~~~~ -error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[["./**/*.ts"]]' and 'exclude' paths were '[]'. - + +error TS18003: No inputs were found in config file '/apath/tsconfig.json'. Specified 'include' paths were '[["./**/*.ts"]]' and 'exclude' paths were '[]'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js index ca5b9b0e7f5bb..d07c2c117ec84 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports error for an unknown option with json api.js @@ -14,5 +14,4 @@ configFileName:: tsconfig.json FileNames:: /app.ts Errors:: -error TS5023: Unknown compiler option 'unknown'. - +error TS5023: Unknown compiler option 'unknown'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with json api.js index fe83886909fe4..fb63985a902e6 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with json api.js @@ -40,5 +40,4 @@ Errors:: error TS5025: Unknown compiler option 'nouncheckedsideeffectimports'. Did you mean 'noUncheckedSideEffectImports'? error TS5025: Unknown compiler option 'moduledetection'. Did you mean 'moduleDetection'? error TS5025: Unknown compiler option 'skiplibcheck'. Did you mean 'skipLibCheck'? -error TS5025: Unknown compiler option 'checkjs'. Did you mean 'checkJs'? - +error TS5025: Unknown compiler option 'checkjs'. Did you mean 'checkJs'? diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with jsonSourceFile api.js index 41a5b1a2bf7d9..b0719d4b7f4cf 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for incorrectly cased option names with jsonSourceFile api.js @@ -35,38 +35,47 @@ Errors:: 3 "sourcemap": true,    ~~~~~~~~~~~ + tsconfig.json:4:5 - error TS5025: Unknown compiler option 'declarationmap'. Did you mean 'declarationMap'? 4 "declarationmap": true,    ~~~~~~~~~~~~~~~~ + tsconfig.json:5:5 - error TS5025: Unknown compiler option 'nouncheckedindexedaccess'. Did you mean 'noUncheckedIndexedAccess'? 5 "nouncheckedindexedaccess": true,    ~~~~~~~~~~~~~~~~~~~~~~~~~~ + tsconfig.json:6:5 - error TS5025: Unknown compiler option 'exactoptionalpropertytypes'. Did you mean 'exactOptionalPropertyTypes'? 6 "exactoptionalpropertytypes": true,    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + tsconfig.json:7:5 - error TS5025: Unknown compiler option 'verbatimmodulesyntax'. Did you mean 'verbatimModuleSyntax'? 7 "verbatimmodulesyntax": true,    ~~~~~~~~~~~~~~~~~~~~~~ + tsconfig.json:8:5 - error TS5025: Unknown compiler option 'isolatedmodules'. Did you mean 'isolatedModules'? 8 "isolatedmodules": true,    ~~~~~~~~~~~~~~~~~ + tsconfig.json:9:5 - error TS5025: Unknown compiler option 'nouncheckedsideeffectimports'. Did you mean 'noUncheckedSideEffectImports'? 9 "nouncheckedsideeffectimports": true,    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + tsconfig.json:10:5 - error TS5025: Unknown compiler option 'moduledetection'. Did you mean 'moduleDetection'? 10 "moduledetection": "force",    ~~~~~~~~~~~~~~~~~ + tsconfig.json:11:5 - error TS5025: Unknown compiler option 'skiplibcheck'. Did you mean 'skipLibCheck'? 11 "skiplibcheck": true,    ~~~~~~~~~~~~~~ + tsconfig.json:12:5 - error TS5025: Unknown compiler option 'checkjs'. Did you mean 'checkJs'? 12 "checkjs": true diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js index f51e477c660e1..9ad898f4d6399 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with json api.js @@ -18,5 +18,4 @@ FileNames:: Errors:: error TS6046: Argument for '--target' option must be: 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'es2025', 'esnext'. error TS5024: Compiler option 'removeComments' requires a value of type boolean. -error TS6046: Argument for '--moduleResolution' option must be: 'node16', 'nodenext', 'bundler'. - +error TS6046: Argument for '--moduleResolution' option must be: 'node16', 'nodenext', 'bundler'. diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js index 422e4c3c9f352..a32648be78659 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports errors for wrong type option and invalid enum value with jsonSourceFile api.js @@ -20,10 +20,12 @@ Errors:: 3 "target": "invalid value",    ~~~~~~~~~~~~~~~ + tsconfig.json:4:23 - error TS5024: Compiler option 'removeComments' requires a value of type boolean. 4 "removeComments": "should be a boolean",    ~~~~~~~~~~~~~~~~~~~~~ + tsconfig.json:5:25 - error TS6046: Argument for '--moduleResolution' option must be: 'node16', 'nodenext', 'bundler'. 5 "moduleResolution": "invalid value" diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with json api.js index a5d32b708c15d..b79c50099efe3 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/reports spelling suggestion for an unknown option with json api.js @@ -14,5 +14,4 @@ configFileName:: tsconfig.json FileNames:: /app.ts Errors:: -error TS5025: Unknown compiler option 'targt'. Did you mean 'target'? - +error TS5025: Unknown compiler option 'targt'. Did you mean 'target'? diff --git a/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js b/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js index eb0f0e1d547cb..f1ec52ed93f99 100644 --- a/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js +++ b/tsc/testdata/baselines/reference/config/tsconfigParsing/returns error when tsconfig have excludes with json api.js @@ -20,5 +20,4 @@ configFileName:: tsconfig.json FileNames:: /apath/foge.ts,/apath/test.ts Errors:: -error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? - +error TS6114: Unknown option 'excludes'. Did you mean 'exclude'? diff --git a/tsc/testdata/baselines/reference/conformance/typedefCrossModule5.errors.txt b/tsc/testdata/baselines/reference/conformance/typedefCrossModule5.errors.txt index d557f9ab1eb76..748c5510b8d78 100644 --- a/tsc/testdata/baselines/reference/conformance/typedefCrossModule5.errors.txt +++ b/tsc/testdata/baselines/reference/conformance/typedefCrossModule5.errors.txt @@ -3,37 +3,36 @@ 1 /** @typedef {number} Foo */    ~~~ - mod2.js:1:7 + mod2.js:1:7 - 'Foo' was also declared here. 1 class Foo { } // should error    ~~~ - 'Foo' was also declared here. + mod1.js:2:7 - error TS2451: Cannot redeclare block-scoped variable 'Bar'. 2 class Bar {}    ~~~ - mod2.js:2:7 + mod2.js:2:7 - 'Bar' was also declared here. 2 const Bar = 3;    ~~~ - 'Bar' was also declared here. + mod2.js:1:7 - error TS2300: Duplicate identifier 'Foo'. 1 class Foo { } // should error    ~~~ - mod1.js:1:23 + mod1.js:1:23 - 'Foo' was also declared here. 1 /** @typedef {number} Foo */    ~~~ - 'Foo' was also declared here. + mod2.js:2:7 - error TS2451: Cannot redeclare block-scoped variable 'Bar'. 2 const Bar = 3;    ~~~ - mod1.js:2:7 + mod1.js:2:7 - 'Bar' was also declared here. 2 class Bar {}    ~~~ - 'Bar' was also declared here. ==== mod1.js (2 errors) ==== diff --git a/tsc/testdata/baselines/reference/tsbuild/commandLine/bad-locale.js b/tsc/testdata/baselines/reference/tsbuild/commandLine/bad-locale.js index 41ce42d0822cf..f85b09a8f91b0 100644 --- a/tsc/testdata/baselines/reference/tsbuild/commandLine/bad-locale.js +++ b/tsc/testdata/baselines/reference/tsbuild/commandLine/bad-locale.js @@ -7,4 +7,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS6048: Locale must be an IETF BCP 47 language tag. Examples: 'en', 'ja-jp'. - diff --git a/tsc/testdata/baselines/reference/tsbuild/commandLine/when-build-not-first-argument.js b/tsc/testdata/baselines/reference/tsbuild/commandLine/when-build-not-first-argument.js index 1b6af49f54f0d..d44964311b2eb 100644 --- a/tsc/testdata/baselines/reference/tsbuild/commandLine/when-build-not-first-argument.js +++ b/tsc/testdata/baselines/reference/tsbuild/commandLine/when-build-not-first-argument.js @@ -6,7 +6,5 @@ tsgo --verbose --build ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5093: Compiler option '--verbose' may only be used with '--build'. - error TS6369: Option '--build' must be the first command line argument. - diff --git a/tsc/testdata/baselines/reference/tsbuild/configFileErrors/missing-config-file.js b/tsc/testdata/baselines/reference/tsbuild/configFileErrors/missing-config-file.js index 8d1d180950b1c..c194821e7e3a0 100644 --- a/tsc/testdata/baselines/reference/tsbuild/configFileErrors/missing-config-file.js +++ b/tsc/testdata/baselines/reference/tsbuild/configFileErrors/missing-config-file.js @@ -7,7 +7,6 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS6053: File '/home/src/workspaces/project/bogus.json' not found. - Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js b/tsc/testdata/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js index 83ba10640a7b8..04120bd116f8a 100644 --- a/tsc/testdata/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js +++ b/tsc/testdata/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js @@ -30,14 +30,10 @@ tsgo --b ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: error TS5083: Cannot read file '/home/src/workspaces/project/foobar.json'. - error TS18003: No inputs were found in config file '/home/src/workspaces/project/tsconfig.first.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. - error TS5083: Cannot read file '/home/src/workspaces/project/foobar.json'. - error TS18003: No inputs were found in config file '/home/src/workspaces/project/tsconfig.second.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. - Found 4 errors. //// [/home/src/workspaces/project/tsconfig.first.tsbuildinfo] *new* diff --git a/tsc/testdata/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js b/tsc/testdata/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js index bcc735c0c26b2..6753102212018 100644 --- a/tsc/testdata/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js +++ b/tsc/testdata/baselines/reference/tsbuild/demo/in-circular-branch-reports-the-error-about-it-by-stopping-build.js @@ -128,7 +128,6 @@ Output:: /user/username/projects/demo/zoo/tsconfig.json /user/username/projects/demo/animals/tsconfig.json - Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js b/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js index 7317ea74d8899..bbb460196c3bb 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js @@ -28,10 +28,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -190,10 +189,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -448,10 +446,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -582,10 +579,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -614,10 +610,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -1045,10 +1040,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors.js b/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors.js index be71f7f25d0e0..a1c925662626e 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors.js +++ b/tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors.js @@ -28,10 +28,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... @@ -121,10 +120,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... @@ -302,10 +300,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... @@ -369,10 +366,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... @@ -411,10 +407,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... @@ -642,10 +637,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js index 2a5ed7dde09e7..5e30488659633 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js @@ -365,20 +365,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -982,20 +980,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1266,20 +1262,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1317,20 +1311,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1368,20 +1360,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1419,20 +1409,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js index d9ca79fa2b2a7..edc7612baca6a 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js @@ -364,20 +364,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -957,20 +955,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1243,20 +1239,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1294,20 +1288,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1345,20 +1337,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1396,20 +1386,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js index d8b3a3979c423..44116bd52c4a7 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js @@ -306,20 +306,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -875,20 +873,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1134,20 +1130,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1185,20 +1179,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1236,20 +1228,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1287,20 +1277,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js index 5b4df4b9c1042..90722985262a1 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js @@ -524,20 +524,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js index 2ce86dff240ed..2ee26d6b550a1 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js @@ -497,20 +497,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js index c3d8097f3cb78..ebf7151afa8a1 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js @@ -436,20 +436,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js index e937dbec56714..f3f845431f1d5 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js @@ -146,10 +146,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -277,10 +276,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -422,10 +420,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js index 490e73f31cccf..d104050739f79 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js @@ -133,10 +133,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -251,10 +250,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -383,10 +381,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js index 5ccc29291276d..b4897da99ae1f 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -178,30 +178,27 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 + c.ts:1:14 - Add a type annotation to the variable c. 1 export const c = class { private p = 10; };    ~ - Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 + d.ts:1:14 - Add a type annotation to the variable d. 1 export const d = class { private p = 10; };    ~ - Add a type annotation to the variable d. Found 3 errors in 3 files. @@ -420,30 +417,27 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 + c.ts:1:14 - Add a type annotation to the variable c. 1 export const c = class { private p = 10; };    ~ - Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 + d.ts:1:14 - Add a type annotation to the variable d. 1 export const d = class { private p = 10; };    ~ - Add a type annotation to the variable d. Found 3 errors in 3 files. @@ -676,30 +670,27 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 + c.ts:1:14 - Add a type annotation to the variable c. 1 export const c = class { private p = 10; };    ~ - Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 + d.ts:1:14 - Add a type annotation to the variable d. 1 export const d = class { private p = 10; };    ~ - Add a type annotation to the variable d. Found 3 errors in 3 files. @@ -1072,20 +1063,18 @@ Output:: 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 + c.ts:1:14 - Add a type annotation to the variable c. 1 export const c = class { private p = 10; };    ~ - Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 + d.ts:1:14 - Add a type annotation to the variable d. 1 export const d = class { private p = 10; };    ~ - Add a type annotation to the variable d. Found 2 errors in 2 files. @@ -1286,20 +1275,18 @@ Output:: 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 + c.ts:1:14 - Add a type annotation to the variable c. 1 export const c = class { private p = 10; };    ~ - Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 + d.ts:1:14 - Add a type annotation to the variable d. 1 export const d = class { private p = 10; };    ~ - Add a type annotation to the variable d. Found 2 errors in 2 files. @@ -1503,10 +1490,9 @@ Output:: 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 + d.ts:1:14 - Add a type annotation to the variable d. 1 export const d = class { private p = 10; };    ~ - Add a type annotation to the variable d. Found 1 error in d.ts:1 diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes.js index bd48227f7755d..58527768b2b86 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes.js @@ -105,10 +105,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -154,10 +153,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -224,10 +222,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js index 72f5632b7fcf2..dd20817117c4a 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js @@ -28,10 +28,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -185,10 +184,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -436,10 +434,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -584,10 +581,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -717,10 +713,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js index d9506c4bd6a3f..c719ef150f4d8 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js @@ -26,10 +26,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -169,10 +168,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -384,10 +382,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -506,10 +503,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -621,10 +617,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors.js b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors.js index d2addd198b59f..6ea5a365d78c4 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors.js @@ -26,10 +26,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -98,10 +97,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -236,10 +234,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -285,10 +282,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... @@ -329,10 +325,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js b/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js index e3e9765a8d774..80bca24844738 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration-with-incremental.js @@ -36,10 +36,9 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 + src/main.ts:2:14 - Add a type annotation to the variable a. 2 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in src/main.ts:2 @@ -222,10 +221,9 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 + src/main.ts:2:14 - Add a type annotation to the variable a. 2 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in src/main.ts:2 diff --git a/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration.js b/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration.js index 8615949e8e748..1c5fe2ab6db76 100644 --- a/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration.js +++ b/tsc/testdata/baselines/reference/tsbuild/noEmitOnError/dts-errors-with-declaration.js @@ -36,10 +36,9 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 + src/main.ts:2:14 - Add a type annotation to the variable a. 2 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in src/main.ts:2 @@ -122,10 +121,9 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 + src/main.ts:2:14 - Add a type annotation to the variable a. 2 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in src/main.ts:2 diff --git a/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js b/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js index 2ae7a6dece635..64dfdb89976d2 100644 --- a/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js +++ b/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js @@ -28,7 +28,6 @@ Output:: The file is in the program because: Matched by default include pattern '**/*' - Found 1 error. //// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib* @@ -165,7 +164,6 @@ Output:: The file is in the program because: Matched by default include pattern '**/*' - Found 1 error. @@ -186,7 +184,6 @@ Output:: The file is in the program because: Matched by default include pattern '**/*' - Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js b/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js index fb88da9a58094..ef89e37d1413c 100644 --- a/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js +++ b/tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js @@ -27,7 +27,6 @@ Output:: The file is in the program because: Matched by default include pattern '**/*' - Found 1 error. //// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib* @@ -106,7 +105,6 @@ Output:: The file is in the program because: Matched by default include pattern '**/*' - Found 1 error. //// [/home/src/workspaces/project/dist/index.js] *rewrite with same content* @@ -131,7 +129,6 @@ Output:: The file is in the program because: Matched by default include pattern '**/*' - Found 1 error. //// [/home/src/workspaces/project/dist/index.js] *rewrite with same content* diff --git a/tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js b/tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js index fe10e5b98a911..91ded68a14bbe 100644 --- a/tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js +++ b/tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js @@ -55,7 +55,6 @@ Output:: [HH:MM:SS AM] Building project 'project/strings/tsconfig.json'... error TS5108: Option 'target=ES5' has been removed. Please remove it from your configuration. - ../../tslibs/TS/Lib/lib.d.ts Default library for target 'ES5' project/strings/foo.json @@ -65,7 +64,6 @@ project/strings/foo.json [HH:MM:SS AM] Building project 'project/main/tsconfig.json'... error TS5108: Option 'target=ES5' has been removed. Please remove it from your configuration. - ../../tslibs/TS/Lib/lib.d.ts Default library for target 'ES5' project/strings/foo.json @@ -272,7 +270,6 @@ Output:: [HH:MM:SS AM] Building project 'project/strings/tsconfig.json'... error TS5108: Option 'target=ES5' has been removed. Please remove it from your configuration. - ../../tslibs/TS/Lib/lib.d.ts Default library for target 'ES5' project/strings/foo.json @@ -282,7 +279,6 @@ project/strings/foo.json [HH:MM:SS AM] Building project 'project/main/tsconfig.json'... error TS5108: Option 'target=ES5' has been removed. Please remove it from your configuration. - ../../tslibs/TS/Lib/lib.d.ts Default library for target 'ES5' project/strings/foo.json diff --git a/tsc/testdata/baselines/reference/tsbuild/sample/building-project-in-not-build-order-doesnt-throw-error.js b/tsc/testdata/baselines/reference/tsbuild/sample/building-project-in-not-build-order-doesnt-throw-error.js index 89bf911460ba4..bda501271aebb 100644 --- a/tsc/testdata/baselines/reference/tsbuild/sample/building-project-in-not-build-order-doesnt-throw-error.js +++ b/tsc/testdata/baselines/reference/tsbuild/sample/building-project-in-not-build-order-doesnt-throw-error.js @@ -70,7 +70,6 @@ Output:: error TS6053: File '/user/username/projects/sample1/logic2/tsconfig.json' not found. - Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsbuild/sample/cleaning-project-in-not-build-order-doesnt-throw-error.js b/tsc/testdata/baselines/reference/tsbuild/sample/cleaning-project-in-not-build-order-doesnt-throw-error.js index cd0e6fb6b413b..5a1bbd8d55785 100644 --- a/tsc/testdata/baselines/reference/tsbuild/sample/cleaning-project-in-not-build-order-doesnt-throw-error.js +++ b/tsc/testdata/baselines/reference/tsbuild/sample/cleaning-project-in-not-build-order-doesnt-throw-error.js @@ -65,7 +65,6 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS6053: File '/user/username/projects/sample1/logic2/tsconfig.json' not found. - Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js b/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js index 14cdedc21f3a1..aca525d206f64 100644 --- a/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js +++ b/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js @@ -69,11 +69,9 @@ Output:: error TS6053: File '/user/username/projects/sample1/core/anotherModule.ts' not found. The file is in the program because: Part of 'files' list in tsconfig.json - - core/tsconfig.json:3:16 + core/tsconfig.json:3:16 - File is matched by 'files' list specified here. 3 "files": ["anotherModule.ts", "index.ts", "some_decl.d.ts"],    ~~~~~~~~~~~~~~~~~~ - File is matched by 'files' list specified here. [HH:MM:SS AM] Project 'logic/tsconfig.json' is being forcibly rebuilt diff --git a/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js b/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js index 81f11be9100b8..48909bacf674f 100644 --- a/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js +++ b/tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js @@ -69,11 +69,9 @@ Output:: error TS6053: File '/user/username/projects/sample1/core/anotherModule.ts' not found. The file is in the program because: Part of 'files' list in tsconfig.json - - core/tsconfig.json:3:16 + core/tsconfig.json:3:16 - File is matched by 'files' list specified here. 3 "files": ["anotherModule.ts", "index.ts", "some_decl.d.ts"],    ~~~~~~~~~~~~~~~~~~ - File is matched by 'files' list specified here. [HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist diff --git a/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js b/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js index 5a9d28fca3d8d..3ea7785e80104 100644 --- a/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js +++ b/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js @@ -76,10 +76,9 @@ Output:: 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~ - core/index.ts:3:26 + core/index.ts:3:26 - An argument for 'a' was not provided. 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~~ - An argument for 'a' was not provided. [HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors @@ -278,10 +277,9 @@ Output:: 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~ - core/index.ts:3:26 + core/index.ts:3:26 - An argument for 'a' was not provided. 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~~ - An argument for 'a' was not provided. [HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors diff --git a/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js b/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js index 83989c3f96c1c..f8439919cb630 100644 --- a/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js +++ b/tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js @@ -77,10 +77,9 @@ Output:: 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~ - core/index.ts:3:26 + core/index.ts:3:26 - An argument for 'a' was not provided. 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~~ - An argument for 'a' was not provided. [HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors @@ -279,10 +278,9 @@ Output:: 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~ - core/index.ts:3:26 + core/index.ts:3:26 - An argument for 'a' was not provided. 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~~ - An argument for 'a' was not provided. [HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js b/tsc/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js index f05ffcbbf76a3..0ff2c58725af6 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/demo/updates-with-circular-reference.js @@ -129,7 +129,6 @@ Output:: /user/username/projects/demo/core/tsconfig.json /user/username/projects/demo/zoo/tsconfig.json /user/username/projects/demo/animals/tsconfig.json - [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js b/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js index c020d1d30f47e..265f254afb9fe 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js @@ -30,10 +30,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -441,10 +440,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -600,10 +598,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -744,10 +741,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js b/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js index 039461c4ad11d..5f8d8bba4132d 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js @@ -28,10 +28,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -389,10 +388,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -522,10 +520,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -648,10 +645,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js b/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js index fc71aa91ec852..78428c9996a7f 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js @@ -28,10 +28,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -225,10 +224,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -284,10 +282,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Updating unchanged output timestamps of project 'tsconfig.json'... @@ -338,10 +335,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js b/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js index 9c69b168009c3..167a5b6ded6e4 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration-with-incremental.js @@ -731,10 +731,9 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 + src/main.ts:2:14 - Add a type annotation to the variable a. 2 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -896,10 +895,9 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 + src/main.ts:2:14 - Add a type annotation to the variable a. 2 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js b/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js index 0071c86b73b50..430db82e70af3 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/noEmitOnError/noEmitOnError-with-declaration.js @@ -488,10 +488,9 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 + src/main.ts:2:14 - Add a type annotation to the variable a. 2 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -555,10 +554,9 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 + src/main.ts:2:14 - Add a type annotation to the variable a. 2 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js index 2398fd6998e06..c29ff1a88a093 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-file-with-no-error-changes.js @@ -161,10 +161,9 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - app/fileWithError.ts:1:12 + app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - Add a type annotation to the variable myClassWithError. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -303,10 +302,9 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - app/fileWithError.ts:1:12 + app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - Add a type annotation to the variable myClassWithError. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js index f8fb35d19a78b..27e5d2018aeb8 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-introduceError-when-fixing-errors-only-changed-file-is-emitted.js @@ -161,10 +161,9 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - app/fileWithError.ts:1:12 + app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - Add a type annotation to the variable myClassWithError. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js index b19de72392db6..7d854c571330c 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-file-with-no-error-changes.js @@ -25,10 +25,9 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - app/fileWithError.ts:1:12 + app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - Add a type annotation to the variable myClassWithError. [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -191,10 +190,9 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - app/fileWithError.ts:1:12 + app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - Add a type annotation to the variable myClassWithError. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js index d314748adb740..d99e8d2345cda 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/declarationEmitErrors-when-fixing-error-files-all-files-are-emitted.js @@ -25,10 +25,9 @@ Output:: 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - app/fileWithError.ts:1:12 + app/fileWithError.ts:1:12 - Add a type annotation to the variable myClassWithError. 1 export var myClassWithError = class {    ~~~~~~~~~~~~~~~~ - Add a type annotation to the variable myClassWithError. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js index d53e0620d4ed5..cfba79d6835b6 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/when-referenced-project-change-introduces-error-in-the-down-stream-project-and-then-fixes-it.js @@ -183,10 +183,9 @@ Output:: 2 createSomeObject().message;    ~~~~~~~ - Library/library.d.ts:2:5 + Library/library.d.ts:2:5 - 'message2' is declared here. 2 message2: string;    ~~~~~~~~ - 'message2' is declared here. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js index ae50819dd158f..9d62bab02b1b0 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/works-with-extended-source-files.js @@ -611,7 +611,6 @@ Output:: [HH:MM:SS AM] Project 'project3.tsconfig.json' is up to date because newest input 'other2.ts' is older than output 'project3.tsconfig.tsbuildinfo' error TS5083: Cannot read file '/user/username/projects/project/extendsConfig2.tsconfig.json'. - [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js b/tsc/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js index 5fd9f7e1a78bd..e763e740bf64d 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/reexport/Reports-errors-correctly.js @@ -249,10 +249,9 @@ Output:: 3 export const session: Session = {    ~~~~~~~ - out/pure/session.d.ts:3:5 + out/pure/session.d.ts:3:5 - 'bar' is declared here. 3 bar: number;    ~~~ - 'bar' is declared here. [HH:MM:SS AM] Found 1 error. Watching for file changes. diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js b/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js index 3f5f319baf05e..e428153fc5354 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js @@ -78,10 +78,9 @@ Output:: 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~ - core/index.ts:3:26 + core/index.ts:3:26 - An argument for 'a' was not provided. 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~~ - An argument for 'a' was not provided. [HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js b/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js index 26adb0086f507..24ee4890e7ad0 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js @@ -79,10 +79,9 @@ Output:: 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~ - core/index.ts:3:26 + core/index.ts:3:26 - An argument for 'a' was not provided. 3 export function multiply(a: number, b: number) { return a * b; }multiply();    ~~~~~~~~~ - An argument for 'a' was not provided. [HH:MM:SS AM] Project 'logic/tsconfig.json' can't be built because its dependency 'core' has errors diff --git a/tsc/testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js b/tsc/testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js index 8ab1914a6e512..f726961eaf767 100644 --- a/tsc/testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js +++ b/tsc/testdata/baselines/reference/tsbuildWatch/sample/watches-config-files-that-are-not-present.js @@ -54,7 +54,6 @@ Output:: [HH:MM:SS AM] Starting compilation in watch mode... error TS6053: File '/user/username/projects/sample1/logic/tsconfig.json' not found. - tests/tsconfig.json:4:9 - error TS6053: File '/user/username/projects/sample1/logic' not found. 4 { "path": "../logic" }, diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option-value.js b/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option-value.js index e2a0f039d1534..a5717b385b1ad 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option-value.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option-value.js @@ -7,4 +7,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'es2025', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'es2025.collection', 'es2025.float16', 'es2025.intl', 'es2025.iterator', 'es2025.promise', 'es2025.regexp', 'esnext.asynciterable', 'esnext.symbol', 'esnext.bigint', 'esnext.weakref', 'esnext.object', 'esnext.regexp', 'esnext.string', 'esnext.float16', 'esnext.iterator', 'esnext.promise', 'esnext.array', 'esnext.collection', 'esnext.date', 'esnext.decorators', 'esnext.disposable', 'esnext.error', 'esnext.intl', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.typedarrays', 'decorators', 'decorators.legacy'. - diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option.js b/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option.js index ab4cf00b46ddc..c31779e874f48 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-incorrect-compiler-option.js @@ -7,4 +7,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5023: Unknown compiler option '--someNonExistOption'. - diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-tsconfig.json.js b/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-tsconfig.json.js index c422ba28acf9a..543a4d4988002 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-tsconfig.json.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/Initialized-TSConfig-with-tsconfig.json.js @@ -16,4 +16,3 @@ ExitStatus:: Success Output:: error TS5054: A 'tsconfig.json' file is already defined at: '/home/src/workspaces/project/tsconfig.json'. - diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js b/tsc/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js index 4de743b46dda3..b717b2f59c748 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js @@ -9,7 +9,6 @@ Output:: The file is in the program because: Root file specified for compilation - Found 1 error. //// [/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts] *Lib* diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/bad-locale.js b/tsc/testdata/baselines/reference/tsc/commandLine/bad-locale.js index 1444c0edb4086..5d1ad434cd988 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/bad-locale.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/bad-locale.js @@ -7,4 +7,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS6048: Locale must be an IETF BCP 47 language tag. Examples: 'en', 'ja-jp'. - diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-extended-tsconfig-in-different-folder-does-not-exist.js b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-extended-tsconfig-in-different-folder-does-not-exist.js index dca7ad9a8bbcc..117c61bb6b919 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-extended-tsconfig-in-different-folder-does-not-exist.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-extended-tsconfig-in-different-folder-does-not-exist.js @@ -19,7 +19,6 @@ Output:: The file is in the program because: Part of 'files' list in tsconfig.json - Found 1 error. //// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib* diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-does-not-exist.js b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-does-not-exist.js index 9700068259c1f..df87dd1cf194d 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-does-not-exist.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-does-not-exist.js @@ -12,11 +12,9 @@ Output:: error TS6231: Could not resolve the path '/home/src/workspaces/project/src/doesNotExist' with the extensions: '.ts', '.tsx', '.d.ts', '.cts', '.d.cts', '.mts', '.d.mts'. The file is in the program because: Part of 'files' list in tsconfig.json - - tsconfig.json:2:31 + tsconfig.json:2:31 - File is matched by 'files' list specified here. 2 "files": ["./src/doesNotExist"]    ~~~~~~~~~~~~~~~~~~~~ - File is matched by 'files' list specified here. Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-exists.js b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-exists.js index 4137c78adecd9..1bb69d8e84d93 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-exists.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-in-tsconfig-exists.js @@ -14,11 +14,9 @@ Output:: error TS6231: Could not resolve the path '/home/src/workspaces/project/src/script' with the extensions: '.ts', '.tsx', '.d.ts', '.cts', '.d.cts', '.mts', '.d.mts'. The file is in the program because: Part of 'files' list in tsconfig.json - - tsconfig.json:2:31 + tsconfig.json:2:31 - File is matched by 'files' list specified here. 2 "files": ["./src/script"]    ~~~~~~~~~~~~~~ - File is matched by 'files' list specified here. Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-on-command-line-exists.js b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-on-command-line-exists.js index ae0eb00de4fc0..7689ac253590b 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-on-command-line-exists.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/extensionless-file-on-command-line-exists.js @@ -11,7 +11,6 @@ Output:: The file is in the program because: Root file specified for compilation - Found 1 error. //// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib* diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/file-in-tsconfig-does-not-exist.js b/tsc/testdata/baselines/reference/tsc/commandLine/file-in-tsconfig-does-not-exist.js index 0ae1d15323df1..c80648cdf5fc0 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/file-in-tsconfig-does-not-exist.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/file-in-tsconfig-does-not-exist.js @@ -12,11 +12,9 @@ Output:: error TS6053: File '/home/src/workspaces/project/src/doesNotExist.ts' not found. The file is in the program because: Part of 'files' list in tsconfig.json - - tsconfig.json:2:31 + tsconfig.json:2:31 - File is matched by 'files' list specified here. 2 "files": ["./src/doesNotExist.ts"]    ~~~~~~~~~~~~~~~~~~~~~~~ - File is matched by 'files' list specified here. Found 1 error. diff --git a/tsc/testdata/baselines/reference/tsc/commandLine/non-object-config-root.js b/tsc/testdata/baselines/reference/tsc/commandLine/non-object-config-root.js index 47c0e30593c69..c6d3698f57e9c 100644 --- a/tsc/testdata/baselines/reference/tsc/commandLine/non-object-config-root.js +++ b/tsc/testdata/baselines/reference/tsc/commandLine/non-object-config-root.js @@ -8,7 +8,6 @@ tsgo ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: error TS18003: No inputs were found in config file '/home/src/workspaces/project/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. - tsconfig.json:1:1 - error TS5092: The root value of a 'tsconfig.json' file must be an object. 1 [] diff --git a/tsc/testdata/baselines/reference/tsc/contentMapperFailures/initialization-failure-reports-one-project-error.js b/tsc/testdata/baselines/reference/tsc/contentMapperFailures/initialization-failure-reports-one-project-error.js index 22c0e3d09a871..71ba40313f864 100644 --- a/tsc/testdata/baselines/reference/tsc/contentMapperFailures/initialization-failure-reports-one-project-error.js +++ b/tsc/testdata/baselines/reference/tsc/contentMapperFailures/initialization-failure-reports-one-project-error.js @@ -39,7 +39,6 @@ Output:: error TS100057: The content mapper 'missing' could not be initialized. The content mapper command 'missing-mapper' could not be started: contentmappertest: unknown mapper command [missing-mapper] - Found 1 error. //// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib* diff --git a/tsc/testdata/baselines/reference/tsc/contentMapperFailures/mapper-is-disabled-after-repeated-failures.js b/tsc/testdata/baselines/reference/tsc/contentMapperFailures/mapper-is-disabled-after-repeated-failures.js index ece8f82a664d3..9aed4ac03b683 100644 --- a/tsc/testdata/baselines/reference/tsc/contentMapperFailures/mapper-is-disabled-after-repeated-failures.js +++ b/tsc/testdata/baselines/reference/tsc/contentMapperFailures/mapper-is-disabled-after-repeated-failures.js @@ -40,7 +40,6 @@ tsgo --runExternalCode --singleThreaded ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: error TS100026: The content mapper 'fail' failed 5 times and will not be used. - c.vue:1:1 - error TS100025: The content mapper 'fail' failed to transform this file. The content mapper process failed while handling the transform request. diff --git a/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/two-files-exist-on-disk-that-differs-only-in-casing.js b/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/two-files-exist-on-disk-that-differs-only-in-casing.js index c648ddc9ff1d2..f726afec245e9 100644 --- a/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/two-files-exist-on-disk-that-differs-only-in-casing.js +++ b/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/two-files-exist-on-disk-that-differs-only-in-casing.js @@ -23,10 +23,9 @@ Output:: 1 import {x} from "./D"    ~~~~~ - tsconfig.json:2:23 + tsconfig.json:2:23 - File is matched by 'files' list specified here. 2 "files": ["c.ts", "d.ts"]    ~~~~~~ - File is matched by 'files' list specified here. Found 1 error in c.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/when-file-is-included-from-multiple-places-with-different-casing.js b/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/when-file-is-included-from-multiple-places-with-different-casing.js index 254c084931dda..5c31260cf9c03 100644 --- a/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/when-file-is-included-from-multiple-places-with-different-casing.js +++ b/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/when-file-is-included-from-multiple-places-with-different-casing.js @@ -36,26 +36,25 @@ Output:: 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - src/anotherFile.ts:1:22 + src/anotherFile.ts:1:22 - File is included via import here. 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. - src/anotherFile.ts:2:22 + + src/anotherFile.ts:2:22 - File is included via import here. 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. - src/Struct.d.ts:1:22 + + src/Struct.d.ts:1:22 - File is included via import here. 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. - src/oneMore.ts:1:22 + + src/oneMore.ts:1:22 - File is included via import here. 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. - src/oneMore.ts:2:22 + + src/oneMore.ts:2:22 - File is included via import here. 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. src/Struct.d.ts:4:22 - error TS1149: File name '/home/src/projects/project/src/struct.d.ts' differs from already included file name '/home/src/projects/project/src/Struct.d.ts' only in casing. The file is in the program because: @@ -70,26 +69,25 @@ Output:: 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - src/anotherFile.ts:3:22 + src/anotherFile.ts:3:22 - File is included via import here. 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - File is included via import here. - src/Struct.d.ts:3:22 + + src/Struct.d.ts:3:22 - File is included via import here. 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - File is included via import here. - src/anotherFile.ts:4:22 + + src/anotherFile.ts:4:22 - File is included via import here. 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - File is included via import here. - src/oneMore.ts:3:22 + + src/oneMore.ts:3:22 - File is included via import here. 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - File is included via import here. - src/oneMore.ts:4:22 + + src/oneMore.ts:4:22 - File is included via import here. 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - File is included via import here. src/anotherFile.ts:2:22 - error TS1149: File name '/home/src/projects/project/node_modules/fp-ts/lib/struct.d.ts' differs from already included file name '/home/src/projects/project/node_modules/fp-ts/lib/Struct.d.ts' only in casing. The file is in the program because: @@ -103,26 +101,25 @@ Output:: 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - src/anotherFile.ts:1:22 + src/anotherFile.ts:1:22 - File is included via import here. 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. - src/Struct.d.ts:1:22 + + src/Struct.d.ts:1:22 - File is included via import here. 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. - src/Struct.d.ts:2:22 + + src/Struct.d.ts:2:22 - File is included via import here. 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. - src/oneMore.ts:1:22 + + src/oneMore.ts:1:22 - File is included via import here. 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. - src/oneMore.ts:2:22 + + src/oneMore.ts:2:22 - File is included via import here. 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. src/anotherFile.ts:3:22 - error TS1261: Already included file name '/home/src/projects/project/src/Struct.d.ts' differs from file name '/home/src/projects/project/src/struct.d.ts' only in casing. The file is in the program because: @@ -137,26 +134,25 @@ Output:: 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - src/Struct.d.ts:3:22 + src/Struct.d.ts:3:22 - File is included via import here. 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - File is included via import here. - src/Struct.d.ts:4:22 + + src/Struct.d.ts:4:22 - File is included via import here. 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - File is included via import here. - src/anotherFile.ts:4:22 + + src/anotherFile.ts:4:22 - File is included via import here. 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - File is included via import here. - src/oneMore.ts:3:22 + + src/oneMore.ts:3:22 - File is included via import here. 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - File is included via import here. - src/oneMore.ts:4:22 + + src/oneMore.ts:4:22 - File is included via import here. 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - File is included via import here. src/anotherFile.ts:4:22 - error TS1149: File name '/home/src/projects/project/src/struct.d.ts' differs from already included file name '/home/src/projects/project/src/Struct.d.ts' only in casing. The file is in the program because: @@ -171,26 +167,25 @@ Output:: 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - src/anotherFile.ts:3:22 + src/anotherFile.ts:3:22 - File is included via import here. 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - File is included via import here. - src/Struct.d.ts:3:22 + + src/Struct.d.ts:3:22 - File is included via import here. 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - File is included via import here. - src/Struct.d.ts:4:22 + + src/Struct.d.ts:4:22 - File is included via import here. 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - File is included via import here. - src/oneMore.ts:3:22 + + src/oneMore.ts:3:22 - File is included via import here. 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - File is included via import here. - src/oneMore.ts:4:22 + + src/oneMore.ts:4:22 - File is included via import here. 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - File is included via import here. src/oneMore.ts:2:22 - error TS1149: File name '/home/src/projects/project/node_modules/fp-ts/lib/struct.d.ts' differs from already included file name '/home/src/projects/project/node_modules/fp-ts/lib/Struct.d.ts' only in casing. The file is in the program because: @@ -204,26 +199,25 @@ Output:: 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - src/anotherFile.ts:1:22 + src/anotherFile.ts:1:22 - File is included via import here. 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. - src/anotherFile.ts:2:22 + + src/anotherFile.ts:2:22 - File is included via import here. 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. - src/Struct.d.ts:1:22 + + src/Struct.d.ts:1:22 - File is included via import here. 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. - src/Struct.d.ts:2:22 + + src/Struct.d.ts:2:22 - File is included via import here. 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. - src/oneMore.ts:1:22 + + src/oneMore.ts:1:22 - File is included via import here. 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. src/oneMore.ts:4:22 - error TS1149: File name '/home/src/projects/project/src/struct.d.ts' differs from already included file name '/home/src/projects/project/src/Struct.d.ts' only in casing. The file is in the program because: @@ -238,26 +232,25 @@ Output:: 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - src/anotherFile.ts:3:22 + src/anotherFile.ts:3:22 - File is included via import here. 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - File is included via import here. - src/Struct.d.ts:3:22 + + src/Struct.d.ts:3:22 - File is included via import here. 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - File is included via import here. - src/Struct.d.ts:4:22 + + src/Struct.d.ts:4:22 - File is included via import here. 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - File is included via import here. - src/anotherFile.ts:4:22 + + src/anotherFile.ts:4:22 - File is included via import here. 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - File is included via import here. - src/oneMore.ts:3:22 + + src/oneMore.ts:3:22 - File is included via import here. 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - File is included via import here. ../../tslibs/TS/Lib/lib.es2025.full.d.ts Default library for target 'ES2025' diff --git a/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/with-relative-and-non-relative-file-resolutions.js b/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/with-relative-and-non-relative-file-resolutions.js index f4808d4d1fdc1..cb332937d4fa1 100644 --- a/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/with-relative-and-non-relative-file-resolutions.js +++ b/tsc/testdata/baselines/reference/tsc/forceConsistentCasingInFileNames/with-relative-and-non-relative-file-resolutions.js @@ -20,10 +20,9 @@ Output:: 2 import * as xs2 from "fp-ts/lib/struct";    ~~~~~~~~~~~~~~~~~~ - src/struct.d.ts:1:22 + src/struct.d.ts:1:22 - File is included via import here. 1 import * as xs1 from "fp-ts/lib/Struct";    ~~~~~~~~~~~~~~~~~~ - File is included via import here. src/struct.d.ts:3:22 - error TS1149: File name '/user/username/projects/myproject/src/Struct.d.ts' differs from already included file name '/user/username/projects/myproject/src/struct.d.ts' only in casing. The file is in the program because: @@ -34,10 +33,9 @@ Output:: 3 import * as xs3 from "./Struct";    ~~~~~~~~~~ - src/struct.d.ts:4:22 + src/struct.d.ts:4:22 - File is included via import here. 4 import * as xs4 from "./struct";    ~~~~~~~~~~ - File is included via import here. ../../../../home/src/tslibs/TS/Lib/lib.es2025.full.d.ts Default library for target 'ES2025' diff --git a/tsc/testdata/baselines/reference/tsc/generateTrace/generateTrace-with-multiple-files-and-complex-types.js b/tsc/testdata/baselines/reference/tsc/generateTrace/generateTrace-with-multiple-files-and-complex-types.js index b2f228804fd92..befa8be5368c2 100644 --- a/tsc/testdata/baselines/reference/tsc/generateTrace/generateTrace-with-multiple-files-and-complex-types.js +++ b/tsc/testdata/baselines/reference/tsc/generateTrace/generateTrace-with-multiple-files-and-complex-types.js @@ -31,10 +31,9 @@ Output:: 2 const c: Container = { value: 42, map: (fn) => ({ value: fn(42), map: c.map }) };    ~~~ - types.ts:3:5 + types.ts:3:5 - The expected type comes from property 'map' which is declared here on type 'Container' 3 map(fn: (x: T) => U): Container;    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - The expected type comes from property 'map' which is declared here on type 'Container' Found 1 error in main.ts:2 diff --git a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent-with---ignoreConfig.js b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent-with---ignoreConfig.js index 36d1767af4c7d..74d6e078632f8 100644 --- a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent-with---ignoreConfig.js +++ b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent-with---ignoreConfig.js @@ -13,4 +13,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5042: Option 'project' cannot be mixed with source files on a command line. - diff --git a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent.js b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent.js index de5d158171559..c557a4537a6d2 100644 --- a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent.js +++ b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-when-config-file-absent.js @@ -13,4 +13,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5042: Option 'project' cannot be mixed with source files on a command line. - diff --git a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-with---ignoreConfig.js b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-with---ignoreConfig.js index e8f3de2c08556..f325237920c83 100644 --- a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-with---ignoreConfig.js +++ b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files-with---ignoreConfig.js @@ -17,4 +17,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5042: Option 'project' cannot be mixed with source files on a command line. - diff --git a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files.js b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files.js index 38658f4416efa..35141cbcc6df7 100644 --- a/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files.js +++ b/tsc/testdata/baselines/reference/tsc/ignoreConfig/mixing-project-and-files.js @@ -17,4 +17,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5042: Option 'project' cannot be mixed with source files on a command line. - diff --git a/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-files.js b/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-files.js index 823191d8e5859..fab3875627728 100644 --- a/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-files.js +++ b/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-files.js @@ -17,4 +17,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5112: tsconfig.json is present but will not be loaded if files are specified on commandline. Use '--ignoreConfig' to skip this error. - diff --git a/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent-with---ignoreConfig.js b/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent-with---ignoreConfig.js index 5c8058ed0117a..ed09be7914a74 100644 --- a/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent-with---ignoreConfig.js +++ b/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent-with---ignoreConfig.js @@ -13,4 +13,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project/tsconfig.json. - diff --git a/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent.js b/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent.js index 4a2bdf2b1c817..c8d7560ae5573 100644 --- a/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent.js +++ b/tsc/testdata/baselines/reference/tsc/ignoreConfig/specifying-project-when-config-file-absent.js @@ -13,4 +13,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project/tsconfig.json. - diff --git a/tsc/testdata/baselines/reference/tsc/incremental/Compile-incremental-with-case-insensitive-file-names.js b/tsc/testdata/baselines/reference/tsc/incremental/Compile-incremental-with-case-insensitive-file-names.js index 922fd45f1e736..3d384abf36137 100644 --- a/tsc/testdata/baselines/reference/tsc/incremental/Compile-incremental-with-case-insensitive-file-names.js +++ b/tsc/testdata/baselines/reference/tsc/incremental/Compile-incremental-with-case-insensitive-file-names.js @@ -52,10 +52,9 @@ Output:: 1 import type { Foo } from 'somelib';    ~~~~~~~~~ - ../node_modules/lib1/index.d.ts:1:26 + ../node_modules/lib1/index.d.ts:1:26 - File is included via import here. 1 import type { Foo } from 'someLib';    ~~~~~~~~~ - File is included via import here. Found 1 error in ../node_modules/lib2/index.d.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js b/tsc/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js index 8577ec9763930..4a7e96ec311d9 100644 --- a/tsc/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js +++ b/tsc/testdata/baselines/reference/tsc/incremental/change-to-modifier-of-class-expression-field-with-declaration-emit-enabled.js @@ -269,10 +269,9 @@ Output:: 6 const wrapper = () => Messageable();    ~~~~~~~ - MessageablePerson.ts:6:7 + MessageablePerson.ts:6:7 - Add a type annotation to the variable wrapper. 6 const wrapper = () => Messageable();    ~~~~~~~ - Add a type annotation to the variable wrapper. MessageablePerson.ts:7:26 - error TS2304: Cannot find name 'InstanceType'. @@ -440,10 +439,9 @@ Output:: 6 const wrapper = () => Messageable();    ~~~~~~~ - MessageablePerson.ts:6:7 + MessageablePerson.ts:6:7 - Add a type annotation to the variable wrapper. 6 const wrapper = () => Messageable();    ~~~~~~~ - Add a type annotation to the variable wrapper. MessageablePerson.ts:7:26 - error TS2304: Cannot find name 'InstanceType'. diff --git a/tsc/testdata/baselines/reference/tsc/incremental/internal-symbolname-in-tsbuildInfo.js b/tsc/testdata/baselines/reference/tsc/incremental/internal-symbolname-in-tsbuildInfo.js index 9ca161633691c..e33fcabf4b84f 100644 --- a/tsc/testdata/baselines/reference/tsc/incremental/internal-symbolname-in-tsbuildInfo.js +++ b/tsc/testdata/baselines/reference/tsc/incremental/internal-symbolname-in-tsbuildInfo.js @@ -100,10 +100,9 @@ Output:: 3 length: files.length,    ~~~~~~~~~~~~~~~~~~~~ - a.ts:8:5 + a.ts:8:5 - This spread always overwrites this property. 8 ...files,    ~~~~~~~~ - This spread always overwrites this property. a.ts:5:5 - error TS2783: '�@iterator@' is specified more than once, so this usage will be overwritten. @@ -114,10 +113,9 @@ Output:: 7 },   ~~~~~ - a.ts:8:5 + a.ts:8:5 - This spread always overwrites this property. 8 ...files,    ~~~~~~~~ - This spread always overwrites this property. Found 2 errors in the same file, starting at: a.ts:3 @@ -145,10 +143,9 @@ Output:: 3 length: files.length,    ~~~~~~~~~~~~~~~~~~~~ - a.ts:8:5 + a.ts:8:5 - This spread always overwrites this property. 8 ...files,    ~~~~~~~~ - This spread always overwrites this property. a.ts:5:5 - error TS2783: '�@iterator@' is specified more than once, so this usage will be overwritten. @@ -159,10 +156,9 @@ Output:: 7 },   ~~~~~ - a.ts:8:5 + a.ts:8:5 - This spread always overwrites this property. 8 ...files,    ~~~~~~~~ - This spread always overwrites this property. Found 2 errors in the same file, starting at: a.ts:3 @@ -181,10 +177,9 @@ Output:: 3 length: files.length,    ~~~~~~~~~~~~~~~~~~~~ - a.ts:8:5 + a.ts:8:5 - This spread always overwrites this property. 8 ...files,    ~~~~~~~~ - This spread always overwrites this property. a.ts:5:5 - error TS2783: '�@iterator@' is specified more than once, so this usage will be overwritten. @@ -195,10 +190,9 @@ Output:: 7 },   ~~~~~ - a.ts:8:5 + a.ts:8:5 - This spread always overwrites this property. 8 ...files,    ~~~~~~~~ - This spread always overwrites this property. Found 2 errors in the same file, starting at: a.ts:3 @@ -331,10 +325,9 @@ Output:: 3 length: files.length,    ~~~~~~~~~~~~~~~~~~~~ - a.ts:8:5 + a.ts:8:5 - This spread always overwrites this property. 8 ...files,    ~~~~~~~~ - This spread always overwrites this property. a.ts:5:5 - error TS2783: '�@iterator@' is specified more than once, so this usage will be overwritten. @@ -345,10 +338,9 @@ Output:: 7 },   ~~~~~ - a.ts:8:5 + a.ts:8:5 - This spread always overwrites this property. 8 ...files,    ~~~~~~~~ - This spread always overwrites this property. Found 2 errors in the same file, starting at: a.ts:3 diff --git a/tsc/testdata/baselines/reference/tsc/incremental/js-file-with-import-in-jsdoc-in-composite-project.js b/tsc/testdata/baselines/reference/tsc/incremental/js-file-with-import-in-jsdoc-in-composite-project.js index 36dd0315a0246..2cacb067b1ce2 100644 --- a/tsc/testdata/baselines/reference/tsc/incremental/js-file-with-import-in-jsdoc-in-composite-project.js +++ b/tsc/testdata/baselines/reference/tsc/incremental/js-file-with-import-in-jsdoc-in-composite-project.js @@ -32,7 +32,6 @@ ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: error TS2318: Cannot find global type 'Promise'. - Found 1 error. //// [/home/src/tslibs/TS/Lib/lib.es2025.full.d.ts] *Lib* diff --git a/tsc/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js b/tsc/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js index 3ec10629a3531..8d4c59f060791 100644 --- a/tsc/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js +++ b/tsc/testdata/baselines/reference/tsc/incremental/serializing-error-chain.js @@ -37,10 +37,9 @@ Output:: 10 (    ~~~~~~~~~ - index.tsx:9:18 + index.tsx:9:18 - The last overload is declared here. 9 declare function Component(props: { children?: number }): any;    ~~~~~~~~~ - The last overload is declared here. Found 1 error in index.tsx:10 @@ -216,10 +215,9 @@ Output:: 10 (    ~~~~~~~~~ - index.tsx:9:18 + index.tsx:9:18 - The last overload is declared here. 9 declare function Component(props: { children?: number }): any;    ~~~~~~~~~ - The last overload is declared here. Found 1 error in index.tsx:10 diff --git a/tsc/testdata/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js b/tsc/testdata/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js index f431804b71919..1b616dd558d32 100644 --- a/tsc/testdata/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js +++ b/tsc/testdata/baselines/reference/tsc/libraryResolution/when-noLib-toggles.js @@ -129,25 +129,15 @@ tsgo --noLib ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: error TS2318: Cannot find global type 'Array'. - error TS2318: Cannot find global type 'Boolean'. - error TS2318: Cannot find global type 'CallableFunction'. - error TS2318: Cannot find global type 'Function'. - error TS2318: Cannot find global type 'IArguments'. - error TS2318: Cannot find global type 'NewableFunction'. - error TS2318: Cannot find global type 'Number'. - error TS2318: Cannot find global type 'Object'. - error TS2318: Cannot find global type 'RegExp'. - error TS2318: Cannot find global type 'String'. - tsconfig.json:5:9 - error TS5053: Option 'lib' cannot be specified with option 'noLib'. 5 "lib": ["es6"], diff --git a/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js b/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js index 1c72c4656f665..1a8b5b0cabf41 100644 --- a/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors-with-incremental.js @@ -21,10 +21,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -176,10 +175,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -410,10 +408,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -537,10 +534,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -562,10 +558,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -965,10 +960,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors.js b/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors.js index 023d11545620a..860941f8f918d 100644 --- a/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors.js +++ b/tsc/testdata/baselines/reference/tsc/noCheck/dts-errors.js @@ -21,10 +21,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -76,10 +75,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -168,10 +166,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -196,10 +193,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -220,10 +216,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -302,10 +297,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/changes-composite.js b/tsc/testdata/baselines/reference/tsc/noEmit/changes-composite.js index 64fdb8d4fa1c2..f0dbfd1471c69 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/changes-composite.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/changes-composite.js @@ -337,20 +337,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -912,20 +910,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1189,20 +1185,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1233,20 +1227,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1277,20 +1269,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1321,20 +1311,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js b/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js index ecc408c9f6017..5f3fc47d20272 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental-declaration.js @@ -336,20 +336,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -887,20 +885,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1166,20 +1162,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1210,20 +1204,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1254,20 +1246,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1298,20 +1288,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental.js b/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental.js index c43702d84746f..bb3c5c7a2c2d0 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/changes-incremental.js @@ -278,20 +278,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -805,20 +803,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1057,20 +1053,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1101,20 +1095,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1145,20 +1137,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. @@ -1189,20 +1179,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js b/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js index 84c9317bfba8f..ecf00bb71e79e 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-composite.js @@ -503,20 +503,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js b/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js index 941ecb922a353..b09fc9259fdb2 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental-declaration.js @@ -476,20 +476,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js b/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js index 2c8d04e9aef50..138d0771c84bf 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/changes-with-initial-noEmit-incremental.js @@ -415,20 +415,18 @@ Output:: 2 new indirectClass().classC.prop;    ~~~~ - src/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. 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/class.ts:2:5 + src/class.ts:2:5 - 'prop1' is declared here. 2 prop1 = 1;    ~~~~~ - 'prop1' is declared here. src/noChangeFileWithEmitSpecificError.ts:1:19 - error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js index 2ff505456cdc3..8c767972d02b3 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js @@ -162,30 +162,27 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 + c.ts:1:14 - Add a type annotation to the variable c. 1 export const c = class { private p = 10; };    ~ - Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 + d.ts:1:14 - Add a type annotation to the variable d. 1 export const d = class { private p = 10; };    ~ - Add a type annotation to the variable d. Found 3 errors in 3 files. @@ -397,30 +394,27 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 + c.ts:1:14 - Add a type annotation to the variable c. 1 export const c = class { private p = 10; };    ~ - Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 + d.ts:1:14 - Add a type annotation to the variable d. 1 export const d = class { private p = 10; };    ~ - Add a type annotation to the variable d. Found 3 errors in 3 files. @@ -644,30 +638,27 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. c.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 + c.ts:1:14 - Add a type annotation to the variable c. 1 export const c = class { private p = 10; };    ~ - Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 + d.ts:1:14 - Add a type annotation to the variable d. 1 export const d = class { private p = 10; };    ~ - Add a type annotation to the variable d. Found 3 errors in 3 files. @@ -1026,20 +1017,18 @@ Output:: 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 + c.ts:1:14 - Add a type annotation to the variable c. 1 export const c = class { private p = 10; };    ~ - Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 + d.ts:1:14 - Add a type annotation to the variable d. 1 export const d = class { private p = 10; };    ~ - Add a type annotation to the variable d. Found 2 errors in 2 files. @@ -1233,20 +1222,18 @@ Output:: 1 export const c = class { private p = 10; };    ~ - c.ts:1:14 + c.ts:1:14 - Add a type annotation to the variable c. 1 export const c = class { private p = 10; };    ~ - Add a type annotation to the variable c. d.ts:1:14 - error TS4094: Property 'p' of exported anonymous class type may not be private or protected. 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 + d.ts:1:14 - Add a type annotation to the variable d. 1 export const d = class { private p = 10; };    ~ - Add a type annotation to the variable d. Found 2 errors in 2 files. @@ -1443,10 +1430,9 @@ Output:: 1 export const d = class { private p = 10; };    ~ - d.ts:1:14 + d.ts:1:14 - Add a type annotation to the variable d. 1 export const d = class { private p = 10; };    ~ - Add a type annotation to the variable d. Found 1 error in d.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js index d389e09e987eb..883fa4cd4945f 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental-as-modules.js @@ -21,10 +21,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -171,10 +170,9 @@ Output:: 1 export const a = class { private p = 10; };    ~ - a.ts:1:14 + a.ts:1:14 - Add a type annotation to the variable a. 1 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -397,10 +395,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -538,10 +535,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -664,10 +660,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js index 4a41de5c3b6ea..7f8fd52fd1db0 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors-with-incremental.js @@ -19,10 +19,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -155,10 +154,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -345,10 +343,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -460,10 +457,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -568,10 +564,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors.js b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors.js index 531ebea6d489c..299fdcb8dacde 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors.js +++ b/tsc/testdata/baselines/reference/tsc/noEmit/dts-errors.js @@ -19,10 +19,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -63,10 +62,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -127,10 +125,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -148,10 +145,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -175,10 +171,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js b/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js index a7186d8a190ef..b1e3920ac2372 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js +++ b/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration-with-incremental.js @@ -29,10 +29,9 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 + src/main.ts:2:14 - Add a type annotation to the variable a. 2 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in src/main.ts:2 @@ -208,10 +207,9 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 + src/main.ts:2:14 - Add a type annotation to the variable a. 2 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in src/main.ts:2 diff --git a/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration.js b/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration.js index 7c0b3491e0c37..75a34f056ecbe 100644 --- a/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration.js +++ b/tsc/testdata/baselines/reference/tsc/noEmitOnError/dts-errors-with-declaration.js @@ -29,10 +29,9 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 + src/main.ts:2:14 - Add a type annotation to the variable a. 2 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in src/main.ts:2 @@ -73,10 +72,9 @@ Output:: 2 export const a = class { private p = 10; };    ~ - src/main.ts:2:14 + src/main.ts:2:14 - Add a type annotation to the variable a. 2 export const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in src/main.ts:2 diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Default-initialized-TSConfig.js b/tsc/testdata/baselines/reference/tsc/showConfig/Default-initialized-TSConfig.js index b25098501b866..b61895595f13b 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Default-initialized-TSConfig.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Default-initialized-TSConfig.js @@ -7,4 +7,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project. - diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-advanced-options.js b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-advanced-options.js index c9da5e87c69f4..df5a6782c2511 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-advanced-options.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-advanced-options.js @@ -7,4 +7,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project. - diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-boolean-value-compiler-options.js b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-boolean-value-compiler-options.js index ef73c3042b511..da30c08a19cfb 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-boolean-value-compiler-options.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-boolean-value-compiler-options.js @@ -7,4 +7,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project. - diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-enum-value-compiler-options.js b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-enum-value-compiler-options.js index 0a6957c4d5b27..bf3ed802f92a2 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-enum-value-compiler-options.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-enum-value-compiler-options.js @@ -7,4 +7,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project. - diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option-value.js b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option-value.js index 0ae2a3ab700cb..7902a5f89cdfd 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option-value.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option-value.js @@ -7,4 +7,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS6046: Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'es2025', 'esnext', 'dom', 'dom.iterable', 'dom.asynciterable', 'webworker', 'webworker.importscripts', 'webworker.iterable', 'webworker.asynciterable', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator', 'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol', 'es2015.symbol.wellknown', 'es2016.array.include', 'es2016.intl', 'es2017.arraybuffer', 'es2017.date', 'es2017.object', 'es2017.sharedmemory', 'es2017.string', 'es2017.intl', 'es2017.typedarrays', 'es2018.asyncgenerator', 'es2018.asynciterable', 'es2018.intl', 'es2018.promise', 'es2018.regexp', 'es2019.array', 'es2019.object', 'es2019.string', 'es2019.symbol', 'es2019.intl', 'es2020.bigint', 'es2020.date', 'es2020.promise', 'es2020.sharedmemory', 'es2020.string', 'es2020.symbol.wellknown', 'es2020.intl', 'es2020.number', 'es2021.promise', 'es2021.string', 'es2021.weakref', 'es2021.intl', 'es2022.array', 'es2022.error', 'es2022.intl', 'es2022.object', 'es2022.string', 'es2022.regexp', 'es2023.array', 'es2023.collection', 'es2023.intl', 'es2024.arraybuffer', 'es2024.collection', 'es2024.object', 'es2024.promise', 'es2024.regexp', 'es2024.sharedmemory', 'es2024.string', 'es2025.collection', 'es2025.float16', 'es2025.intl', 'es2025.iterator', 'es2025.promise', 'es2025.regexp', 'esnext.asynciterable', 'esnext.symbol', 'esnext.bigint', 'esnext.weakref', 'esnext.object', 'esnext.regexp', 'esnext.string', 'esnext.float16', 'esnext.iterator', 'esnext.promise', 'esnext.array', 'esnext.collection', 'esnext.date', 'esnext.decorators', 'esnext.disposable', 'esnext.error', 'esnext.intl', 'esnext.sharedmemory', 'esnext.temporal', 'esnext.typedarrays', 'decorators', 'decorators.legacy'. - diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option.js b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option.js index a01eddac525c2..d922215b52019 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-incorrect-compiler-option.js @@ -7,4 +7,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5023: Unknown compiler option '--someNonExistOption'. - diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options-with-enum-value.js b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options-with-enum-value.js index 9a2c1c938b110..2677c20cc1436 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options-with-enum-value.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options-with-enum-value.js @@ -7,4 +7,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project. - diff --git a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options.js b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options.js index 7ecf617395dca..82fb9636f8fba 100644 --- a/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options.js +++ b/tsc/testdata/baselines/reference/tsc/showConfig/Show-TSConfig-with-list-compiler-options.js @@ -7,4 +7,3 @@ ExitStatus:: DiagnosticsPresent_OutputsSkipped Output:: error TS5081: Cannot find a tsconfig.json file at the current directory: /home/src/workspaces/project. - diff --git a/tsc/testdata/baselines/reference/tsc/typeAcquisition/parse-tsconfig-with-typeAcquisition.js b/tsc/testdata/baselines/reference/tsc/typeAcquisition/parse-tsconfig-with-typeAcquisition.js index 274d196898080..5c89ebdf9aa8d 100644 --- a/tsc/testdata/baselines/reference/tsc/typeAcquisition/parse-tsconfig-with-typeAcquisition.js +++ b/tsc/testdata/baselines/reference/tsc/typeAcquisition/parse-tsconfig-with-typeAcquisition.js @@ -20,7 +20,6 @@ ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: error TS18003: No inputs were found in config file '/home/src/workspaces/project/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '[]'. - Found 1 error. //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* diff --git a/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-detects-nested-subdirectory-removed-and-recreated.js b/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-detects-nested-subdirectory-removed-and-recreated.js index 9939bf70ffaee..4cdb0864eaa82 100644 --- a/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-detects-nested-subdirectory-removed-and-recreated.js +++ b/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-detects-nested-subdirectory-removed-and-recreated.js @@ -77,10 +77,9 @@ Signatures:: Diff:: incremental has prior state and does not report no-inputs error --- nonIncremental.output.txt +++ incremental.output.txt -@@ -1,5 +0,0 @@ +@@ -1,4 +0,0 @@ -error TS18003: No inputs were found in config file '/home/src/workspaces/project/tsconfig.json'. Specified 'include' paths were '["src/**/*.ts"]' and 'exclude' paths were '[]'. - -- -Found 1 error. - diff --git a/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-handles-tsconfig-deleted.js b/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-handles-tsconfig-deleted.js index 18d8af2db3364..7c3ab632e031c 100644 --- a/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-handles-tsconfig-deleted.js +++ b/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-handles-tsconfig-deleted.js @@ -58,7 +58,6 @@ Edit [0]:: delete tsconfig Output:: error TS5083: Cannot read file '/home/src/workspaces/project/tsconfig.json'. - [HH:MM:SS AM] Found 1 error. Watching for file changes. @@ -71,7 +70,7 @@ Directory watches:: Diff:: incremental reports config read error while clean build without tsconfig prints usage help --- nonIncremental.output.txt +++ incremental.output.txt -@@ -1,144 +1,2 @@ +@@ -1,144 +1,1 @@ -Version FakeTSVersion -tsc: The TypeScript Compiler - Version FakeTSVersion - @@ -215,4 +214,5 @@ Diff:: incremental reports config read error while clean build without tsconfig -default: true - -You can learn about all of the compiler options at https://aka.ms/tsc -+error TS5083: Cannot read file '/home/src/workspaces/project/tsconfig.json'. +- ++error TS5083: Cannot read file '/home/src/workspaces/project/tsconfig.json'. \ No newline at end of file diff --git a/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-with-tsconfig-files-list-entry-deleted.js b/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-with-tsconfig-files-list-entry-deleted.js index e48f05f7a5c8c..1b0917365955e 100644 --- a/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-with-tsconfig-files-list-entry-deleted.js +++ b/tsc/testdata/baselines/reference/tscWatch/commandLineWatch/watch-with-tsconfig-files-list-entry-deleted.js @@ -70,11 +70,9 @@ Output:: error TS6053: File '/home/src/workspaces/project/b.ts' not found. The file is in the program because: Part of 'files' list in tsconfig.json - - tsconfig.json:3:20 + tsconfig.json:3:20 - File is matched by 'files' list specified here. 3 "files": ["a.ts", "b.ts"]    ~~~~~~ - File is matched by 'files' list specified here. Found 1 error. diff --git a/tsc/testdata/baselines/reference/tscWatch/noEmit/dts-errors.js b/tsc/testdata/baselines/reference/tscWatch/noEmit/dts-errors.js index 569570c44d951..c0a2db979bfec 100644 --- a/tsc/testdata/baselines/reference/tscWatch/noEmit/dts-errors.js +++ b/tsc/testdata/baselines/reference/tscWatch/noEmit/dts-errors.js @@ -21,10 +21,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -158,10 +157,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -198,10 +196,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 @@ -242,10 +239,9 @@ Output:: 1 const a = class { private p = 10; };    ~ - a.ts:1:7 + a.ts:1:7 - Add a type annotation to the variable a. 1 const a = class { private p = 10; };    ~ - Add a type annotation to the variable a. Found 1 error in a.ts:1 diff --git a/tsc/testdata/submoduleAccepted.txt b/tsc/testdata/submoduleAccepted.txt index 34729fd0ffea5..b2c6f97649d0a 100644 --- a/tsc/testdata/submoduleAccepted.txt +++ b/tsc/testdata/submoduleAccepted.txt @@ -671,7 +671,10 @@ conformance/circular1.errors.txt.diff conformance/circular3.errors.txt.diff ## Related spans in various errors changed (these baselines are all --pretty) +compiler/deeplyNestedAssignabilityIssue.errors.txt.diff +compiler/esModuleInteropPrettyErrorRelatedInformation.errors.txt.diff compiler/prettyContextNotDebugAssertion.errors.txt.diff +compiler/prettyFileWithErrorsAndTabs.errors.txt.diff compiler/manyCompilerErrorsInTheTwoFiles.errors.txt.diff ## "Call signature return type" layer removed from error pyramid From fe4cad360155bc8a54357b6d257642d8e4733f9a Mon Sep 17 00:00:00 2001 From: John Favret <64748847+johnfav03@users.noreply.github.com> Date: Fri, 21 Aug 2026 14:17:22 -0500 Subject: [PATCH 4/6] validate diagnostics with file hashes --- packages/typescript/src/api/async/api.ts | 78 ++++--------------- .../typescript/src/api/proto.generated.ts | 5 +- packages/typescript/src/api/sync/api.ts | 78 ++++--------------- packages/typescript/test/async/api.test.ts | 61 ++++++++------- packages/typescript/test/sync/api.test.ts | 55 +++++++------ tsc/internal/api/format_diagnostics.go | 15 ++-- tsc/internal/api/proto.go | 15 +++- tsc/internal/api/proto_test.go | 1 + .../api/session_format_diagnostics_test.go | 47 ++++++----- tsc/internal/tsoptions/tsconfigparsing.go | 2 + 10 files changed, 141 insertions(+), 216 deletions(-) diff --git a/packages/typescript/src/api/async/api.ts b/packages/typescript/src/api/async/api.ts index 52b034c72aabf..2c903c009d724 100644 --- a/packages/typescript/src/api/async/api.ts +++ b/packages/typescript/src/api/async/api.ts @@ -208,54 +208,17 @@ export interface TranspileOutput { sourceMapText?: string; } -const diagnosticOrigin = globalThis.Symbol("diagnosticOrigin"); - -interface DiagnosticOrigin { - readonly snapshot: number; - readonly project: Path; -} - -interface DiagnosticWithOrigin extends Diagnostic { - readonly [diagnosticOrigin]?: DiagnosticOrigin; -} - interface FormatDiagnosticRequest extends Diagnostic { - readonly originSnapshot: number; - readonly originProject: Path; readonly displayFileName?: string; } -function associateDiagnostics( - diagnostics: readonly Diagnostic[], - origin: DiagnosticOrigin, -): readonly Diagnostic[] { - for (const diagnostic of diagnostics) { - Object.defineProperty(diagnostic, diagnosticOrigin, { value: origin }); - if (diagnostic.messageChain) { - associateDiagnostics(diagnostic.messageChain, origin); - } - if (diagnostic.relatedInformation) { - associateDiagnostics(diagnostic.relatedInformation, origin); - } - } - return diagnostics; -} - function toFormatDiagnosticRequest( diagnostic: Diagnostic, - expectedOrigin: DiagnosticOrigin, host: FormatDiagnosticsHost, ): FormatDiagnosticRequest { - const origin = (diagnostic as DiagnosticWithOrigin)[diagnosticOrigin]; - if (origin?.snapshot !== expectedOrigin.snapshot || origin.project !== expectedOrigin.project) { - throw new Error("Diagnostic was not produced by this program."); - } - const { messageChain, relatedInformation, ...diagnosticData } = diagnostic; return { ...diagnosticData, - originSnapshot: origin.snapshot, - originProject: origin.project, ...(diagnostic.fileName ? { displayFileName: convertToRelativePath( @@ -266,10 +229,10 @@ function toFormatDiagnosticRequest( } : {}), ...(messageChain - ? { messageChain: messageChain.map(d => toFormatDiagnosticRequest(d, expectedOrigin, host)) } + ? { messageChain: messageChain.map(d => toFormatDiagnosticRequest(d, host)) } : {}), ...(relatedInformation - ? { relatedInformation: relatedInformation.map(d => toFormatDiagnosticRequest(d, expectedOrigin, host)) } + ? { relatedInformation: relatedInformation.map(d => toFormatDiagnosticRequest(d, host)) } : {}), }; } @@ -1038,13 +1001,6 @@ export class Program { this.toPath = toPath; } - private associateDiagnostics(diagnostics: readonly Diagnostic[]): readonly Diagnostic[] { - return associateDiagnostics(diagnostics, { - snapshot: this.snapshotId, - project: this.project.id, - }); - } - getCompilerOptions(): CompilerOptions { return this.project.compilerOptions; } @@ -1181,7 +1137,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1197,7 +1153,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1213,7 +1169,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1229,7 +1185,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1245,7 +1201,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1256,7 +1212,7 @@ export class Program { snapshot: this.snapshotId, project: this.project.id, }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1267,7 +1223,7 @@ export class Program { snapshot: this.snapshotId, project: this.project.id, }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1278,7 +1234,7 @@ export class Program { snapshot: this.snapshotId, project: this.project.id, }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1288,11 +1244,10 @@ export class Program { diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost, ): Promise { - const origin = { snapshot: this.snapshotId, project: this.project.id }; const data = await this.client.apiRequest("formatDiagnostics", { snapshot: this.snapshotId, project: this.project.id, - diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, origin, host)), + diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, host)), newLine: host.getNewLine(), }); return data.output; @@ -1305,11 +1260,10 @@ export class Program { diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost, ): Promise { - const origin = { snapshot: this.snapshotId, project: this.project.id }; const data = await this.client.apiRequest("formatDiagnosticsWithColorAndContext", { snapshot: this.snapshotId, project: this.project.id, - diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, origin, host)), + diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, host)), newLine: host.getNewLine(), }); return data.output; @@ -1329,7 +1283,7 @@ export class Program { }); return { emitSkipped: response.emitSkipped, - diagnostics: this.associateDiagnostics(response.diagnostics), + diagnostics: response.diagnostics, emittedFiles: response.emittedFiles, }; } @@ -1343,7 +1297,7 @@ export class Program { project: this.project.id, ...(emitOnly !== undefined ? { emitOnly } : {}), }); - return toEmitOutput(response, this.associateDiagnostics(response.diagnostics)); + return toEmitOutput(response, response.diagnostics); } /** @@ -1355,7 +1309,7 @@ export class Program { project: this.project.id, files, }); - return toEmitOutput(response, this.associateDiagnostics(response.diagnostics)); + return toEmitOutput(response, response.diagnostics); } /** @@ -1367,7 +1321,7 @@ export class Program { project: this.project.id, files, }); - return toEmitOutput(response, this.associateDiagnostics(response.diagnostics)); + return toEmitOutput(response, response.diagnostics); } } diff --git a/packages/typescript/src/api/proto.generated.ts b/packages/typescript/src/api/proto.generated.ts index f94ba51c85643..8f49e31327626 100644 --- a/packages/typescript/src/api/proto.generated.ts +++ b/packages/typescript/src/api/proto.generated.ts @@ -761,6 +761,8 @@ export interface GetDiagnosticsParams { export interface DiagnosticResponse { /** FileName is the path of the file this diagnostic belongs to, if any. */ fileName?: string; + /** SourceFileHash identifies the source text used to produce this diagnostic. */ + sourceFileHash?: string; /** Pos is the start position of the diagnostic in the source file. */ pos: number; /** End is the end position of the diagnostic in the source file. */ @@ -781,9 +783,6 @@ export interface DiagnosticResponse { messageChain?: DiagnosticResponse[]; /** RelatedInformation contains related diagnostic information, if any. */ relatedInformation?: DiagnosticResponse[]; - /** OriginSnapshot and OriginProject identify the program that produced this diagnostic. */ - originSnapshot?: number; - originProject?: string; /** DisplayFileName is the host-formatted file name used only for diagnostic output. */ displayFileName?: string; } diff --git a/packages/typescript/src/api/sync/api.ts b/packages/typescript/src/api/sync/api.ts index 143859d8fa50c..6934d4f86a418 100644 --- a/packages/typescript/src/api/sync/api.ts +++ b/packages/typescript/src/api/sync/api.ts @@ -216,54 +216,17 @@ export interface TranspileOutput { sourceMapText?: string; } -const diagnosticOrigin = globalThis.Symbol("diagnosticOrigin"); - -interface DiagnosticOrigin { - readonly snapshot: number; - readonly project: Path; -} - -interface DiagnosticWithOrigin extends Diagnostic { - readonly [diagnosticOrigin]?: DiagnosticOrigin; -} - interface FormatDiagnosticRequest extends Diagnostic { - readonly originSnapshot: number; - readonly originProject: Path; readonly displayFileName?: string; } -function associateDiagnostics( - diagnostics: readonly Diagnostic[], - origin: DiagnosticOrigin, -): readonly Diagnostic[] { - for (const diagnostic of diagnostics) { - Object.defineProperty(diagnostic, diagnosticOrigin, { value: origin }); - if (diagnostic.messageChain) { - associateDiagnostics(diagnostic.messageChain, origin); - } - if (diagnostic.relatedInformation) { - associateDiagnostics(diagnostic.relatedInformation, origin); - } - } - return diagnostics; -} - function toFormatDiagnosticRequest( diagnostic: Diagnostic, - expectedOrigin: DiagnosticOrigin, host: FormatDiagnosticsHost, ): FormatDiagnosticRequest { - const origin = (diagnostic as DiagnosticWithOrigin)[diagnosticOrigin]; - if (origin?.snapshot !== expectedOrigin.snapshot || origin.project !== expectedOrigin.project) { - throw new Error("Diagnostic was not produced by this program."); - } - const { messageChain, relatedInformation, ...diagnosticData } = diagnostic; return { ...diagnosticData, - originSnapshot: origin.snapshot, - originProject: origin.project, ...(diagnostic.fileName ? { displayFileName: convertToRelativePath( @@ -274,10 +237,10 @@ function toFormatDiagnosticRequest( } : {}), ...(messageChain - ? { messageChain: messageChain.map(d => toFormatDiagnosticRequest(d, expectedOrigin, host)) } + ? { messageChain: messageChain.map(d => toFormatDiagnosticRequest(d, host)) } : {}), ...(relatedInformation - ? { relatedInformation: relatedInformation.map(d => toFormatDiagnosticRequest(d, expectedOrigin, host)) } + ? { relatedInformation: relatedInformation.map(d => toFormatDiagnosticRequest(d, host)) } : {}), }; } @@ -1046,13 +1009,6 @@ export class Program { this.toPath = toPath; } - private associateDiagnostics(diagnostics: readonly Diagnostic[]): readonly Diagnostic[] { - return associateDiagnostics(diagnostics, { - snapshot: this.snapshotId, - project: this.project.id, - }); - } - getCompilerOptions(): CompilerOptions { return this.project.compilerOptions; } @@ -1189,7 +1145,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1205,7 +1161,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1221,7 +1177,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1237,7 +1193,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1253,7 +1209,7 @@ export class Program { project: this.project.id, ...(files !== undefined ? { files } : {}), }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1264,7 +1220,7 @@ export class Program { snapshot: this.snapshotId, project: this.project.id, }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1275,7 +1231,7 @@ export class Program { snapshot: this.snapshotId, project: this.project.id, }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1286,7 +1242,7 @@ export class Program { snapshot: this.snapshotId, project: this.project.id, }); - return this.associateDiagnostics(data ?? []); + return data ?? []; } /** @@ -1296,11 +1252,10 @@ export class Program { diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost, ): string { - const origin = { snapshot: this.snapshotId, project: this.project.id }; const data = this.client.apiRequest("formatDiagnostics", { snapshot: this.snapshotId, project: this.project.id, - diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, origin, host)), + diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, host)), newLine: host.getNewLine(), }); return data.output; @@ -1313,11 +1268,10 @@ export class Program { diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost, ): string { - const origin = { snapshot: this.snapshotId, project: this.project.id }; const data = this.client.apiRequest("formatDiagnosticsWithColorAndContext", { snapshot: this.snapshotId, project: this.project.id, - diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, origin, host)), + diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, host)), newLine: host.getNewLine(), }); return data.output; @@ -1337,7 +1291,7 @@ export class Program { }); return { emitSkipped: response.emitSkipped, - diagnostics: this.associateDiagnostics(response.diagnostics), + diagnostics: response.diagnostics, emittedFiles: response.emittedFiles, }; } @@ -1351,7 +1305,7 @@ export class Program { project: this.project.id, ...(emitOnly !== undefined ? { emitOnly } : {}), }); - return toEmitOutput(response, this.associateDiagnostics(response.diagnostics)); + return toEmitOutput(response, response.diagnostics); } /** @@ -1363,7 +1317,7 @@ export class Program { project: this.project.id, files, }); - return toEmitOutput(response, this.associateDiagnostics(response.diagnostics)); + return toEmitOutput(response, response.diagnostics); } /** @@ -1375,7 +1329,7 @@ export class Program { project: this.project.id, files, }); - return toEmitOutput(response, this.associateDiagnostics(response.diagnostics)); + return toEmitOutput(response, response.diagnostics); } } diff --git a/packages/typescript/test/async/api.test.ts b/packages/typescript/test/async/api.test.ts index 32840b3f50fd5..9a7d7c9bfbfe2 100644 --- a/packages/typescript/test/async/api.test.ts +++ b/packages/typescript/test/async/api.test.ts @@ -5684,7 +5684,8 @@ describe("Program - diagnostics", () => { const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = await project.program.getSyntacticDiagnostics("/src/index.ts"); - assert.deepEqual(diags, [{ + assert.match(diags[0].sourceFileHash!, /^[0-9a-f]{32}$/); + assert.deepEqual(withoutSourceFileHashes(diags), [{ fileName: "/src/index.ts", ...rangeOf(source, "="), code: 1110, @@ -5709,7 +5710,7 @@ describe("Program - diagnostics", () => { const diags = await project.program.getSemanticDiagnostics("/src/index.ts"); const declRange = rangeOf(source, "callback", 0); const assignRange = rangeOf(source, "callback", 1); - assert.deepEqual(diags, [{ + assert.deepEqual(withoutSourceFileHashes(diags), [{ fileName: "/src/index.ts", ...assignRange, code: 2322, @@ -5753,7 +5754,7 @@ describe("Program - diagnostics", () => { const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = await project.program.getSuggestionDiagnostics("/src/index.ts"); - assert.deepEqual(diags, [{ + assert.deepEqual(withoutSourceFileHashes(diags), [{ fileName: "/src/index.ts", ...rangeOf(source, "_unused"), code: 6133, @@ -5777,7 +5778,7 @@ describe("Program - diagnostics", () => { const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = await project.program.getConfigFileParsingDiagnostics(); - assert.deepEqual(diags, [{ + assert.deepEqual(withoutSourceFileHashes(diags), [{ fileName: "/tsconfig.json", ...rangeOf(config, `"invalid"`), code: 6046, @@ -5854,30 +5855,29 @@ describe("Program - diagnostics", () => { } }); - test("formatDiagnostics rejects diagnostics from another program", async () => { + test("formatDiagnostics rejects diagnostics for stale source text", async () => { const api = spawnAPI({ - "/a/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, - "/a/index.ts": `const x: number = "oops";`, - "/b/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, - "/b/index.ts": `export const x = 1;`, + "/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + "/index.ts": `const x: number = "oops";`, }); try { - const snapshot = await api.updateSnapshot({ - openProjects: ["/a/tsconfig.json", "/b/tsconfig.json"], - }); - const a = snapshot.getProject("/a/tsconfig.json")!.program; - const b = snapshot.getProject("/b/tsconfig.json")!.program; - const diagnostics = await a.getSemanticDiagnostics("/a/index.ts"); + const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); + const program = snapshot.getProject("/tsconfig.json")!.program; + const diagnostics = await program.getSemanticDiagnostics("/index.ts"); const host = { getCurrentDirectory: () => "/", getCanonicalFileName: (fileName: string) => fileName, getNewLine: () => "\n", }; + const staleDiagnostics = diagnostics.map(diagnostic => ({ + ...diagnostic, + sourceFileHash: "00000000000000000000000000000000", + })); // @sync: assert.throws(() => await assert.rejects( // @sync-skip - b.formatDiagnostics(diagnostics, host), - /Diagnostic was not produced by this program/, + program.formatDiagnostics(staleDiagnostics, host), + /source file content has changed/, ); } finally { @@ -5885,33 +5885,32 @@ describe("Program - diagnostics", () => { } }); - test("formatDiagnostics rejects diagnostics without origin metadata", async () => { + test("formatDiagnostics accepts cloned diagnostics and parseConfigFile diagnostics", async () => { + const configText = `{ "compilerOptions": { "target": "invalid" } }`; const api = spawnAPI({ - "/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + "/tsconfig.json": configText, "/src/index.ts": `const x: number = "oops";`, }); try { const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); const program = snapshot.getProject("/tsconfig.json")!.program; const diagnostics = await program.getSemanticDiagnostics("/src/index.ts"); + const configDiagnostics = (await api.parseConfigFile("/tsconfig.json")).errors; const host = { getCurrentDirectory: () => "/", getCanonicalFileName: (fileName: string) => fileName, getNewLine: () => "\n", }; - const diagnosticsWithoutOrigin = [ + const clonedDiagnostics = [ [{ ...diagnostics[0] }], structuredClone(diagnostics), JSON.parse(JSON.stringify(diagnostics)), ]; - for (const clonedDiagnostics of diagnosticsWithoutOrigin) { - // @sync: assert.throws(() => - await assert.rejects( // @sync-skip - program.formatDiagnostics(clonedDiagnostics, host), - /Diagnostic was not produced by this program/, - ); + for (const cloned of clonedDiagnostics) { + assert.ok((await program.formatDiagnostics(cloned, host)).includes("TS2322")); } + assert.ok((await program.formatDiagnosticsWithColorAndContext(configDiagnostics, host)).includes(configText)); } finally { await api.close(); @@ -5976,7 +5975,7 @@ describe("Program - diagnostics", () => { const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = await project.program.getBindDiagnostics("/src/index.ts"); - assert.deepEqual(diags, [ + assert.deepEqual(withoutSourceFileHashes(diags), [ { fileName: "/src/index.ts", ...rangeOf(source, "x", 0), @@ -6008,7 +6007,7 @@ describe("Program - diagnostics", () => { const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = await project.program.getProgramDiagnostics(); - assert.deepEqual(diags, [ + assert.deepEqual(withoutSourceFileHashes(diags), [ { fileName: "/tsconfig.json", ...rangeOf(config, `"bundler"`), @@ -6086,7 +6085,7 @@ describe("Program - diagnostics", () => { const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = await project.program.getSyntacticDiagnostics(["/src/a.ts", "/src/b.ts"]); - assert.deepEqual(diags, [ + assert.deepEqual(withoutSourceFileHashes(diags), [ { fileName: "/src/a.ts", ...rangeOf(sourceA, "="), @@ -6866,6 +6865,10 @@ function rangeOf(source: string, searchString: string, occurrence: number = 0): return { pos: index, end: index + searchString.length }; } +function withoutSourceFileHashes(value: T): T { + return JSON.parse(JSON.stringify(value, (key, item) => key === "sourceFileHash" ? undefined : item)) as T; +} + function applyTextEdits(source: string, edits: readonly TextEdit[]): string { const sorted = [...edits].sort((a, b) => b.pos - a.pos); let result = source; diff --git a/packages/typescript/test/sync/api.test.ts b/packages/typescript/test/sync/api.test.ts index 7bdc46712eaa6..b624ee2bc5f3b 100644 --- a/packages/typescript/test/sync/api.test.ts +++ b/packages/typescript/test/sync/api.test.ts @@ -5692,7 +5692,8 @@ describe("Program - diagnostics", () => { const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = project.program.getSyntacticDiagnostics("/src/index.ts"); - assert.deepEqual(diags, [{ + assert.match(diags[0].sourceFileHash!, /^[0-9a-f]{32}$/); + assert.deepEqual(withoutSourceFileHashes(diags), [{ fileName: "/src/index.ts", ...rangeOf(source, "="), code: 1110, @@ -5717,7 +5718,7 @@ describe("Program - diagnostics", () => { const diags = project.program.getSemanticDiagnostics("/src/index.ts"); const declRange = rangeOf(source, "callback", 0); const assignRange = rangeOf(source, "callback", 1); - assert.deepEqual(diags, [{ + assert.deepEqual(withoutSourceFileHashes(diags), [{ fileName: "/src/index.ts", ...assignRange, code: 2322, @@ -5761,7 +5762,7 @@ describe("Program - diagnostics", () => { const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = project.program.getSuggestionDiagnostics("/src/index.ts"); - assert.deepEqual(diags, [{ + assert.deepEqual(withoutSourceFileHashes(diags), [{ fileName: "/src/index.ts", ...rangeOf(source, "_unused"), code: 6133, @@ -5785,7 +5786,7 @@ describe("Program - diagnostics", () => { const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = project.program.getConfigFileParsingDiagnostics(); - assert.deepEqual(diags, [{ + assert.deepEqual(withoutSourceFileHashes(diags), [{ fileName: "/tsconfig.json", ...rangeOf(config, `"invalid"`), code: 6046, @@ -5862,56 +5863,58 @@ describe("Program - diagnostics", () => { } }); - test("formatDiagnostics rejects diagnostics from another program", () => { + test("formatDiagnostics rejects diagnostics for stale source text", () => { const api = spawnAPI({ - "/a/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, - "/a/index.ts": `const x: number = "oops";`, - "/b/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, - "/b/index.ts": `export const x = 1;`, + "/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + "/index.ts": `const x: number = "oops";`, }); try { - const snapshot = api.updateSnapshot({ - openProjects: ["/a/tsconfig.json", "/b/tsconfig.json"], - }); - const a = snapshot.getProject("/a/tsconfig.json")!.program; - const b = snapshot.getProject("/b/tsconfig.json")!.program; - const diagnostics = a.getSemanticDiagnostics("/a/index.ts"); + const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); + const program = snapshot.getProject("/tsconfig.json")!.program; + const diagnostics = program.getSemanticDiagnostics("/index.ts"); const host = { getCurrentDirectory: () => "/", getCanonicalFileName: (fileName: string) => fileName, getNewLine: () => "\n", }; + const staleDiagnostics = diagnostics.map(diagnostic => ({ + ...diagnostic, + sourceFileHash: "00000000000000000000000000000000", + })); - assert.throws(() => b.formatDiagnostics(diagnostics, host), /Diagnostic was not produced by this program/); + assert.throws(() => program.formatDiagnostics(staleDiagnostics, host), /source file content has changed/); } finally { api.close(); } }); - test("formatDiagnostics rejects diagnostics without origin metadata", () => { + test("formatDiagnostics accepts cloned diagnostics and parseConfigFile diagnostics", () => { + const configText = `{ "compilerOptions": { "target": "invalid" } }`; const api = spawnAPI({ - "/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, + "/tsconfig.json": configText, "/src/index.ts": `const x: number = "oops";`, }); try { const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); const program = snapshot.getProject("/tsconfig.json")!.program; const diagnostics = program.getSemanticDiagnostics("/src/index.ts"); + const configDiagnostics = api.parseConfigFile("/tsconfig.json").errors; const host = { getCurrentDirectory: () => "/", getCanonicalFileName: (fileName: string) => fileName, getNewLine: () => "\n", }; - const diagnosticsWithoutOrigin = [ + const clonedDiagnostics = [ [{ ...diagnostics[0] }], structuredClone(diagnostics), JSON.parse(JSON.stringify(diagnostics)), ]; - for (const clonedDiagnostics of diagnosticsWithoutOrigin) { - assert.throws(() => program.formatDiagnostics(clonedDiagnostics, host), /Diagnostic was not produced by this program/); + for (const cloned of clonedDiagnostics) { + assert.ok(program.formatDiagnostics(cloned, host).includes("TS2322")); } + assert.ok(program.formatDiagnosticsWithColorAndContext(configDiagnostics, host).includes(configText)); } finally { api.close(); @@ -5976,7 +5979,7 @@ describe("Program - diagnostics", () => { const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = project.program.getBindDiagnostics("/src/index.ts"); - assert.deepEqual(diags, [ + assert.deepEqual(withoutSourceFileHashes(diags), [ { fileName: "/src/index.ts", ...rangeOf(source, "x", 0), @@ -6008,7 +6011,7 @@ describe("Program - diagnostics", () => { const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = project.program.getProgramDiagnostics(); - assert.deepEqual(diags, [ + assert.deepEqual(withoutSourceFileHashes(diags), [ { fileName: "/tsconfig.json", ...rangeOf(config, `"bundler"`), @@ -6086,7 +6089,7 @@ describe("Program - diagnostics", () => { const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = project.program.getSyntacticDiagnostics(["/src/a.ts", "/src/b.ts"]); - assert.deepEqual(diags, [ + assert.deepEqual(withoutSourceFileHashes(diags), [ { fileName: "/src/a.ts", ...rangeOf(sourceA, "="), @@ -6843,6 +6846,10 @@ function rangeOf(source: string, searchString: string, occurrence: number = 0): return { pos: index, end: index + searchString.length }; } +function withoutSourceFileHashes(value: T): T { + return JSON.parse(JSON.stringify(value, (key, item) => key === "sourceFileHash" ? undefined : item)) as T; +} + function applyTextEdits(source: string, edits: readonly TextEdit[]): string { const sorted = [...edits].sort((a, b) => b.pos - a.pos); let result = source; diff --git a/tsc/internal/api/format_diagnostics.go b/tsc/internal/api/format_diagnostics.go index 4f735a4a7a2bc..56e2d02a2982e 100644 --- a/tsc/internal/api/format_diagnostics.go +++ b/tsc/internal/api/format_diagnostics.go @@ -29,7 +29,7 @@ func (s *Session) handleFormatDiagnostics(ctx context.Context, params *FormatDia resolver := newFormatFileResolver(sd, program) diags := make([]diagnosticwriter.Diagnostic, len(params.Diagnostics)) for i, d := range params.Diagnostics { - diag, err := newWireDiagnostic(d, resolver, params.Snapshot, params.Project) + diag, err := newWireDiagnostic(d, resolver) if err != nil { return nil, err } @@ -124,17 +124,14 @@ type wireDiagnostic struct { func newWireDiagnostic( resp *DiagnosticResponse, resolver *formatFileResolver, - snapshot SnapshotID, - project ProjectID, ) (*wireDiagnostic, error) { - if resp.OriginSnapshot != snapshot || resp.OriginProject != project { - return nil, fmt.Errorf("%w: diagnostic was not produced by this program", ErrClientError) - } - sourceFile := resolver.resolve(resp.FileName) if resp.FileName != "" && sourceFile == nil { return nil, fmt.Errorf("%w: diagnostic source file not found: %s", ErrClientError, resp.FileName) } + if sourceFile != nil && sourceFileHash(sourceFile) != resp.SourceFileHash { + return nil, fmt.Errorf("%w: diagnostic source file content has changed: %s", ErrClientError, resp.FileName) + } pos, end := resp.Pos, resp.End var file diagnosticwriter.FileLike @@ -159,7 +156,7 @@ func newWireDiagnostic( if len(resp.MessageChain) > 0 { wd.chain = make([]diagnosticwriter.Diagnostic, len(resp.MessageChain)) for i, c := range resp.MessageChain { - diag, err := newWireDiagnostic(c, resolver, snapshot, project) + diag, err := newWireDiagnostic(c, resolver) if err != nil { return nil, err } @@ -169,7 +166,7 @@ func newWireDiagnostic( if len(resp.RelatedInformation) > 0 { wd.related = make([]diagnosticwriter.Diagnostic, len(resp.RelatedInformation)) for i, ri := range resp.RelatedInformation { - diag, err := newWireDiagnostic(ri, resolver, snapshot, project) + diag, err := newWireDiagnostic(ri, resolver) if err != nil { return nil, err } diff --git a/tsc/internal/api/proto.go b/tsc/internal/api/proto.go index fbf7ce7ef3250..ce090dca07ebe 100644 --- a/tsc/internal/api/proto.go +++ b/tsc/internal/api/proto.go @@ -20,6 +20,7 @@ import ( "github.com/microsoft/TypeScript/tsc/internal/project" "github.com/microsoft/TypeScript/tsc/internal/tsoptions" "github.com/microsoft/TypeScript/tsc/internal/tspath" + "github.com/zeebo/xxh3" ) var ( @@ -1419,6 +1420,8 @@ type GetProjectDiagnosticsParams struct { type DiagnosticResponse struct { // FileName is the path of the file this diagnostic belongs to, if any. FileName string `json:"fileName,omitempty"` + // SourceFileHash identifies the source text used to produce this diagnostic. + SourceFileHash string `json:"sourceFileHash,omitempty"` // Pos is the start position of the diagnostic in the source file. Pos int `json:"pos"` // End is the end position of the diagnostic in the source file. @@ -1439,13 +1442,18 @@ type DiagnosticResponse struct { MessageChain []*DiagnosticResponse `json:"messageChain,omitempty"` // RelatedInformation contains related diagnostic information, if any. RelatedInformation []*DiagnosticResponse `json:"relatedInformation,omitempty"` - // OriginSnapshot and OriginProject identify the program that produced this diagnostic. - OriginSnapshot SnapshotID `json:"originSnapshot,omitzero"` - OriginProject ProjectID `json:"originProject,omitzero"` // DisplayFileName is the host-formatted file name used only for diagnostic output. DisplayFileName string `json:"displayFileName,omitempty"` } +func sourceFileHash(file *ast.SourceFile) string { + hash := file.Hash + if hash == (xxh3.Uint128{}) { + hash = xxh3.Hash128([]byte(file.Text())) + } + return fmt.Sprintf("%016x%016x", hash.Hi, hash.Lo) +} + // NewDiagnosticResponse converts an ast.Diagnostic to a DiagnosticResponse. func NewDiagnosticResponse(d *ast.Diagnostic) *DiagnosticResponse { pos := d.Pos() @@ -1469,6 +1477,7 @@ func NewDiagnosticResponse(d *ast.Diagnostic) *DiagnosticResponse { if file != nil { resp.FileName = file.FileName() + resp.SourceFileHash = sourceFileHash(file) } if chain := d.MessageChain(); len(chain) > 0 { diff --git a/tsc/internal/api/proto_test.go b/tsc/internal/api/proto_test.go index 34c9dcc13fd39..32bbd8c9e6536 100644 --- a/tsc/internal/api/proto_test.go +++ b/tsc/internal/api/proto_test.go @@ -76,6 +76,7 @@ func TestNewDiagnosticResponseUsesUTF16Offsets(t *testing.T) { diag := ast.NewDiagnostic(file, core.NewTextRange(pos, end), diagnostics.Expression_expected) resp := api.NewDiagnosticResponse(diag) + assert.Equal(t, len(resp.SourceFileHash), 32) assert.Equal(t, resp.Pos, 9) assert.Equal(t, resp.End, 10) assert.Equal(t, resp.Pos, file.GetPositionMap().UTF8ToUTF16(pos)) diff --git a/tsc/internal/api/session_format_diagnostics_test.go b/tsc/internal/api/session_format_diagnostics_test.go index 3bea9603f9568..e3bdd0c7be019 100644 --- a/tsc/internal/api/session_format_diagnostics_test.go +++ b/tsc/internal/api/session_format_diagnostics_test.go @@ -2,15 +2,22 @@ package api import ( "context" + "fmt" "strings" "testing" "github.com/microsoft/TypeScript/tsc/internal/bundled" "github.com/microsoft/TypeScript/tsc/internal/diagnostics" "github.com/microsoft/TypeScript/tsc/internal/testutil/projecttestutil" + "github.com/zeebo/xxh3" "gotest.tools/v3/assert" ) +func sourceFileHashForText(text string) string { + hash := xxh3.Hash128([]byte(text)) + return fmt.Sprintf("%016x%016x", hash.Hi, hash.Lo) +} + func setupFormatSession(t *testing.T, files map[string]any, mainFile string) (*Session, SnapshotID, ProjectID) { t.Helper() projectSession, _ := projecttestutil.Setup(files) @@ -33,16 +40,6 @@ func setupFormatSession(t *testing.T, files map[string]any, mainFile string) (*S } func formatDiagnosticsParams(snapshot SnapshotID, project ProjectID, diagnostics []*DiagnosticResponse) *FormatDiagnosticsParams { - var setOrigin func([]*DiagnosticResponse) - setOrigin = func(diags []*DiagnosticResponse) { - for _, diag := range diags { - diag.OriginSnapshot = snapshot - diag.OriginProject = project - setOrigin(diag.MessageChain) - setOrigin(diag.RelatedInformation) - } - } - setOrigin(diagnostics) return &FormatDiagnosticsParams{ Snapshot: snapshot, Project: project, @@ -201,12 +198,13 @@ func TestFormatDiagnosticsClampsOutOfRangePositions(t *testing.T) { ctx := context.Background() stale := []*DiagnosticResponse{{ - FileName: fileName, - Pos: 100_000, - End: 200_000, - Code: 1234, - Category: diagnostics.CategoryError, - Text: "Stale diagnostic.", + FileName: fileName, + SourceFileHash: sourceFileHashForText("export const x = 1;\n"), + Pos: 100_000, + End: 200_000, + Code: 1234, + Category: diagnostics.CategoryError, + Text: "Stale diagnostic.", }} plain, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, stale), false) @@ -220,7 +218,7 @@ func TestFormatDiagnosticsClampsOutOfRangePositions(t *testing.T) { assert.Assert(t, strings.Contains(color.Output, "Stale diagnostic.")) } -func TestFormatDiagnosticsRejectsMismatchedOrMissingSources(t *testing.T) { +func TestFormatDiagnosticsRejectsStaleOrMissingSources(t *testing.T) { t.Parallel() if !bundled.Embedded { t.Skip("bundled files are not embedded") @@ -233,14 +231,15 @@ func TestFormatDiagnosticsRejectsMismatchedOrMissingSources(t *testing.T) { }, fileName) ctx := context.Background() - mismatched := formatDiagnosticsParams(snapshot, project, []*DiagnosticResponse{{ - Code: 1234, - Category: diagnostics.CategoryError, - Text: "Wrong program.", + stale := formatDiagnosticsParams(snapshot, project, []*DiagnosticResponse{{ + FileName: fileName, + SourceFileHash: sourceFileHashForText("different content"), + Code: 1234, + Category: diagnostics.CategoryError, + Text: "Stale diagnostic.", }}) - mismatched.Diagnostics[0].OriginSnapshot++ - _, err := session.handleFormatDiagnostics(ctx, mismatched, false) - assert.ErrorContains(t, err, "diagnostic was not produced by this program") + _, err := session.handleFormatDiagnostics(ctx, stale, false) + assert.ErrorContains(t, err, "diagnostic source file content has changed") missing := formatDiagnosticsParams(snapshot, project, []*DiagnosticResponse{{ FileName: "/home/projects/p/src/missing.ts", diff --git a/tsc/internal/tsoptions/tsconfigparsing.go b/tsc/internal/tsoptions/tsconfigparsing.go index 6f4db55f300fe..32e89b5070a5b 100644 --- a/tsc/internal/tsoptions/tsconfigparsing.go +++ b/tsc/internal/tsoptions/tsconfigparsing.go @@ -21,6 +21,7 @@ import ( "github.com/microsoft/TypeScript/tsc/internal/tspath" "github.com/microsoft/TypeScript/tsc/internal/vfs" "github.com/microsoft/TypeScript/tsc/internal/vfs/vfsmatch" + "github.com/zeebo/xxh3" ) type extendsResult struct { @@ -298,6 +299,7 @@ func NewTsconfigSourceFileFromFilePath(configFileName string, configPath tspath. FileName: configFileName, Path: configPath, }, configSourceText, core.ScriptKindJSON) + sourceFile.Hash = xxh3.Hash128([]byte(configSourceText)) return &TsConfigSourceFile{ SourceFile: sourceFile, } From 3c5feb4e88b7f663c649d130ed6ff5dd544dda32 Mon Sep 17 00:00:00 2001 From: John Favret <64748847+johnfav03@users.noreply.github.com> Date: Fri, 21 Aug 2026 14:46:09 -0500 Subject: [PATCH 5/6] addressed feedback --- tsc/internal/api/format_diagnostics.go | 2 +- .../api/session_format_diagnostics_test.go | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tsc/internal/api/format_diagnostics.go b/tsc/internal/api/format_diagnostics.go index 56e2d02a2982e..88befd0fef292 100644 --- a/tsc/internal/api/format_diagnostics.go +++ b/tsc/internal/api/format_diagnostics.go @@ -129,7 +129,7 @@ func newWireDiagnostic( if resp.FileName != "" && sourceFile == nil { return nil, fmt.Errorf("%w: diagnostic source file not found: %s", ErrClientError, resp.FileName) } - if sourceFile != nil && sourceFileHash(sourceFile) != resp.SourceFileHash { + if sourceFile != nil && resp.SourceFileHash != "" && sourceFileHash(sourceFile) != resp.SourceFileHash { return nil, fmt.Errorf("%w: diagnostic source file content has changed: %s", ErrClientError, resp.FileName) } diff --git a/tsc/internal/api/session_format_diagnostics_test.go b/tsc/internal/api/session_format_diagnostics_test.go index e3bdd0c7be019..c547f7b5242d8 100644 --- a/tsc/internal/api/session_format_diagnostics_test.go +++ b/tsc/internal/api/session_format_diagnostics_test.go @@ -184,7 +184,7 @@ func TestFormatDiagnosticsWithoutFile(t *testing.T) { "\x1b[91merror\x1b[0m\x1b[90m TS1234: \x1b[0mSome global problem.\n\n Additional context.\n") } -func TestFormatDiagnosticsClampsOutOfRangePositions(t *testing.T) { +func TestFormatDiagnosticsAllowsUnhashedDiagnosticsAndClampsOutOfRangePositions(t *testing.T) { t.Parallel() if !bundled.Embedded { t.Skip("bundled files are not embedded") @@ -198,24 +198,23 @@ func TestFormatDiagnosticsClampsOutOfRangePositions(t *testing.T) { ctx := context.Background() stale := []*DiagnosticResponse{{ - FileName: fileName, - SourceFileHash: sourceFileHashForText("export const x = 1;\n"), - Pos: 100_000, - End: 200_000, - Code: 1234, - Category: diagnostics.CategoryError, - Text: "Stale diagnostic.", + FileName: fileName, + Pos: 100_000, + End: 200_000, + Code: 1234, + Category: diagnostics.CategoryError, + Text: "Manually constructed diagnostic.", }} plain, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, stale), false) assert.NilError(t, err) assert.Equal(t, plain.Output, - "home/projects/p/src/index.ts(2,1): error TS1234: Stale diagnostic.\n") + "home/projects/p/src/index.ts(2,1): error TS1234: Manually constructed diagnostic.\n") color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, stale), true) assert.NilError(t, err) assert.Assert(t, strings.Contains(color.Output, "TS1234: ")) - assert.Assert(t, strings.Contains(color.Output, "Stale diagnostic.")) + assert.Assert(t, strings.Contains(color.Output, "Manually constructed diagnostic.")) } func TestFormatDiagnosticsRejectsStaleOrMissingSources(t *testing.T) { From 9d62a929405533e9c31ab96594160938296c5cdf Mon Sep 17 00:00:00 2001 From: John Favret <64748847+johnfav03@users.noreply.github.com> Date: Fri, 21 Aug 2026 16:45:38 -0500 Subject: [PATCH 6/6] move diagnostic formatting from go to js --- packages/typescript/src/api/async/api.ts | 60 +-- .../typescript/src/api/diagnosticFormatter.ts | 196 ++++++++++ .../typescript/src/api/proto.generated.ts | 36 +- packages/typescript/src/api/sync/api.ts | 60 +-- packages/typescript/test/async/api.test.ts | 68 ++-- packages/typescript/test/sync/api.test.ts | 70 ++-- tsc/internal/api/format_diagnostics.go | 206 ----------- tsc/internal/api/proto.go | 270 +++++++------- tsc/internal/api/proto_test.go | 24 +- tsc/internal/api/session.go | 4 - .../api/session_format_diagnostics_test.go | 344 ------------------ .../diagnosticwriter/diagnosticwriter.go | 42 --- tsc/internal/tsoptions/tsconfigparsing.go | 2 - 13 files changed, 461 insertions(+), 921 deletions(-) create mode 100644 packages/typescript/src/api/diagnosticFormatter.ts delete mode 100644 tsc/internal/api/format_diagnostics.go delete mode 100644 tsc/internal/api/session_format_diagnostics_test.go diff --git a/packages/typescript/src/api/async/api.ts b/packages/typescript/src/api/async/api.ts index 2c903c009d724..09ec61f37439a 100644 --- a/packages/typescript/src/api/async/api.ts +++ b/packages/typescript/src/api/async/api.ts @@ -27,6 +27,10 @@ import { unescapeLeadingUnderscores, } from "../../ast/index.ts"; import { assertNever } from "../../internal/utils.ts"; +import { + formatDiagnostics, + formatDiagnosticsWithColorAndContext, +} from "../diagnosticFormatter.ts"; import { encodeNode, uint8ArrayToBase64, @@ -45,7 +49,6 @@ import type { LSPConnectionOptions, } from "../options.ts"; import { - convertToRelativePath, createGetCanonicalFileName, toPath, } from "../path.ts"; @@ -208,35 +211,6 @@ export interface TranspileOutput { sourceMapText?: string; } -interface FormatDiagnosticRequest extends Diagnostic { - readonly displayFileName?: string; -} - -function toFormatDiagnosticRequest( - diagnostic: Diagnostic, - host: FormatDiagnosticsHost, -): FormatDiagnosticRequest { - const { messageChain, relatedInformation, ...diagnosticData } = diagnostic; - return { - ...diagnosticData, - ...(diagnostic.fileName - ? { - displayFileName: convertToRelativePath( - diagnostic.fileName, - host.getCurrentDirectory(), - fileName => host.getCanonicalFileName(fileName), - ), - } - : {}), - ...(messageChain - ? { messageChain: messageChain.map(d => toFormatDiagnosticRequest(d, host)) } - : {}), - ...(relatedInformation - ? { relatedInformation: relatedInformation.map(d => toFormatDiagnosticRequest(d, host)) } - : {}), - }; -} - export class API { private client: Client; private sourceFileCache: SourceFileCache; @@ -1244,13 +1218,7 @@ export class Program { diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost, ): Promise { - const data = await this.client.apiRequest("formatDiagnostics", { - snapshot: this.snapshotId, - project: this.project.id, - diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, host)), - newLine: host.getNewLine(), - }); - return data.output; + return formatDiagnostics(diagnostics, host); } /** @@ -1260,13 +1228,7 @@ export class Program { diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost, ): Promise { - const data = await this.client.apiRequest("formatDiagnosticsWithColorAndContext", { - snapshot: this.snapshotId, - project: this.project.id, - diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, host)), - newLine: host.getNewLine(), - }); - return data.output; + return formatDiagnosticsWithColorAndContext(diagnostics, host); } /** @@ -1297,7 +1259,7 @@ export class Program { project: this.project.id, ...(emitOnly !== undefined ? { emitOnly } : {}), }); - return toEmitOutput(response, response.diagnostics); + return toEmitOutput(response); } /** @@ -1309,7 +1271,7 @@ export class Program { project: this.project.id, files, }); - return toEmitOutput(response, response.diagnostics); + return toEmitOutput(response); } /** @@ -1321,18 +1283,18 @@ export class Program { project: this.project.id, files, }); - return toEmitOutput(response, response.diagnostics); + return toEmitOutput(response); } } -function toEmitOutput(response: ProtocolEmitOutputResponse, diagnostics: readonly Diagnostic[]): EmitOutput { +function toEmitOutput(response: ProtocolEmitOutputResponse): EmitOutput { const outputFiles = new Map(); for (const { fileName, ...outputFile } of response.outputFiles) { outputFiles.set(fileName, outputFile); } return { emitSkipped: response.emitSkipped, - diagnostics, + diagnostics: response.diagnostics, outputFiles, }; } diff --git a/packages/typescript/src/api/diagnosticFormatter.ts b/packages/typescript/src/api/diagnosticFormatter.ts new file mode 100644 index 0000000000000..905b7d04a539a --- /dev/null +++ b/packages/typescript/src/api/diagnosticFormatter.ts @@ -0,0 +1,196 @@ +import { convertToRelativePath } from "./path.ts"; +import type { DiagnosticResponse as Diagnostic } from "./proto.generated.ts"; + +export interface FormatDiagnosticsHost { + getCurrentDirectory(): string; + getCanonicalFileName(fileName: string): string; + getNewLine(): string; +} + +const foregroundColorEscapeGrey = "\x1b[90m"; +const foregroundColorEscapeRed = "\x1b[91m"; +const foregroundColorEscapeYellow = "\x1b[93m"; +const foregroundColorEscapeBlue = "\x1b[94m"; +const foregroundColorEscapeCyan = "\x1b[96m"; +const gutterStyleSequence = "\x1b[7m"; +const gutterSeparator = " "; +const resetEscapeSequence = "\x1b[0m"; +const ellipsis = "..."; +const halfIndent = " "; +const indent = " "; +const fileAppearsToBeBinaryCode = 1490; + +function diagnosticCategoryName(category: number): string { + switch (category) { + case 0: + return "warning"; + case 1: + return "error"; + case 2: + return "suggestion"; + case 3: + return "message"; + default: + throw new Error(`Unknown diagnostic category: ${category}`); + } +} + +function getCategoryFormat(category: number): string { + switch (category) { + case 0: + return foregroundColorEscapeYellow; + case 1: + return foregroundColorEscapeRed; + case 2: + return foregroundColorEscapeGrey; + case 3: + return foregroundColorEscapeBlue; + default: + throw new Error(`Unknown diagnostic category: ${category}`); + } +} + +function formatColorAndReset(text: string, formatStyle: string): string { + return formatStyle + text + resetEscapeSequence; +} + +function diagnosticPrefix(diagnostic: Diagnostic): string { + return diagnostic.source || "TS"; +} + +function flattenDiagnosticMessage(diagnostic: Diagnostic, newLine: string, indentLevel = 0): string { + let result = ""; + if (indentLevel) { + result += newLine + " ".repeat(indentLevel); + } + result += diagnostic.text; + for (const child of diagnostic.messageChain ?? []) { + result += flattenDiagnosticMessage(child, newLine, indentLevel + 1); + } + return result; +} + +function relativeFileName(fileName: string, host: FormatDiagnosticsHost): string { + return convertToRelativePath( + fileName, + host.getCurrentDirectory(), + name => host.getCanonicalFileName(name), + ); +} + +function formatLocation(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string { + if (!diagnostic.fileName || !diagnostic.startPosition) return ""; + const fileName = relativeFileName(diagnostic.fileName, host); + const { line, character } = diagnostic.startPosition; + return formatColorAndReset(fileName, foregroundColorEscapeCyan) + + ":" + + formatColorAndReset(`${line + 1}`, foregroundColorEscapeYellow) + + ":" + + formatColorAndReset(`${character + 1}`, foregroundColorEscapeYellow); +} + +function formatCodeSpan( + diagnostic: Diagnostic, + lineIndent: string, + squiggleColor: string, + host: FormatDiagnosticsHost, +): string { + const { startPosition, endPosition, sourceLines } = diagnostic; + if (!startPosition || !endPosition || !sourceLines?.length) return ""; + + const hasMoreThanFiveLines = endPosition.line - startPosition.line >= 4; + const gutterWidth = hasMoreThanFiveLines + ? Math.max(ellipsis.length, `${endPosition.line + 1}`.length) + : `${endPosition.line + 1}`.length; + let context = ""; + let previousLine: number | undefined; + + for (const sourceLine of sourceLines) { + if (previousLine !== undefined && sourceLine.line > previousLine + 1) { + context += host.getNewLine(); + context += lineIndent + + formatColorAndReset(ellipsis.padStart(gutterWidth), gutterStyleSequence) + + gutterSeparator; + } + + const lineContent = sourceLine.text.trimEnd().replace(/\t/g, " "); + context += host.getNewLine(); + context += lineIndent + + formatColorAndReset(`${sourceLine.line + 1}`.padStart(gutterWidth), gutterStyleSequence) + + gutterSeparator + + lineContent + + host.getNewLine(); + context += lineIndent + + formatColorAndReset("".padStart(gutterWidth), gutterStyleSequence) + + gutterSeparator + + squiggleColor; + + if (sourceLine.line === startPosition.line) { + const lastCharacter = sourceLine.line === endPosition.line + ? endPosition.character + : lineContent.length; + context += " ".repeat(startPosition.character); + context += "~".repeat(Math.max(0, lastCharacter - startPosition.character)); + } + else if (sourceLine.line === endPosition.line) { + context += "~".repeat(endPosition.character); + } + else { + context += "~".repeat(lineContent.length); + } + context += resetEscapeSequence; + previousLine = sourceLine.line; + } + + return context; +} + +export function formatDiagnostics(diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost): string { + let output = ""; + for (const diagnostic of diagnostics) { + const errorMessage = `${diagnosticCategoryName(diagnostic.category)} ${diagnosticPrefix(diagnostic)}${diagnostic.code}: ${flattenDiagnosticMessage(diagnostic, host.getNewLine())}${host.getNewLine()}`; + if (diagnostic.fileName && diagnostic.startPosition) { + const { line, character } = diagnostic.startPosition; + output += `${relativeFileName(diagnostic.fileName, host)}(${line + 1},${character + 1}): ${errorMessage}`; + } + else { + output += errorMessage; + } + } + return output; +} + +export function formatDiagnosticsWithColorAndContext( + diagnostics: readonly Diagnostic[], + host: FormatDiagnosticsHost, +): string { + let output = ""; + for (const diagnostic of diagnostics) { + if (diagnostic.fileName && diagnostic.startPosition) { + output += formatLocation(diagnostic, host) + " - "; + } + output += formatColorAndReset(diagnosticCategoryName(diagnostic.category), getCategoryFormat(diagnostic.category)); + output += formatColorAndReset(` ${diagnosticPrefix(diagnostic)}${diagnostic.code}: `, foregroundColorEscapeGrey); + output += flattenDiagnosticMessage(diagnostic, host.getNewLine()); + + if (diagnostic.fileName && diagnostic.code !== fileAppearsToBeBinaryCode) { + output += host.getNewLine(); + output += formatCodeSpan(diagnostic, "", getCategoryFormat(diagnostic.category), host); + } + + if (diagnostic.relatedInformation?.length) { + output += host.getNewLine(); + for (const related of diagnostic.relatedInformation) { + if (related.fileName && related.startPosition) { + output += host.getNewLine(); + output += halfIndent + formatLocation(related, host); + output += formatCodeSpan(related, indent, foregroundColorEscapeCyan, host); + } + output += host.getNewLine(); + output += indent + flattenDiagnosticMessage(related, host.getNewLine()); + } + } + output += host.getNewLine(); + } + return output; +} diff --git a/packages/typescript/src/api/proto.generated.ts b/packages/typescript/src/api/proto.generated.ts index 8f49e31327626..4fde71e49fd46 100644 --- a/packages/typescript/src/api/proto.generated.ts +++ b/packages/typescript/src/api/proto.generated.ts @@ -125,8 +125,6 @@ export interface APIMethodInfo { getProgramDiagnostics: APIMethod; getGlobalDiagnostics: APIMethod; getConfigFileParsingDiagnostics: APIMethod; - formatDiagnostics: APIMethod; - formatDiagnosticsWithColorAndContext: APIMethod; printNode: APIMethod; formatNodeForInsertion: APIMethod; emit: APIMethod; @@ -761,12 +759,16 @@ export interface GetDiagnosticsParams { export interface DiagnosticResponse { /** FileName is the path of the file this diagnostic belongs to, if any. */ fileName?: string; - /** SourceFileHash identifies the source text used to produce this diagnostic. */ - sourceFileHash?: string; /** Pos is the start position of the diagnostic in the source file. */ pos: number; /** End is the end position of the diagnostic in the source file. */ end: number; + /** StartPosition is the zero-based line and UTF-16 character position of Pos. */ + startPosition?: DiagnosticPositionResponse; + /** EndPosition is the zero-based line and UTF-16 character position of End. */ + endPosition?: DiagnosticPositionResponse; + /** SourceLines contains the source lines needed to render this diagnostic with context. */ + sourceLines?: DiagnosticSourceLineResponse[]; /** Code is the diagnostic error code. */ code: number; /** Category is the diagnostic category (error, warning, suggestion, message). */ @@ -783,22 +785,6 @@ export interface DiagnosticResponse { messageChain?: DiagnosticResponse[]; /** RelatedInformation contains related diagnostic information, if any. */ relatedInformation?: DiagnosticResponse[]; - /** DisplayFileName is the host-formatted file name used only for diagnostic output. */ - displayFileName?: string; -} - -/** FormatDiagnosticsParams are parameters for diagnostic formatting methods. */ -export interface FormatDiagnosticsParams { - snapshot: number; - project: string; - diagnostics: readonly DiagnosticResponse[] | null; - newLine: string; -} - -/** FormatDiagnosticsResponse is the response for diagnostic formatting methods. */ -export interface FormatDiagnosticsResponse { - /** Output is the fully formatted diagnostics text. */ - output: string; } /** PrintNodeParams are the parameters for the printNode method. */ @@ -1056,6 +1042,16 @@ export interface CompletionEntryResponse { symbol?: SymbolResponse; } +export interface DiagnosticPositionResponse { + line: number; + character: number; +} + +export interface DiagnosticSourceLineResponse { + line: number; + text: string; +} + export interface EmitOutputFile { fileName: string; text: string; diff --git a/packages/typescript/src/api/sync/api.ts b/packages/typescript/src/api/sync/api.ts index 6934d4f86a418..47079e1de8433 100644 --- a/packages/typescript/src/api/sync/api.ts +++ b/packages/typescript/src/api/sync/api.ts @@ -35,6 +35,10 @@ import { unescapeLeadingUnderscores, } from "../../ast/index.ts"; import { assertNever } from "../../internal/utils.ts"; +import { + formatDiagnostics, + formatDiagnosticsWithColorAndContext, +} from "../diagnosticFormatter.ts"; import { encodeNode, uint8ArrayToBase64, @@ -53,7 +57,6 @@ import type { LSPConnectionOptions, } from "../options.ts"; import { - convertToRelativePath, createGetCanonicalFileName, toPath, } from "../path.ts"; @@ -216,35 +219,6 @@ export interface TranspileOutput { sourceMapText?: string; } -interface FormatDiagnosticRequest extends Diagnostic { - readonly displayFileName?: string; -} - -function toFormatDiagnosticRequest( - diagnostic: Diagnostic, - host: FormatDiagnosticsHost, -): FormatDiagnosticRequest { - const { messageChain, relatedInformation, ...diagnosticData } = diagnostic; - return { - ...diagnosticData, - ...(diagnostic.fileName - ? { - displayFileName: convertToRelativePath( - diagnostic.fileName, - host.getCurrentDirectory(), - fileName => host.getCanonicalFileName(fileName), - ), - } - : {}), - ...(messageChain - ? { messageChain: messageChain.map(d => toFormatDiagnosticRequest(d, host)) } - : {}), - ...(relatedInformation - ? { relatedInformation: relatedInformation.map(d => toFormatDiagnosticRequest(d, host)) } - : {}), - }; -} - export class API { private client: Client; private sourceFileCache: SourceFileCache; @@ -1252,13 +1226,7 @@ export class Program { diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost, ): string { - const data = this.client.apiRequest("formatDiagnostics", { - snapshot: this.snapshotId, - project: this.project.id, - diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, host)), - newLine: host.getNewLine(), - }); - return data.output; + return formatDiagnostics(diagnostics, host); } /** @@ -1268,13 +1236,7 @@ export class Program { diagnostics: readonly Diagnostic[], host: FormatDiagnosticsHost, ): string { - const data = this.client.apiRequest("formatDiagnosticsWithColorAndContext", { - snapshot: this.snapshotId, - project: this.project.id, - diagnostics: diagnostics.map(d => toFormatDiagnosticRequest(d, host)), - newLine: host.getNewLine(), - }); - return data.output; + return formatDiagnosticsWithColorAndContext(diagnostics, host); } /** @@ -1305,7 +1267,7 @@ export class Program { project: this.project.id, ...(emitOnly !== undefined ? { emitOnly } : {}), }); - return toEmitOutput(response, response.diagnostics); + return toEmitOutput(response); } /** @@ -1317,7 +1279,7 @@ export class Program { project: this.project.id, files, }); - return toEmitOutput(response, response.diagnostics); + return toEmitOutput(response); } /** @@ -1329,18 +1291,18 @@ export class Program { project: this.project.id, files, }); - return toEmitOutput(response, response.diagnostics); + return toEmitOutput(response); } } -function toEmitOutput(response: ProtocolEmitOutputResponse, diagnostics: readonly Diagnostic[]): EmitOutput { +function toEmitOutput(response: ProtocolEmitOutputResponse): EmitOutput { const outputFiles = new Map(); for (const { fileName, ...outputFile } of response.outputFiles) { outputFiles.set(fileName, outputFile); } return { emitSkipped: response.emitSkipped, - diagnostics, + diagnostics: response.diagnostics, outputFiles, }; } diff --git a/packages/typescript/test/async/api.test.ts b/packages/typescript/test/async/api.test.ts index 9a7d7c9bfbfe2..51667a61df2d3 100644 --- a/packages/typescript/test/async/api.test.ts +++ b/packages/typescript/test/async/api.test.ts @@ -5684,8 +5684,10 @@ describe("Program - diagnostics", () => { const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = await project.program.getSyntacticDiagnostics("/src/index.ts"); - assert.match(diags[0].sourceFileHash!, /^[0-9a-f]{32}$/); - assert.deepEqual(withoutSourceFileHashes(diags), [{ + assert.deepEqual(diags[0].startPosition, { line: 0, character: 9 }); + assert.deepEqual(diags[0].endPosition, { line: 0, character: 10 }); + assert.deepEqual(diags[0].sourceLines, [{ line: 0, text: source }]); + assert.deepEqual(withoutFormattingContext(diags), [{ fileName: "/src/index.ts", ...rangeOf(source, "="), code: 1110, @@ -5710,7 +5712,7 @@ describe("Program - diagnostics", () => { const diags = await project.program.getSemanticDiagnostics("/src/index.ts"); const declRange = rangeOf(source, "callback", 0); const assignRange = rangeOf(source, "callback", 1); - assert.deepEqual(withoutSourceFileHashes(diags), [{ + assert.deepEqual(withoutFormattingContext(diags), [{ fileName: "/src/index.ts", ...assignRange, code: 2322, @@ -5754,7 +5756,7 @@ describe("Program - diagnostics", () => { const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = await project.program.getSuggestionDiagnostics("/src/index.ts"); - assert.deepEqual(withoutSourceFileHashes(diags), [{ + assert.deepEqual(withoutFormattingContext(diags), [{ fileName: "/src/index.ts", ...rangeOf(source, "_unused"), code: 6133, @@ -5778,7 +5780,7 @@ describe("Program - diagnostics", () => { const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = await project.program.getConfigFileParsingDiagnostics(); - assert.deepEqual(withoutSourceFileHashes(diags), [{ + assert.deepEqual(withoutFormattingContext(diags), [{ fileName: "/tsconfig.json", ...rangeOf(config, `"invalid"`), code: 6046, @@ -5822,6 +5824,21 @@ describe("Program - diagnostics", () => { assert.ok(color.endsWith("\r\n"), color); const doubled = await project.program.formatDiagnosticsWithColorAndContext([diags[0], diags[0]], host); assert.equal(doubled, color + color); + + const multiline = { + ...diags[0], + startPosition: { line: 0, character: 0 }, + endPosition: { line: 6, character: 5 }, + sourceLines: [ + { line: 0, text: "one\n" }, + { line: 1, text: "two\n" }, + { line: 5, text: "six\n" }, + { line: 6, text: "seven" }, + ], + }; + const multilineColor = await project.program.formatDiagnosticsWithColorAndContext([multiline], host); + assert.ok(multilineColor.includes("..."), multilineColor); + assert.ok(multilineColor.includes("seven"), multilineColor); } finally { await api.close(); @@ -5855,36 +5872,6 @@ describe("Program - diagnostics", () => { } }); - test("formatDiagnostics rejects diagnostics for stale source text", async () => { - const api = spawnAPI({ - "/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, - "/index.ts": `const x: number = "oops";`, - }); - try { - const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); - const program = snapshot.getProject("/tsconfig.json")!.program; - const diagnostics = await program.getSemanticDiagnostics("/index.ts"); - const host = { - getCurrentDirectory: () => "/", - getCanonicalFileName: (fileName: string) => fileName, - getNewLine: () => "\n", - }; - const staleDiagnostics = diagnostics.map(diagnostic => ({ - ...diagnostic, - sourceFileHash: "00000000000000000000000000000000", - })); - - // @sync: assert.throws(() => - await assert.rejects( // @sync-skip - program.formatDiagnostics(staleDiagnostics, host), - /source file content has changed/, - ); - } - finally { - await api.close(); - } - }); - test("formatDiagnostics accepts cloned diagnostics and parseConfigFile diagnostics", async () => { const configText = `{ "compilerOptions": { "target": "invalid" } }`; const api = spawnAPI({ @@ -5975,7 +5962,7 @@ describe("Program - diagnostics", () => { const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = await project.program.getBindDiagnostics("/src/index.ts"); - assert.deepEqual(withoutSourceFileHashes(diags), [ + assert.deepEqual(withoutFormattingContext(diags), [ { fileName: "/src/index.ts", ...rangeOf(source, "x", 0), @@ -6007,7 +5994,7 @@ describe("Program - diagnostics", () => { const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = await project.program.getProgramDiagnostics(); - assert.deepEqual(withoutSourceFileHashes(diags), [ + assert.deepEqual(withoutFormattingContext(diags), [ { fileName: "/tsconfig.json", ...rangeOf(config, `"bundler"`), @@ -6085,7 +6072,7 @@ describe("Program - diagnostics", () => { const snapshot = await api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = await project.program.getSyntacticDiagnostics(["/src/a.ts", "/src/b.ts"]); - assert.deepEqual(withoutSourceFileHashes(diags), [ + assert.deepEqual(withoutFormattingContext(diags), [ { fileName: "/src/a.ts", ...rangeOf(sourceA, "="), @@ -6865,8 +6852,9 @@ function rangeOf(source: string, searchString: string, occurrence: number = 0): return { pos: index, end: index + searchString.length }; } -function withoutSourceFileHashes(value: T): T { - return JSON.parse(JSON.stringify(value, (key, item) => key === "sourceFileHash" ? undefined : item)) as T; +function withoutFormattingContext(value: T): T { + const formattingKeys = new Set(["startPosition", "endPosition", "sourceLines"]); + return JSON.parse(JSON.stringify(value, (key, item) => formattingKeys.has(key) ? undefined : item)) as T; } function applyTextEdits(source: string, edits: readonly TextEdit[]): string { diff --git a/packages/typescript/test/sync/api.test.ts b/packages/typescript/test/sync/api.test.ts index b624ee2bc5f3b..e0e70e594465f 100644 --- a/packages/typescript/test/sync/api.test.ts +++ b/packages/typescript/test/sync/api.test.ts @@ -5692,8 +5692,10 @@ describe("Program - diagnostics", () => { const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = project.program.getSyntacticDiagnostics("/src/index.ts"); - assert.match(diags[0].sourceFileHash!, /^[0-9a-f]{32}$/); - assert.deepEqual(withoutSourceFileHashes(diags), [{ + assert.deepEqual(diags[0].startPosition, { line: 0, character: 9 }); + assert.deepEqual(diags[0].endPosition, { line: 0, character: 10 }); + assert.deepEqual(diags[0].sourceLines, [{ line: 0, text: source }]); + assert.deepEqual(withoutFormattingContext(diags), [{ fileName: "/src/index.ts", ...rangeOf(source, "="), code: 1110, @@ -5718,7 +5720,7 @@ describe("Program - diagnostics", () => { const diags = project.program.getSemanticDiagnostics("/src/index.ts"); const declRange = rangeOf(source, "callback", 0); const assignRange = rangeOf(source, "callback", 1); - assert.deepEqual(withoutSourceFileHashes(diags), [{ + assert.deepEqual(withoutFormattingContext(diags), [{ fileName: "/src/index.ts", ...assignRange, code: 2322, @@ -5762,7 +5764,7 @@ describe("Program - diagnostics", () => { const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = project.program.getSuggestionDiagnostics("/src/index.ts"); - assert.deepEqual(withoutSourceFileHashes(diags), [{ + assert.deepEqual(withoutFormattingContext(diags), [{ fileName: "/src/index.ts", ...rangeOf(source, "_unused"), code: 6133, @@ -5786,7 +5788,7 @@ describe("Program - diagnostics", () => { const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = project.program.getConfigFileParsingDiagnostics(); - assert.deepEqual(withoutSourceFileHashes(diags), [{ + assert.deepEqual(withoutFormattingContext(diags), [{ fileName: "/tsconfig.json", ...rangeOf(config, `"invalid"`), code: 6046, @@ -5830,6 +5832,21 @@ describe("Program - diagnostics", () => { assert.ok(color.endsWith("\r\n"), color); const doubled = project.program.formatDiagnosticsWithColorAndContext([diags[0], diags[0]], host); assert.equal(doubled, color + color); + + const multiline = { + ...diags[0], + startPosition: { line: 0, character: 0 }, + endPosition: { line: 6, character: 5 }, + sourceLines: [ + { line: 0, text: "one\n" }, + { line: 1, text: "two\n" }, + { line: 5, text: "six\n" }, + { line: 6, text: "seven" }, + ], + }; + const multilineColor = project.program.formatDiagnosticsWithColorAndContext([multiline], host); + assert.ok(multilineColor.includes("..."), multilineColor); + assert.ok(multilineColor.includes("seven"), multilineColor); } finally { api.close(); @@ -5863,32 +5880,6 @@ describe("Program - diagnostics", () => { } }); - test("formatDiagnostics rejects diagnostics for stale source text", () => { - const api = spawnAPI({ - "/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, - "/index.ts": `const x: number = "oops";`, - }); - try { - const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); - const program = snapshot.getProject("/tsconfig.json")!.program; - const diagnostics = program.getSemanticDiagnostics("/index.ts"); - const host = { - getCurrentDirectory: () => "/", - getCanonicalFileName: (fileName: string) => fileName, - getNewLine: () => "\n", - }; - const staleDiagnostics = diagnostics.map(diagnostic => ({ - ...diagnostic, - sourceFileHash: "00000000000000000000000000000000", - })); - - assert.throws(() => program.formatDiagnostics(staleDiagnostics, host), /source file content has changed/); - } - finally { - api.close(); - } - }); - test("formatDiagnostics accepts cloned diagnostics and parseConfigFile diagnostics", () => { const configText = `{ "compilerOptions": { "target": "invalid" } }`; const api = spawnAPI({ @@ -5899,7 +5890,7 @@ describe("Program - diagnostics", () => { const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); const program = snapshot.getProject("/tsconfig.json")!.program; const diagnostics = program.getSemanticDiagnostics("/src/index.ts"); - const configDiagnostics = api.parseConfigFile("/tsconfig.json").errors; + const configDiagnostics = (api.parseConfigFile("/tsconfig.json")).errors; const host = { getCurrentDirectory: () => "/", getCanonicalFileName: (fileName: string) => fileName, @@ -5912,9 +5903,9 @@ describe("Program - diagnostics", () => { ]; for (const cloned of clonedDiagnostics) { - assert.ok(program.formatDiagnostics(cloned, host).includes("TS2322")); + assert.ok((program.formatDiagnostics(cloned, host)).includes("TS2322")); } - assert.ok(program.formatDiagnosticsWithColorAndContext(configDiagnostics, host).includes(configText)); + assert.ok((program.formatDiagnosticsWithColorAndContext(configDiagnostics, host)).includes(configText)); } finally { api.close(); @@ -5979,7 +5970,7 @@ describe("Program - diagnostics", () => { const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = project.program.getBindDiagnostics("/src/index.ts"); - assert.deepEqual(withoutSourceFileHashes(diags), [ + assert.deepEqual(withoutFormattingContext(diags), [ { fileName: "/src/index.ts", ...rangeOf(source, "x", 0), @@ -6011,7 +6002,7 @@ describe("Program - diagnostics", () => { const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = project.program.getProgramDiagnostics(); - assert.deepEqual(withoutSourceFileHashes(diags), [ + assert.deepEqual(withoutFormattingContext(diags), [ { fileName: "/tsconfig.json", ...rangeOf(config, `"bundler"`), @@ -6089,7 +6080,7 @@ describe("Program - diagnostics", () => { const snapshot = api.updateSnapshot({ openProject: "/tsconfig.json" }); const project = snapshot.getProject("/tsconfig.json")!; const diags = project.program.getSyntacticDiagnostics(["/src/a.ts", "/src/b.ts"]); - assert.deepEqual(withoutSourceFileHashes(diags), [ + assert.deepEqual(withoutFormattingContext(diags), [ { fileName: "/src/a.ts", ...rangeOf(sourceA, "="), @@ -6846,8 +6837,9 @@ function rangeOf(source: string, searchString: string, occurrence: number = 0): return { pos: index, end: index + searchString.length }; } -function withoutSourceFileHashes(value: T): T { - return JSON.parse(JSON.stringify(value, (key, item) => key === "sourceFileHash" ? undefined : item)) as T; +function withoutFormattingContext(value: T): T { + const formattingKeys = new Set(["startPosition", "endPosition", "sourceLines"]); + return JSON.parse(JSON.stringify(value, (key, item) => formattingKeys.has(key) ? undefined : item)) as T; } function applyTextEdits(source: string, edits: readonly TextEdit[]): string { diff --git a/tsc/internal/api/format_diagnostics.go b/tsc/internal/api/format_diagnostics.go deleted file mode 100644 index 88befd0fef292..0000000000000 --- a/tsc/internal/api/format_diagnostics.go +++ /dev/null @@ -1,206 +0,0 @@ -package api - -import ( - "context" - "fmt" - "strings" - - "github.com/microsoft/TypeScript/tsc/internal/ast" - "github.com/microsoft/TypeScript/tsc/internal/compiler" - "github.com/microsoft/TypeScript/tsc/internal/diagnostics" - "github.com/microsoft/TypeScript/tsc/internal/diagnosticwriter" - "github.com/microsoft/TypeScript/tsc/internal/locale" - "github.com/microsoft/TypeScript/tsc/internal/tsoptions" - "github.com/microsoft/TypeScript/tsc/internal/tspath" -) - -// handleFormatDiagnostics formats diagnostics using source text from their snapshot. -func (s *Session) handleFormatDiagnostics(ctx context.Context, params *FormatDiagnosticsParams, colorAndContext bool) (*FormatDiagnosticsResponse, error) { - sd, err := s.getSnapshotData(params.Snapshot) - if err != nil { - return nil, err - } - - program, err := sd.getProgram(params.Project) - if err != nil { - return nil, err - } - - resolver := newFormatFileResolver(sd, program) - diags := make([]diagnosticwriter.Diagnostic, len(params.Diagnostics)) - for i, d := range params.Diagnostics { - diag, err := newWireDiagnostic(d, resolver) - if err != nil { - return nil, err - } - diags[i] = diag - } - - formatOpts := &diagnosticwriter.FormattingOptions{ - NewLine: params.NewLine, - ComparePathsOptions: tspath.ComparePathsOptions{ - CurrentDirectory: s.projectSession.GetCurrentDirectory(), - UseCaseSensitiveFileNames: s.projectSession.FS().UseCaseSensitiveFileNames(), - }, - } - - var sb strings.Builder - if colorAndContext { - diagnosticwriter.FormatDiagnosticsWithColorAndContextForAPI(&sb, diags, formatOpts) - } else { - diagnosticwriter.WriteFormatDiagnostics(&sb, diags, formatOpts) - } - - return &FormatDiagnosticsResponse{Output: sb.String()}, nil -} - -// formatFileResolver resolves source and config files from a snapshot. -type formatFileResolver struct { - sd *snapshotData - program *compiler.Program - cache map[string]*ast.SourceFile -} - -func newFormatFileResolver(sd *snapshotData, program *compiler.Program) *formatFileResolver { - return &formatFileResolver{ - sd: sd, - program: program, - cache: make(map[string]*ast.SourceFile), - } -} - -func (r *formatFileResolver) resolve(fileName string) *ast.SourceFile { - if fileName == "" { - return nil - } - if file, ok := r.cache[fileName]; ok { - return file - } - file := r.resolveUncached(fileName) - r.cache[fileName] = file - return file -} - -func (r *formatFileResolver) resolveUncached(fileName string) *ast.SourceFile { - if file := r.program.GetSourceFile(fileName); file != nil { - return file - } - - // Config files are not program source files. - commandLine := r.program.CommandLine() - if commandLine == nil || commandLine.ConfigFile == nil || commandLine.ConfigFile.SourceFile == nil { - return nil - } - - requestedPath := tspath.ToPath(fileName, r.program.GetCurrentDirectory(), r.program.UseCaseSensitiveFileNames()) - if rootConfig := commandLine.ConfigFile.SourceFile; rootConfig.Path() == requestedPath { - return rootConfig - } - - for _, configFileName := range commandLine.ExtendedSourceFiles() { - if tspath.ToPath(configFileName, r.program.GetCurrentDirectory(), r.program.UseCaseSensitiveFileNames()) != requestedPath { - continue - } - configFileContent, ok := r.sd.snapshot.ReadFile(configFileName) - if !ok { - return nil - } - return tsoptions.NewTsconfigSourceFileFromFilePath(configFileName, requestedPath, configFileContent).SourceFile - } - - return nil -} - -// wireDiagnostic adapts a DiagnosticResponse to diagnosticwriter.Diagnostic. -type wireDiagnostic struct { - resp *DiagnosticResponse - file diagnosticwriter.FileLike - pos int // UTF-8 byte offset - end int // UTF-8 byte offset - chain []diagnosticwriter.Diagnostic - related []diagnosticwriter.Diagnostic -} - -func newWireDiagnostic( - resp *DiagnosticResponse, - resolver *formatFileResolver, -) (*wireDiagnostic, error) { - sourceFile := resolver.resolve(resp.FileName) - if resp.FileName != "" && sourceFile == nil { - return nil, fmt.Errorf("%w: diagnostic source file not found: %s", ErrClientError, resp.FileName) - } - if sourceFile != nil && resp.SourceFileHash != "" && sourceFileHash(sourceFile) != resp.SourceFileHash { - return nil, fmt.Errorf("%w: diagnostic source file content has changed: %s", ErrClientError, resp.FileName) - } - - pos, end := resp.Pos, resp.End - var file diagnosticwriter.FileLike - if sourceFile != nil { - positionMap := sourceFile.GetPositionMap() - pos = positionMap.UTF16ToUTF8(resp.Pos) - end = positionMap.UTF16ToUTF8(resp.End) - textLength := len(sourceFile.Text()) - pos = max(0, min(pos, textLength)) - end = max(pos, min(end, textLength)) - file = sourceFile - if resp.DisplayFileName != "" { - file = &diagnosticDisplayFile{ - SourceFile: sourceFile, - fileName: resp.DisplayFileName, - } - } - } - - wd := &wireDiagnostic{resp: resp, file: file, pos: pos, end: end} - - if len(resp.MessageChain) > 0 { - wd.chain = make([]diagnosticwriter.Diagnostic, len(resp.MessageChain)) - for i, c := range resp.MessageChain { - diag, err := newWireDiagnostic(c, resolver) - if err != nil { - return nil, err - } - wd.chain[i] = diag - } - } - if len(resp.RelatedInformation) > 0 { - wd.related = make([]diagnosticwriter.Diagnostic, len(resp.RelatedInformation)) - for i, ri := range resp.RelatedInformation { - diag, err := newWireDiagnostic(ri, resolver) - if err != nil { - return nil, err - } - wd.related[i] = diag - } - } - - return wd, nil -} - -type diagnosticDisplayFile struct { - *ast.SourceFile - fileName string -} - -func (f *diagnosticDisplayFile) FileName() string { - return f.fileName -} - -func (f *diagnosticDisplayFile) FileNameIsFormatted() bool { - return true -} - -func (d *wireDiagnostic) File() diagnosticwriter.FileLike { - return d.file -} - -func (d *wireDiagnostic) Pos() int { return d.pos } -func (d *wireDiagnostic) End() int { return d.end } -func (d *wireDiagnostic) Len() int { return d.end - d.pos } -func (d *wireDiagnostic) Code() int32 { return d.resp.Code } -func (d *wireDiagnostic) Category() diagnostics.Category { return d.resp.Category } -func (d *wireDiagnostic) Source() string { return d.resp.Source } -func (d *wireDiagnostic) Localize(_ locale.Locale) string { return d.resp.Text } - -func (d *wireDiagnostic) MessageChain() []diagnosticwriter.Diagnostic { return d.chain } -func (d *wireDiagnostic) RelatedInformation() []diagnosticwriter.Diagnostic { return d.related } diff --git a/tsc/internal/api/proto.go b/tsc/internal/api/proto.go index ce090dca07ebe..fa4418b945680 100644 --- a/tsc/internal/api/proto.go +++ b/tsc/internal/api/proto.go @@ -11,6 +11,7 @@ import ( "github.com/microsoft/TypeScript/tsc/internal/collections" "github.com/microsoft/TypeScript/tsc/internal/core" "github.com/microsoft/TypeScript/tsc/internal/diagnostics" + "github.com/microsoft/TypeScript/tsc/internal/diagnosticwriter" "github.com/microsoft/TypeScript/tsc/internal/jsnum" "github.com/microsoft/TypeScript/tsc/internal/json" "github.com/microsoft/TypeScript/tsc/internal/locale" @@ -18,9 +19,9 @@ import ( "github.com/microsoft/TypeScript/tsc/internal/lsp/lsproto" "github.com/microsoft/TypeScript/tsc/internal/packagejson" "github.com/microsoft/TypeScript/tsc/internal/project" + "github.com/microsoft/TypeScript/tsc/internal/scanner" "github.com/microsoft/TypeScript/tsc/internal/tsoptions" "github.com/microsoft/TypeScript/tsc/internal/tspath" - "github.com/zeebo/xxh3" ) var ( @@ -182,17 +183,14 @@ const ( MethodGetCompletionsAtPosition Method = "getCompletionsAtPosition" // Diagnostic methods - MethodGetSyntacticDiagnostics Method = "getSyntacticDiagnostics" - MethodGetBindDiagnostics Method = "getBindDiagnostics" - MethodGetSemanticDiagnostics Method = "getSemanticDiagnostics" - MethodGetSuggestionDiagnostics Method = "getSuggestionDiagnostics" - MethodGetDeclarationDiagnostics Method = "getDeclarationDiagnostics" - MethodGetProgramDiagnostics Method = "getProgramDiagnostics" - MethodGetGlobalDiagnostics Method = "getGlobalDiagnostics" - MethodGetConfigFileParsingDiagnostics Method = "getConfigFileParsingDiagnostics" - MethodFormatDiagnostics Method = "formatDiagnostics" - MethodFormatDiagnosticsWithColorAndContext Method = "formatDiagnosticsWithColorAndContext" - + MethodGetSyntacticDiagnostics Method = "getSyntacticDiagnostics" + MethodGetBindDiagnostics Method = "getBindDiagnostics" + MethodGetSemanticDiagnostics Method = "getSemanticDiagnostics" + MethodGetSuggestionDiagnostics Method = "getSuggestionDiagnostics" + MethodGetDeclarationDiagnostics Method = "getDeclarationDiagnostics" + MethodGetProgramDiagnostics Method = "getProgramDiagnostics" + MethodGetGlobalDiagnostics Method = "getGlobalDiagnostics" + MethodGetConfigFileParsingDiagnostics Method = "getConfigFileParsingDiagnostics" // Emitter methods MethodPrintNode Method = "printNode" MethodFormatNodeForInsertion Method = "formatNodeForInsertion" @@ -469,85 +467,83 @@ var unmarshalers = map[Method]func([]byte) (any, error){ MethodGetThisParameterOfSignature: unmarshallerFor[GetSignaturePropertyParams], MethodGetTargetOfSignature: unmarshallerFor[GetSignaturePropertyParams], - MethodGetContextualType: unmarshallerFor[GetContextualTypeParams], - MethodGetBaseTypeOfLiteralType: unmarshallerFor[GetBaseTypeOfLiteralTypeParams], - MethodGetNonNullableType: unmarshallerFor[GetTypePropertyParams], - MethodGetTypeFromTypeNode: unmarshallerFor[GetTypeFromTypeNodeParams], - MethodGetWidenedType: unmarshallerFor[GetWidenedTypeParams], - MethodGetParameterType: unmarshallerFor[GetParameterTypeParams], - MethodGetTypeParameterAtPosition: unmarshallerFor[GetParameterTypeParams], - MethodIsArrayLikeType: unmarshallerFor[IsArrayLikeTypeParams], - MethodIsTypeAssignableTo: unmarshallerFor[IsTypeAssignableToParams], - MethodGetShorthandAssignmentValueSymbol: unmarshallerFor[GetTypeAtLocationParams], - MethodGetTypeOfSymbolAtLocation: unmarshallerFor[GetTypeOfSymbolAtLocationParams], - MethodTypeToTypeNode: unmarshallerFor[TypeToTypeNodeParams], - MethodSignatureToSignatureDeclaration: unmarshallerFor[SignatureToSignatureDeclarationParams], - MethodTypeToString: unmarshallerFor[TypeToTypeNodeParams], - MethodIsContextSensitive: unmarshallerFor[GetContextualTypeParams], - MethodGetReturnTypeOfSignature: unmarshallerFor[GetSignaturePropertyParams], - MethodGetRestTypeOfSignature: unmarshallerFor[CheckerSignatureParams], - MethodGetTypePredicateOfSignature: unmarshallerFor[CheckerSignatureParams], - MethodGetBaseTypes: unmarshallerFor[CheckerTypeParams], - MethodGetPropertiesOfType: unmarshallerFor[CheckerTypeParams], - MethodGetApparentPropertiesOfType: unmarshallerFor[GetTypePropertyParams], - MethodGetApparentType: unmarshallerFor[GetTypePropertyParams], - MethodGetReducedType: unmarshallerFor[GetTypePropertyParams], - MethodGetPropertyOfType: unmarshallerFor[GetPropertyOfTypeParams], - MethodGetIndexInfosOfType: unmarshallerFor[CheckerTypeParams], - MethodGetConstraintOfTypeParameter: unmarshallerFor[GetTypePropertyParams], - MethodGetBaseConstraintOfType: unmarshallerFor[CheckerTypeParams], - MethodGetDefaultFromTypeParameter: unmarshallerFor[GetTypePropertyParams], - MethodGetTypeArguments: unmarshallerFor[CheckerTypeParams], - MethodGetImportAdderEdits: unmarshallerFor[GetImportAdderEditsParams], - MethodGetConstantValue: unmarshallerFor[CheckerNodeParams], - MethodGetSignatureFromDeclaration: unmarshallerFor[CheckerNodeParams], - MethodGetExportSpecifierLocalTarget: unmarshallerFor[CheckerNodeParams], - MethodGetAliasedSymbol: unmarshallerFor[CheckerSymbolParams], - MethodGetImmediateAliasedSymbol: unmarshallerFor[CheckerSymbolParams], - MethodGetFullyQualifiedName: unmarshallerFor[CheckerSymbolParams], - MethodGetExportsOfModule: unmarshallerFor[CheckerSymbolParams], - MethodGetMemberInModuleExports: unmarshallerFor[GetMemberInModuleExportsParams], - MethodGetJSDocTags: unmarshallerFor[CheckerSymbolParams], - MethodGetDocumentationComment: unmarshallerFor[CheckerSymbolParams], - MethodIsArrayType: unmarshallerFor[CheckerTypeParams], - MethodIsTupleType: unmarshallerFor[CheckerTypeParams], - MethodGetReferencesToSymbolInFile: unmarshallerFor[GetReferencesToSymbolInFileParams], - MethodGetReferencedSymbolsForNode: unmarshallerFor[GetReferencedSymbolsForNodeParams], - MethodGetSignatureUsages: unmarshallerFor[GetSignatureUsagesParams], - MethodGetCompletionsAtPosition: unmarshallerFor[GetCompletionsAtPositionParams], - MethodPrintNode: unmarshallerFor[PrintNodeParams], - MethodFormatNodeForInsertion: unmarshallerFor[FormatNodeForInsertionParams], - MethodEmit: unmarshallerFor[EmitParams], - MethodEmitToString: unmarshallerFor[EmitParams], - MethodGetJavaScriptEmit: unmarshallerFor[SelectedFilesEmitParams], - MethodGetDeclarationEmit: unmarshallerFor[SelectedFilesEmitParams], - MethodGetAnyType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetStringType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetNumberType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetBooleanType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetVoidType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetUndefinedType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetNullType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetNeverType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetUnknownType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetBigIntType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetESSymbolType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetNonPrimitiveType: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetWellKnownSymbols: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetWellKnownSignatures: unmarshallerFor[GetIntrinsicTypeParams], - MethodGetSyntacticDiagnostics: unmarshallerFor[GetDiagnosticsParams], - MethodGetBindDiagnostics: unmarshallerFor[GetDiagnosticsParams], - MethodGetSemanticDiagnostics: unmarshallerFor[GetDiagnosticsParams], - MethodGetSuggestionDiagnostics: unmarshallerFor[GetDiagnosticsParams], - MethodGetDeclarationDiagnostics: unmarshallerFor[GetDiagnosticsParams], - MethodGetProgramDiagnostics: unmarshallerFor[GetProjectDiagnosticsParams], - MethodGetGlobalDiagnostics: unmarshallerFor[GetProjectDiagnosticsParams], - MethodGetConfigFileParsingDiagnostics: unmarshallerFor[GetProjectDiagnosticsParams], - MethodFormatDiagnostics: unmarshallerFor[FormatDiagnosticsParams], - MethodFormatDiagnosticsWithColorAndContext: unmarshallerFor[FormatDiagnosticsParams], - MethodStartCPUProfile: unmarshallerFor[ProfileParams], - MethodStopCPUProfile: noParams, - MethodSaveHeapProfile: unmarshallerFor[ProfileParams], + MethodGetContextualType: unmarshallerFor[GetContextualTypeParams], + MethodGetBaseTypeOfLiteralType: unmarshallerFor[GetBaseTypeOfLiteralTypeParams], + MethodGetNonNullableType: unmarshallerFor[GetTypePropertyParams], + MethodGetTypeFromTypeNode: unmarshallerFor[GetTypeFromTypeNodeParams], + MethodGetWidenedType: unmarshallerFor[GetWidenedTypeParams], + MethodGetParameterType: unmarshallerFor[GetParameterTypeParams], + MethodGetTypeParameterAtPosition: unmarshallerFor[GetParameterTypeParams], + MethodIsArrayLikeType: unmarshallerFor[IsArrayLikeTypeParams], + MethodIsTypeAssignableTo: unmarshallerFor[IsTypeAssignableToParams], + MethodGetShorthandAssignmentValueSymbol: unmarshallerFor[GetTypeAtLocationParams], + MethodGetTypeOfSymbolAtLocation: unmarshallerFor[GetTypeOfSymbolAtLocationParams], + MethodTypeToTypeNode: unmarshallerFor[TypeToTypeNodeParams], + MethodSignatureToSignatureDeclaration: unmarshallerFor[SignatureToSignatureDeclarationParams], + MethodTypeToString: unmarshallerFor[TypeToTypeNodeParams], + MethodIsContextSensitive: unmarshallerFor[GetContextualTypeParams], + MethodGetReturnTypeOfSignature: unmarshallerFor[GetSignaturePropertyParams], + MethodGetRestTypeOfSignature: unmarshallerFor[CheckerSignatureParams], + MethodGetTypePredicateOfSignature: unmarshallerFor[CheckerSignatureParams], + MethodGetBaseTypes: unmarshallerFor[CheckerTypeParams], + MethodGetPropertiesOfType: unmarshallerFor[CheckerTypeParams], + MethodGetApparentPropertiesOfType: unmarshallerFor[GetTypePropertyParams], + MethodGetApparentType: unmarshallerFor[GetTypePropertyParams], + MethodGetReducedType: unmarshallerFor[GetTypePropertyParams], + MethodGetPropertyOfType: unmarshallerFor[GetPropertyOfTypeParams], + MethodGetIndexInfosOfType: unmarshallerFor[CheckerTypeParams], + MethodGetConstraintOfTypeParameter: unmarshallerFor[GetTypePropertyParams], + MethodGetBaseConstraintOfType: unmarshallerFor[CheckerTypeParams], + MethodGetDefaultFromTypeParameter: unmarshallerFor[GetTypePropertyParams], + MethodGetTypeArguments: unmarshallerFor[CheckerTypeParams], + MethodGetImportAdderEdits: unmarshallerFor[GetImportAdderEditsParams], + MethodGetConstantValue: unmarshallerFor[CheckerNodeParams], + MethodGetSignatureFromDeclaration: unmarshallerFor[CheckerNodeParams], + MethodGetExportSpecifierLocalTarget: unmarshallerFor[CheckerNodeParams], + MethodGetAliasedSymbol: unmarshallerFor[CheckerSymbolParams], + MethodGetImmediateAliasedSymbol: unmarshallerFor[CheckerSymbolParams], + MethodGetFullyQualifiedName: unmarshallerFor[CheckerSymbolParams], + MethodGetExportsOfModule: unmarshallerFor[CheckerSymbolParams], + MethodGetMemberInModuleExports: unmarshallerFor[GetMemberInModuleExportsParams], + MethodGetJSDocTags: unmarshallerFor[CheckerSymbolParams], + MethodGetDocumentationComment: unmarshallerFor[CheckerSymbolParams], + MethodIsArrayType: unmarshallerFor[CheckerTypeParams], + MethodIsTupleType: unmarshallerFor[CheckerTypeParams], + MethodGetReferencesToSymbolInFile: unmarshallerFor[GetReferencesToSymbolInFileParams], + MethodGetReferencedSymbolsForNode: unmarshallerFor[GetReferencedSymbolsForNodeParams], + MethodGetSignatureUsages: unmarshallerFor[GetSignatureUsagesParams], + MethodGetCompletionsAtPosition: unmarshallerFor[GetCompletionsAtPositionParams], + MethodPrintNode: unmarshallerFor[PrintNodeParams], + MethodFormatNodeForInsertion: unmarshallerFor[FormatNodeForInsertionParams], + MethodEmit: unmarshallerFor[EmitParams], + MethodEmitToString: unmarshallerFor[EmitParams], + MethodGetJavaScriptEmit: unmarshallerFor[SelectedFilesEmitParams], + MethodGetDeclarationEmit: unmarshallerFor[SelectedFilesEmitParams], + MethodGetAnyType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetStringType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetNumberType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetBooleanType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetVoidType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetUndefinedType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetNullType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetNeverType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetUnknownType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetBigIntType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetESSymbolType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetNonPrimitiveType: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetWellKnownSymbols: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetWellKnownSignatures: unmarshallerFor[GetIntrinsicTypeParams], + MethodGetSyntacticDiagnostics: unmarshallerFor[GetDiagnosticsParams], + MethodGetBindDiagnostics: unmarshallerFor[GetDiagnosticsParams], + MethodGetSemanticDiagnostics: unmarshallerFor[GetDiagnosticsParams], + MethodGetSuggestionDiagnostics: unmarshallerFor[GetDiagnosticsParams], + MethodGetDeclarationDiagnostics: unmarshallerFor[GetDiagnosticsParams], + MethodGetProgramDiagnostics: unmarshallerFor[GetProjectDiagnosticsParams], + MethodGetGlobalDiagnostics: unmarshallerFor[GetProjectDiagnosticsParams], + MethodGetConfigFileParsingDiagnostics: unmarshallerFor[GetProjectDiagnosticsParams], + MethodStartCPUProfile: unmarshallerFor[ProfileParams], + MethodStopCPUProfile: noParams, + MethodSaveHeapProfile: unmarshallerFor[ProfileParams], } type ParseConfigFileParams struct { @@ -1420,12 +1416,16 @@ type GetProjectDiagnosticsParams struct { type DiagnosticResponse struct { // FileName is the path of the file this diagnostic belongs to, if any. FileName string `json:"fileName,omitempty"` - // SourceFileHash identifies the source text used to produce this diagnostic. - SourceFileHash string `json:"sourceFileHash,omitempty"` // Pos is the start position of the diagnostic in the source file. Pos int `json:"pos"` // End is the end position of the diagnostic in the source file. End int `json:"end"` + // StartPosition is the zero-based line and UTF-16 character position of Pos. + StartPosition *DiagnosticPositionResponse `json:"startPosition,omitempty"` + // EndPosition is the zero-based line and UTF-16 character position of End. + EndPosition *DiagnosticPositionResponse `json:"endPosition,omitempty"` + // SourceLines contains the source lines needed to render this diagnostic with context. + SourceLines []*DiagnosticSourceLineResponse `json:"sourceLines,omitempty"` // Code is the diagnostic error code. Code int32 `json:"code"` // Category is the diagnostic category (error, warning, suggestion, message). @@ -1442,27 +1442,57 @@ type DiagnosticResponse struct { MessageChain []*DiagnosticResponse `json:"messageChain,omitempty"` // RelatedInformation contains related diagnostic information, if any. RelatedInformation []*DiagnosticResponse `json:"relatedInformation,omitempty"` - // DisplayFileName is the host-formatted file name used only for diagnostic output. - DisplayFileName string `json:"displayFileName,omitempty"` } -func sourceFileHash(file *ast.SourceFile) string { - hash := file.Hash - if hash == (xxh3.Uint128{}) { - hash = xxh3.Hash128([]byte(file.Text())) +type DiagnosticPositionResponse struct { + Line int `json:"line"` + Character core.UTF16Offset `json:"character"` +} + +type DiagnosticSourceLineResponse struct { + Line int `json:"line"` + Text string `json:"text"` +} + +func diagnosticSourceLines(file diagnosticwriter.FileLike, firstLine int, lastLine int) []*DiagnosticSourceLineResponse { + lineMap := file.ECMALineMap() + if len(lineMap) == 0 { + return nil + } + + lines := make([]int, 0, min(lastLine-firstLine+1, 4)) + if lastLine-firstLine >= 4 { + lines = append(lines, firstLine, firstLine+1, lastLine-1, lastLine) + } else { + for line := firstLine; line <= lastLine; line++ { + lines = append(lines, line) + } + } + + text := file.Text() + result := make([]*DiagnosticSourceLineResponse, 0, len(lines)) + for _, line := range lines { + start := int(lineMap[line]) + end := len(text) + if line+1 < len(lineMap) { + end = int(lineMap[line+1]) + } + result = append(result, &DiagnosticSourceLineResponse{Line: line, Text: text[start:end]}) } - return fmt.Sprintf("%016x%016x", hash.Hi, hash.Lo) + return result } // NewDiagnosticResponse converts an ast.Diagnostic to a DiagnosticResponse. func NewDiagnosticResponse(d *ast.Diagnostic) *DiagnosticResponse { - pos := d.Pos() - end := d.End() + return newDiagnosticResponse(diagnosticwriter.WrapASTDiagnostic(d)) +} + +func newDiagnosticResponse(d *diagnosticwriter.ASTDiagnostic) *DiagnosticResponse { file := d.File() + pos, end := d.Pos(), d.End() if file != nil { - positionMap := file.GetPositionMap() - pos = positionMap.UTF8ToUTF16(pos) - end = positionMap.UTF8ToUTF16(end) + pos = max(0, min(pos, len(file.Text()))) + end = max(pos, min(end, len(file.Text()))) } resp := &DiagnosticResponse{ Pos: pos, @@ -1471,26 +1501,32 @@ func NewDiagnosticResponse(d *ast.Diagnostic) *DiagnosticResponse { Category: d.Category(), Source: d.Source(), Text: d.Localize(locale.Default), - ReportsUnnecessary: d.ReportsUnnecessary(), - ReportsDeprecated: d.ReportsDeprecated(), + ReportsUnnecessary: d.Diagnostic.ReportsUnnecessary(), + ReportsDeprecated: d.Diagnostic.ReportsDeprecated(), } if file != nil { resp.FileName = file.FileName() - resp.SourceFileHash = sourceFileHash(file) + resp.Pos = int(core.UTF16Len(file.Text()[:pos])) + resp.End = int(core.UTF16Len(file.Text()[:end])) + startLine, startCharacter := scanner.GetECMALineAndUTF16CharacterOfPosition(file, pos) + endLine, endCharacter := scanner.GetECMALineAndUTF16CharacterOfPosition(file, end) + resp.StartPosition = &DiagnosticPositionResponse{Line: startLine, Character: startCharacter} + resp.EndPosition = &DiagnosticPositionResponse{Line: endLine, Character: endCharacter} + resp.SourceLines = diagnosticSourceLines(file, startLine, endLine) } if chain := d.MessageChain(); len(chain) > 0 { resp.MessageChain = make([]*DiagnosticResponse, len(chain)) for i, c := range chain { - resp.MessageChain[i] = NewDiagnosticResponse(c) + resp.MessageChain[i] = newDiagnosticResponse(c.(*diagnosticwriter.ASTDiagnostic)) } } if related := d.RelatedInformation(); len(related) > 0 { resp.RelatedInformation = make([]*DiagnosticResponse, len(related)) for i, r := range related { - resp.RelatedInformation[i] = NewDiagnosticResponse(r) + resp.RelatedInformation[i] = newDiagnosticResponse(r.(*diagnosticwriter.ASTDiagnostic)) } } @@ -1509,20 +1545,6 @@ func NewDiagnosticResponses(diags []*ast.Diagnostic) []*DiagnosticResponse { return result } -// FormatDiagnosticsParams are parameters for diagnostic formatting methods. -type FormatDiagnosticsParams struct { - Snapshot SnapshotID `json:"snapshot"` - Project ProjectID `json:"project"` - Diagnostics []*DiagnosticResponse `json:"diagnostics"` - NewLine string `json:"newLine"` -} - -// FormatDiagnosticsResponse is the response for diagnostic formatting methods. -type FormatDiagnosticsResponse struct { - // Output is the fully formatted diagnostics text. - Output string `json:"output"` -} - func unmarshalPayload(method string, payload json.Value) (any, error) { unmarshaler, ok := unmarshalers[Method(method)] if !ok { diff --git a/tsc/internal/api/proto_test.go b/tsc/internal/api/proto_test.go index 32bbd8c9e6536..e5add0c137345 100644 --- a/tsc/internal/api/proto_test.go +++ b/tsc/internal/api/proto_test.go @@ -64,7 +64,7 @@ func TestDocumentIdentifierUnmarshalJSON(t *testing.T) { } } -func TestNewDiagnosticResponseUsesUTF16Offsets(t *testing.T) { +func TestNewDiagnosticResponseIncludesFormattingContext(t *testing.T) { t.Parallel() text := "const 💩 = 1;" @@ -76,9 +76,29 @@ func TestNewDiagnosticResponseUsesUTF16Offsets(t *testing.T) { diag := ast.NewDiagnostic(file, core.NewTextRange(pos, end), diagnostics.Expression_expected) resp := api.NewDiagnosticResponse(diag) - assert.Equal(t, len(resp.SourceFileHash), 32) assert.Equal(t, resp.Pos, 9) assert.Equal(t, resp.End, 10) + assert.DeepEqual(t, resp.StartPosition, &api.DiagnosticPositionResponse{Line: 0, Character: 9}) + assert.DeepEqual(t, resp.EndPosition, &api.DiagnosticPositionResponse{Line: 0, Character: 10}) + assert.DeepEqual(t, resp.SourceLines, []*api.DiagnosticSourceLineResponse{{Line: 0, Text: text}}) assert.Equal(t, resp.Pos, file.GetPositionMap().UTF8ToUTF16(pos)) assert.Equal(t, resp.End, file.GetPositionMap().UTF8ToUTF16(end)) } + +func TestNewDiagnosticResponseTruncatesLongFormattingContext(t *testing.T) { + t.Parallel() + + text := "one\ntwo\nthree\nfour\nfive\nsix\nseven" + file := parser.ParseSourceFile(ast.SourceFileParseOptions{FileName: "/multiline.ts"}, text, core.ScriptKindTS) + diag := ast.NewDiagnostic(file, core.NewTextRange(0, len(text)), diagnostics.Expression_expected) + resp := api.NewDiagnosticResponse(diag) + + assert.DeepEqual(t, resp.StartPosition, &api.DiagnosticPositionResponse{Line: 0, Character: 0}) + assert.DeepEqual(t, resp.EndPosition, &api.DiagnosticPositionResponse{Line: 6, Character: 5}) + assert.DeepEqual(t, resp.SourceLines, []*api.DiagnosticSourceLineResponse{ + {Line: 0, Text: "one\n"}, + {Line: 1, Text: "two\n"}, + {Line: 5, Text: "six\n"}, + {Line: 6, Text: "seven"}, + }) +} diff --git a/tsc/internal/api/session.go b/tsc/internal/api/session.go index 1e2893e2a3b62..d5c668385b849 100644 --- a/tsc/internal/api/session.go +++ b/tsc/internal/api/session.go @@ -861,10 +861,6 @@ func (s *Session) HandleRequest(ctx context.Context, method string, params json. return s.handleGetGlobalDiagnostics(ctx, parsed.(*GetProjectDiagnosticsParams)) case string(MethodGetConfigFileParsingDiagnostics): return s.handleGetConfigFileParsingDiagnostics(ctx, parsed.(*GetProjectDiagnosticsParams)) - case string(MethodFormatDiagnostics): - return s.handleFormatDiagnostics(ctx, parsed.(*FormatDiagnosticsParams), false /*colorAndContext*/) - case string(MethodFormatDiagnosticsWithColorAndContext): - return s.handleFormatDiagnostics(ctx, parsed.(*FormatDiagnosticsParams), true /*colorAndContext*/) case string(MethodStartCPUProfile): return s.handleStartCPUProfile(ctx, parsed.(*ProfileParams)) case string(MethodStopCPUProfile): diff --git a/tsc/internal/api/session_format_diagnostics_test.go b/tsc/internal/api/session_format_diagnostics_test.go deleted file mode 100644 index c547f7b5242d8..0000000000000 --- a/tsc/internal/api/session_format_diagnostics_test.go +++ /dev/null @@ -1,344 +0,0 @@ -package api - -import ( - "context" - "fmt" - "strings" - "testing" - - "github.com/microsoft/TypeScript/tsc/internal/bundled" - "github.com/microsoft/TypeScript/tsc/internal/diagnostics" - "github.com/microsoft/TypeScript/tsc/internal/testutil/projecttestutil" - "github.com/zeebo/xxh3" - "gotest.tools/v3/assert" -) - -func sourceFileHashForText(text string) string { - hash := xxh3.Hash128([]byte(text)) - return fmt.Sprintf("%016x%016x", hash.Hi, hash.Lo) -} - -func setupFormatSession(t *testing.T, files map[string]any, mainFile string) (*Session, SnapshotID, ProjectID) { - t.Helper() - projectSession, _ := projecttestutil.Setup(files) - t.Cleanup(projectSession.Close) - session := NewSession(projectSession, nil) - t.Cleanup(session.Close) - - ctx := context.Background() - snap, err := session.handleUpdateSnapshot(ctx, &UpdateSnapshotParams{ - OpenFiles: []DocumentIdentifier{{FileName: mainFile}}, - }) - assert.NilError(t, err) - proj, err := session.handleGetDefaultProjectForFile(ctx, &GetDefaultProjectForFileParams{ - Snapshot: snap.Snapshot, - File: DocumentIdentifier{FileName: mainFile}, - }) - assert.NilError(t, err) - assert.Assert(t, proj != nil, "file should resolve to a default project") - return session, snap.Snapshot, proj.Id -} - -func formatDiagnosticsParams(snapshot SnapshotID, project ProjectID, diagnostics []*DiagnosticResponse) *FormatDiagnosticsParams { - return &FormatDiagnosticsParams{ - Snapshot: snapshot, - Project: project, - Diagnostics: diagnostics, - NewLine: "\n", - } -} - -func TestFormatDiagnostics(t *testing.T) { - t.Parallel() - if !bundled.Embedded { - t.Skip("bundled files are not embedded") - } - - const fileName = "/home/projects/p/src/index.ts" - const content = "const x: number = \"oops\";\n" - session, snapshot, project := setupFormatSession(t, map[string]any{ - "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, - fileName: content, - }, fileName) - ctx := context.Background() - - diags, err := session.handleGetSemanticDiagnostics(ctx, &GetDiagnosticsParams{ - Snapshot: snapshot, - Project: project, - Files: []DocumentIdentifier{{FileName: fileName}}, - }) - assert.NilError(t, err) - assert.Equal(t, len(diags), 1) - - plain, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), false /*colorAndContext*/) - assert.NilError(t, err) - assert.Equal(t, plain.Output, - "home/projects/p/src/index.ts(1,7): error TS2322: Type 'string' is not assignable to type 'number'.\n") - - color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), true /*colorAndContext*/) - assert.NilError(t, err) - assert.Assert(t, strings.Contains(color.Output, "home/projects/p/src/index.ts")) - assert.Assert(t, strings.Contains(color.Output, "error")) - assert.Assert(t, strings.Contains(color.Output, "TS2322: ")) - assert.Assert(t, strings.Contains(color.Output, "Type 'string' is not assignable to type 'number'.")) - assert.Assert(t, strings.Contains(color.Output, "const x: number = \"oops\";")) - assert.Assert(t, strings.Contains(color.Output, "~")) - assert.Assert(t, strings.Contains(color.Output, "\x1b[")) -} - -func TestFormatDiagnosticsPreservesHostFormattedAbsolutePath(t *testing.T) { - t.Parallel() - if !bundled.Embedded { - t.Skip("bundled files are not embedded") - } - - const fileName = "/home/projects/p/src/index.ts" - session, snapshot, project := setupFormatSession(t, map[string]any{ - "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, - fileName: `const x: number = "oops";`, - }, fileName) - ctx := context.Background() - - diags, err := session.handleGetSemanticDiagnostics(ctx, &GetDiagnosticsParams{ - Snapshot: snapshot, - Project: project, - Files: []DocumentIdentifier{{FileName: fileName}}, - }) - assert.NilError(t, err) - assert.Equal(t, len(diags), 1) - diags[0].DisplayFileName = "/different/root/index.ts" - - params := formatDiagnosticsParams(snapshot, project, diags) - plain, err := session.handleFormatDiagnostics(ctx, params, false) - assert.NilError(t, err) - assert.Assert(t, strings.HasPrefix(plain.Output, "/different/root/index.ts(1,7): ")) - - color, err := session.handleFormatDiagnostics(ctx, params, true) - assert.NilError(t, err) - assert.Assert(t, strings.Contains(color.Output, "\x1b[96m/different/root/index.ts\x1b[0m:")) -} - -func TestFormatDiagnosticsConfigFileContext(t *testing.T) { - t.Parallel() - if !bundled.Embedded { - t.Skip("bundled files are not embedded") - } - - const configFileName = "/home/projects/p/tsconfig.json" - const config = "{ \"compilerOptions\": { \"target\": \"invalid\" } }" - const mainFile = "/home/projects/p/src/index.ts" - session, snapshot, project := setupFormatSession(t, map[string]any{ - configFileName: config, - mainFile: "export const x = 1;\n", - }, mainFile) - ctx := context.Background() - - diags, err := session.handleGetConfigFileParsingDiagnostics(ctx, &GetProjectDiagnosticsParams{ - Snapshot: snapshot, Project: project, - }) - assert.NilError(t, err) - assert.Equal(t, len(diags), 1) - assert.Equal(t, diags[0].FileName, configFileName) - - plain, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), false) - assert.NilError(t, err) - assert.Assert(t, strings.HasPrefix(plain.Output, "home/projects/p/tsconfig.json(1,34): error TS6046: ")) - - color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), true) - assert.NilError(t, err) - assert.Assert(t, strings.Contains(color.Output, "\"target\": \"invalid\"")) - assert.Assert(t, strings.Contains(color.Output, "~~~~~~~~~")) -} - -func TestFormatDiagnosticsWithoutFile(t *testing.T) { - t.Parallel() - if !bundled.Embedded { - t.Skip("bundled files are not embedded") - } - - const fileName = "/home/projects/p/src/index.ts" - session, snapshot, project := setupFormatSession(t, map[string]any{ - "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, - fileName: "export const x = 1;\n", - }, fileName) - ctx := context.Background() - - fileless := []*DiagnosticResponse{{ - Code: 1234, - Category: diagnostics.CategoryError, - Text: "Some global problem.", - RelatedInformation: []*DiagnosticResponse{{ - Code: 5678, - Category: diagnostics.CategoryMessage, - Text: "Additional context.", - }}, - }} - - plain, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, fileless), false) - assert.NilError(t, err) - assert.Equal(t, plain.Output, "error TS1234: Some global problem.\n") - - color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, fileless), true) - assert.NilError(t, err) - assert.Equal(t, color.Output, - "\x1b[91merror\x1b[0m\x1b[90m TS1234: \x1b[0mSome global problem.\n\n Additional context.\n") -} - -func TestFormatDiagnosticsAllowsUnhashedDiagnosticsAndClampsOutOfRangePositions(t *testing.T) { - t.Parallel() - if !bundled.Embedded { - t.Skip("bundled files are not embedded") - } - - const fileName = "/home/projects/p/src/index.ts" - session, snapshot, project := setupFormatSession(t, map[string]any{ - "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, - fileName: "export const x = 1;\n", - }, fileName) - ctx := context.Background() - - stale := []*DiagnosticResponse{{ - FileName: fileName, - Pos: 100_000, - End: 200_000, - Code: 1234, - Category: diagnostics.CategoryError, - Text: "Manually constructed diagnostic.", - }} - - plain, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, stale), false) - assert.NilError(t, err) - assert.Equal(t, plain.Output, - "home/projects/p/src/index.ts(2,1): error TS1234: Manually constructed diagnostic.\n") - - color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, stale), true) - assert.NilError(t, err) - assert.Assert(t, strings.Contains(color.Output, "TS1234: ")) - assert.Assert(t, strings.Contains(color.Output, "Manually constructed diagnostic.")) -} - -func TestFormatDiagnosticsRejectsStaleOrMissingSources(t *testing.T) { - t.Parallel() - if !bundled.Embedded { - t.Skip("bundled files are not embedded") - } - - const fileName = "/home/projects/p/src/index.ts" - session, snapshot, project := setupFormatSession(t, map[string]any{ - "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, - fileName: "export const x = 1;\n", - }, fileName) - ctx := context.Background() - - stale := formatDiagnosticsParams(snapshot, project, []*DiagnosticResponse{{ - FileName: fileName, - SourceFileHash: sourceFileHashForText("different content"), - Code: 1234, - Category: diagnostics.CategoryError, - Text: "Stale diagnostic.", - }}) - _, err := session.handleFormatDiagnostics(ctx, stale, false) - assert.ErrorContains(t, err, "diagnostic source file content has changed") - - missing := formatDiagnosticsParams(snapshot, project, []*DiagnosticResponse{{ - FileName: "/home/projects/p/src/missing.ts", - Code: 1234, - Category: diagnostics.CategoryError, - Text: "Missing source.", - }}) - _, err = session.handleFormatDiagnostics(ctx, missing, false) - assert.ErrorContains(t, err, "diagnostic source file not found") -} - -func TestFormatDiagnosticsNonASCIIPositions(t *testing.T) { - t.Parallel() - if !bundled.Embedded { - t.Skip("bundled files are not embedded") - } - - const fileName = "/home/projects/p/src/index.ts" - // "é" is 2 UTF-8 bytes and 1 UTF-16 code unit. - const content = "const café = 1;\nconst x: number = \"oops\";\n" - session, snapshot, project := setupFormatSession(t, map[string]any{ - "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, - fileName: content, - }, fileName) - ctx := context.Background() - - diags, err := session.handleGetSemanticDiagnostics(ctx, &GetDiagnosticsParams{ - Snapshot: snapshot, Project: project, Files: []DocumentIdentifier{{FileName: fileName}}, - }) - assert.NilError(t, err) - assert.Equal(t, len(diags), 1) - - plain, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), false) - assert.NilError(t, err) - assert.Equal(t, plain.Output, - "home/projects/p/src/index.ts(2,7): error TS2322: Type 'string' is not assignable to type 'number'.\n") - - color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), true) - assert.NilError(t, err) - assert.Assert(t, strings.Contains(color.Output, "const x: number = \"oops\";")) - assert.Assert(t, strings.Contains(color.Output, "~")) -} - -func TestFormatDiagnosticsAstralPositions(t *testing.T) { - t.Parallel() - if !bundled.Embedded { - t.Skip("bundled files are not embedded") - } - - const fileName = "/home/projects/p/src/index.ts" - // "😀" is 4 UTF-8 bytes and 2 UTF-16 code units. - const content = "const emoji = \"😀\";\nconst x: number = \"oops\";\n" - session, snapshot, project := setupFormatSession(t, map[string]any{ - "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, - fileName: content, - }, fileName) - ctx := context.Background() - - diags, err := session.handleGetSemanticDiagnostics(ctx, &GetDiagnosticsParams{ - Snapshot: snapshot, Project: project, Files: []DocumentIdentifier{{FileName: fileName}}, - }) - assert.NilError(t, err) - assert.Equal(t, len(diags), 1) - - plain, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), false) - assert.NilError(t, err) - assert.Equal(t, plain.Output, - "home/projects/p/src/index.ts(2,7): error TS2322: Type 'string' is not assignable to type 'number'.\n") - - color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), true) - assert.NilError(t, err) - assert.Assert(t, strings.Contains(color.Output, "const x: number = \"oops\";")) - assert.Assert(t, strings.Contains(color.Output, "~")) -} - -func TestFormatDiagnosticsMessageChainAndRelatedInformation(t *testing.T) { - t.Parallel() - if !bundled.Embedded { - t.Skip("bundled files are not embedded") - } - - const fileName = "/home/projects/p/src/index.ts" - const content = "interface Props { callback: (x: string) => void }\nconst p: Props = { callback: (x: number) => {} };\n" - session, snapshot, project := setupFormatSession(t, map[string]any{ - "/home/projects/p/tsconfig.json": `{ "compilerOptions": { "strict": true } }`, - fileName: content, - }, fileName) - ctx := context.Background() - - diags, err := session.handleGetSemanticDiagnostics(ctx, &GetDiagnosticsParams{ - Snapshot: snapshot, Project: project, Files: []DocumentIdentifier{{FileName: fileName}}, - }) - assert.NilError(t, err) - assert.Equal(t, len(diags), 1) - assert.Assert(t, len(diags[0].MessageChain) > 0, "expected a message chain") - assert.Assert(t, len(diags[0].RelatedInformation) > 0, "expected related information") - - color, err := session.handleFormatDiagnostics(ctx, formatDiagnosticsParams(snapshot, project, diags), true) - assert.NilError(t, err) - assert.Assert(t, strings.Contains(color.Output, "is not assignable to type")) - assert.Assert(t, strings.Contains(color.Output, "Types of parameters 'x' and 'x' are incompatible.")) - assert.Assert(t, strings.Contains(color.Output, "The expected type comes from property 'callback'")) -} diff --git a/tsc/internal/diagnosticwriter/diagnosticwriter.go b/tsc/internal/diagnosticwriter/diagnosticwriter.go index 7abd29ad063c7..b4d00fafa2835 100644 --- a/tsc/internal/diagnosticwriter/diagnosticwriter.go +++ b/tsc/internal/diagnosticwriter/diagnosticwriter.go @@ -245,48 +245,6 @@ func FormatDiagnosticWithColorAndContext(output io.Writer, diagnostic Diagnostic } } -func FormatDiagnosticsWithColorAndContextForAPI(output io.Writer, diags []Diagnostic, formatOpts *FormattingOptions) { - for _, diagnostic := range diags { - formatDiagnosticWithColorAndContextForAPI(output, diagnostic, formatOpts) - } -} - -func formatDiagnosticWithColorAndContextForAPI(output io.Writer, diagnostic Diagnostic, formatOpts *FormattingOptions) { - if diagnostic.File() != nil { - file := diagnostic.File() - pos := diagnostic.Pos() - WriteLocation(output, file, pos, formatOpts, writeWithStyleAndReset) - fmt.Fprint(output, " - ") - } - - writeWithStyleAndReset(output, diagnostic.Category().Name(), getCategoryFormat(diagnostic.Category())) - fmt.Fprintf(output, "%s %s%d: %s", foregroundColorEscapeGrey, diagnosticPrefix(diagnostic), diagnostic.Code(), resetEscapeSequence) - WriteFlattenedDiagnosticMessage(output, diagnostic, formatOpts.NewLine, formatOpts.Locale) - - if diagnostic.File() != nil && diagnostic.Code() != diagnostics.File_appears_to_be_binary.Code() { - fmt.Fprint(output, formatOpts.NewLine) - writeCodeSnippet(output, diagnostic.File(), diagnostic.Pos(), diagnostic.Len(), getCategoryFormat(diagnostic.Category()), "", formatOpts) - } - - if len(diagnostic.RelatedInformation()) > 0 { - fmt.Fprint(output, formatOpts.NewLine) - for _, relatedInformation := range diagnostic.RelatedInformation() { - file := relatedInformation.File() - if file != nil { - fmt.Fprint(output, formatOpts.NewLine) - fmt.Fprint(output, " ") - pos := relatedInformation.Pos() - WriteLocation(output, file, pos, formatOpts, writeWithStyleAndReset) - writeCodeSnippet(output, file, pos, relatedInformation.Len(), foregroundColorEscapeCyan, " ", formatOpts) - } - fmt.Fprint(output, formatOpts.NewLine) - fmt.Fprint(output, " ") - WriteFlattenedDiagnosticMessage(output, relatedInformation, formatOpts.NewLine, formatOpts.Locale) - } - } - fmt.Fprint(output, formatOpts.NewLine) -} - func writeCodeSnippet(writer io.Writer, sourceFile FileLike, start int, length int, squiggleColor string, indent string, formatOpts *FormattingOptions) { firstLine, firstLineChar := scanner.GetECMALineAndUTF16CharacterOfPosition(sourceFile, start) lastLine, lastLineChar := scanner.GetECMALineAndUTF16CharacterOfPosition(sourceFile, start+length) diff --git a/tsc/internal/tsoptions/tsconfigparsing.go b/tsc/internal/tsoptions/tsconfigparsing.go index 32e89b5070a5b..6f4db55f300fe 100644 --- a/tsc/internal/tsoptions/tsconfigparsing.go +++ b/tsc/internal/tsoptions/tsconfigparsing.go @@ -21,7 +21,6 @@ import ( "github.com/microsoft/TypeScript/tsc/internal/tspath" "github.com/microsoft/TypeScript/tsc/internal/vfs" "github.com/microsoft/TypeScript/tsc/internal/vfs/vfsmatch" - "github.com/zeebo/xxh3" ) type extendsResult struct { @@ -299,7 +298,6 @@ func NewTsconfigSourceFileFromFilePath(configFileName string, configPath tspath. FileName: configFileName, Path: configPath, }, configSourceText, core.ScriptKindJSON) - sourceFile.Hash = xxh3.Hash128([]byte(configSourceText)) return &TsConfigSourceFile{ SourceFile: sourceFile, }