From 9faefe565111de4c590ac55cbc12e44e457f77ae Mon Sep 17 00:00:00 2001 From: zhengbli Date: Fri, 28 Oct 2016 17:45:48 -0700 Subject: [PATCH 1/6] Add diagnostics for certain external project --- src/compiler/diagnosticMessages.json | 4 ++++ src/server/project.ts | 5 +++++ src/server/session.ts | 19 ++++++++++++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 526019e490834..4feac49f6968b 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1963,6 +1963,10 @@ "category": "Error", "code": 2696 }, + "Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig": { + "category": "Error", + "code": 2697 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/src/server/project.ts b/src/server/project.ts index 5f4f8d4049027..574122090b210 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -48,6 +48,11 @@ namespace ts.server { return counts.js > 0 && counts.ts === 0 && counts.tsx === 0; } + export function hasBothJsAndTsFiles(project: Project) { + const counts = countEachFileTypes(project.getRootScriptInfos()); + return (counts.js + counts.jsx > 0) && (counts.ts + counts.tsx > 0); + } + export function allRootFilesAreJsOrDts(project: Project): boolean { const counts = countEachFileTypes(project.getRootScriptInfos()); return counts.ts === 0 && counts.tsx === 0; diff --git a/src/server/session.ts b/src/server/session.ts index 545701f1449fa..9a7f51a6b7bc7 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -374,7 +374,24 @@ namespace ts.server { private getCompilerOptionsDiagnostics(args: protocol.CompilerOptionsDiagnosticsRequestArgs) { const project = this.getProject(args.projectFileName); - return this.convertToDiagnosticsWithLinePosition(project.getLanguageService().getCompilerOptionsDiagnostics(), /*scriptInfo*/ undefined); + let diagnostics = this.convertToDiagnosticsWithLinePosition(project.getLanguageService().getCompilerOptionsDiagnostics(), /*scriptInfo*/ undefined); + + if (this.shouldAddTsconfigSuggestionMessage(project)) { + const tsconfigDiag = createCompilerDiagnostic(Diagnostics.Adding_a_tsconfig_json_file_will_help_organizing_projects_with_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); + diagnostics = concatenate(diagnostics, this.convertToDiagnosticsWithLinePosition([tsconfigDiag], /*scriptInfo*/ undefined)); + } + + return diagnostics; + } + + private shouldAddTsconfigSuggestionMessage(project: Project) { + if (project.projectKind === ProjectKind.External && hasBothJsAndTsFiles(project)) { + const options = project.getCompilerOptions(); + if (options && !options.noEmit && !options.outDir && !options.outFile) { + return true; + } + } + return false; } private convertToDiagnosticsWithLinePosition(diagnostics: Diagnostic[], scriptInfo: ScriptInfo) { From 5a8e53f2f67b58c41d58c2346446991725eb014b Mon Sep 17 00:00:00 2001 From: Zhengbo Li Date: Mon, 31 Oct 2016 15:18:47 -0700 Subject: [PATCH 2/6] Show tsconfig suggestion --- src/compiler/core.ts | 12 ++++++++ src/compiler/diagnosticMessages.json | 8 ++--- src/compiler/program.ts | 29 ++++++++++++------- src/harness/fourslash.ts | 14 ++++++++- src/server/project.ts | 5 ---- src/server/session.ts | 15 ---------- ...sWhenEmitBlockingErrorOnOtherFile.baseline | 3 +- .../declarationFileOverwriteError.errors.txt | 2 ++ ...rationFileOverwriteErrorWithOut.errors.txt | 2 ++ .../exportDefaultInJsFile01.errors.txt | 2 ++ .../exportDefaultInJsFile02.errors.txt | 2 ++ ...tionAmbientVarDeclarationSyntax.errors.txt | 2 ++ ...CompilationEmitBlockedCorrectly.errors.txt | 2 ++ .../jsFileCompilationEnumSyntax.errors.txt | 2 ++ ...onsWithJsFileReferenceWithNoOut.errors.txt | 2 ++ ...mpilationExportAssignmentSyntax.errors.txt | 2 ++ ...tionHeritageClauseSyntaxOfClass.errors.txt | 2 ++ ...leCompilationImportEqualsSyntax.errors.txt | 2 ++ ...sFileCompilationInterfaceSyntax.errors.txt | 2 ++ .../jsFileCompilationModuleSyntax.errors.txt | 2 ++ ...onsWithJsFileReferenceWithNoOut.errors.txt | 2 ++ ...ileCompilationOptionalParameter.errors.txt | 2 ++ ...lationPublicMethodSyntaxOfClass.errors.txt | 2 ++ ...pilationPublicParameterModifier.errors.txt | 2 ++ ...ationReturnTypeSyntaxOfFunction.errors.txt | 2 ++ .../jsFileCompilationSyntaxError.errors.txt | 2 ++ ...sFileCompilationTypeAliasSyntax.errors.txt | 2 ++ ...ilationTypeArgumentSyntaxOfCall.errors.txt | 2 ++ ...jsFileCompilationTypeAssertions.errors.txt | 2 ++ ...sFileCompilationTypeOfParameter.errors.txt | 2 ++ ...ationTypeParameterSyntaxOfClass.errors.txt | 2 ++ ...onTypeParameterSyntaxOfFunction.errors.txt | 2 ++ ...sFileCompilationTypeSyntaxOfVar.errors.txt | 2 ++ ...hDeclarationEmitPathSameAsInput.errors.txt | 2 ++ ...lationWithJsEmitPathSameAsInput.errors.txt | 2 ++ ...sFileCompilationWithMapFileAsJs.errors.txt | 2 ++ ...hMapFileAsJsWithInlineSourceMap.errors.txt | 2 ++ ...rationFileNameSameAsInputJsFile.errors.txt | 2 ++ ...ithOutFileNameSameAsInputJsFile.errors.txt | 2 ++ .../jsFileCompilationWithoutOut.errors.txt | 2 ++ ...eNameDtsNotSpecifiedWithAllowJs.errors.txt | 2 ++ ...eNameDtsNotSpecifiedWithAllowJs.errors.txt | 2 ++ 42 files changed, 120 insertions(+), 36 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index d8f8cff42a259..785933c44294a 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1063,6 +1063,18 @@ namespace ts { }; } + export function createCompilerDiagnosticFromMessageChain(chain: DiagnosticMessageChain): Diagnostic { + return { + file: undefined, + start: undefined, + length: undefined, + + code: chain.code, + category: chain.category, + messageText: chain.next ? chain : chain.messageText + }; + } + export function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage, ...args: any[]): DiagnosticMessageChain; export function chainDiagnosticMessages(details: DiagnosticMessageChain, message: DiagnosticMessage): DiagnosticMessageChain { let text = getLocaleSpecificMessage(message); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 4feac49f6968b..2cea539b50d17 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1963,10 +1963,6 @@ "category": "Error", "code": 2696 }, - "Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig": { - "category": "Error", - "code": 2697 - }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", @@ -3122,5 +3118,9 @@ "Implement inherited abstract class": { "category": "Message", "code": 90007 + }, + "Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig": { + "category": "Error", + "code": 90009 } } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index d7e4a4c2701d1..990a4cd17bbbf 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -239,11 +239,11 @@ namespace ts { const { line, character } = getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start); const fileName = diagnostic.file.fileName; const relativeFileName = convertToRelativePath(fileName, host.getCurrentDirectory(), fileName => host.getCanonicalFileName(fileName)); - output += `${ relativeFileName }(${ line + 1 },${ character + 1 }): `; + output += `${relativeFileName}(${line + 1},${character + 1}): `; } const category = DiagnosticCategory[diagnostic.category].toLowerCase(); - output += `${ category } TS${ diagnostic.code }: ${ flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) }${ host.getNewLine() }`; + output += `${category} TS${diagnostic.code}: ${flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())}${host.getNewLine()}`; } return output; } @@ -1316,11 +1316,11 @@ namespace ts { } else if (shouldAddFile) { findSourceFile(resolution.resolvedFileName, - toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), + toPath(resolution.resolvedFileName, currentDirectory, getCanonicalFileName), /*isDefaultLib*/ false, - file, - skipTrivia(file.text, file.imports[i].pos), - file.imports[i].end); + file, + skipTrivia(file.text, file.imports[i].pos), + file.imports[i].end); } if (isFromNodeModulesSearch) { @@ -1537,13 +1537,22 @@ namespace ts { const emitFilePath = toPath(emitFileName, currentDirectory, getCanonicalFileName); // Report error if the output overwrites input file if (filesByName.contains(emitFilePath)) { - createEmitBlockingDiagnostics(emitFileName, Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file); + let chain: DiagnosticMessageChain; + const options = program.getCompilerOptions(); + if (!options.configFilePath) { + // The program is from either inferred project or + chain = chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Adding_a_tsconfig_json_file_will_help_organizing_projects_with_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); + } + chain = chainDiagnosticMessages(chain, Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); + const diagnostic = createCompilerDiagnosticFromMessageChain(chain); + createEmitBlockingDiagnostics(emitFileName, diagnostic); } // Report error if multiple files write into same file if (emitFilesSeen.contains(emitFilePath)) { // Already seen the same emit file - report error - createEmitBlockingDiagnostics(emitFileName, Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files); + const diagnostic = createCompilerDiagnostic(Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files, emitFileName); + createEmitBlockingDiagnostics(emitFileName, diagnostic); } else { emitFilesSeen.set(emitFilePath, true); @@ -1552,9 +1561,9 @@ namespace ts { } } - function createEmitBlockingDiagnostics(emitFileName: string, message: DiagnosticMessage) { + function createEmitBlockingDiagnostics(emitFileName: string, diag: Diagnostic) { hasEmitBlockingDiagnostics.set(toPath(emitFileName, currentDirectory, getCanonicalFileName), true); - programDiagnostics.add(createCompilerDiagnostic(message, emitFileName)); + programDiagnostics.add(diag); } } } diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index e9fa5d6be2e80..d8ae44f6485d3 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1274,7 +1274,19 @@ namespace FourSlash { resultString += "Diagnostics:" + Harness.IO.newLine(); const diagnostics = ts.getPreEmitDiagnostics(this.languageService.getProgram()); for (let i = 0, n = diagnostics.length; i < n; i++) { - resultString += " " + diagnostics[0].messageText + Harness.IO.newLine(); + const diagnostic = diagnostics[i]; + if (typeof diagnostic.messageText !== "string") { + let chainedMessage = diagnostic.messageText; + let indentation = " "; + while (chainedMessage) { + resultString += indentation + chainedMessage.messageText + Harness.IO.newLine(); + chainedMessage = chainedMessage.next; + indentation = indentation + " "; + } + } + else { + resultString += " " + diagnostic.messageText + Harness.IO.newLine(); + } } } diff --git a/src/server/project.ts b/src/server/project.ts index 574122090b210..5f4f8d4049027 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -48,11 +48,6 @@ namespace ts.server { return counts.js > 0 && counts.ts === 0 && counts.tsx === 0; } - export function hasBothJsAndTsFiles(project: Project) { - const counts = countEachFileTypes(project.getRootScriptInfos()); - return (counts.js + counts.jsx > 0) && (counts.ts + counts.tsx > 0); - } - export function allRootFilesAreJsOrDts(project: Project): boolean { const counts = countEachFileTypes(project.getRootScriptInfos()); return counts.ts === 0 && counts.tsx === 0; diff --git a/src/server/session.ts b/src/server/session.ts index 9a7f51a6b7bc7..602decd0958c0 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -376,24 +376,9 @@ namespace ts.server { const project = this.getProject(args.projectFileName); let diagnostics = this.convertToDiagnosticsWithLinePosition(project.getLanguageService().getCompilerOptionsDiagnostics(), /*scriptInfo*/ undefined); - if (this.shouldAddTsconfigSuggestionMessage(project)) { - const tsconfigDiag = createCompilerDiagnostic(Diagnostics.Adding_a_tsconfig_json_file_will_help_organizing_projects_with_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); - diagnostics = concatenate(diagnostics, this.convertToDiagnosticsWithLinePosition([tsconfigDiag], /*scriptInfo*/ undefined)); - } - return diagnostics; } - private shouldAddTsconfigSuggestionMessage(project: Project) { - if (project.projectKind === ProjectKind.External && hasBothJsAndTsFiles(project)) { - const options = project.getCompilerOptions(); - if (options && !options.noEmit && !options.outDir && !options.outFile) { - return true; - } - } - return false; - } - private convertToDiagnosticsWithLinePosition(diagnostics: Diagnostic[], scriptInfo: ScriptInfo) { return diagnostics.map(d => { message: flattenDiagnosticMessageText(d.messageText, this.host.newLine), diff --git a/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline b/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline index a088006d1450e..76503a42cbb34 100644 --- a/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline +++ b/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline @@ -1,6 +1,7 @@ EmitSkipped: true Diagnostics: - Cannot write file '/tests/cases/fourslash/b.js' because it would overwrite input file. + Cannot write file '/tests/cases/fourslash/b.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig EmitSkipped: false FileName : /tests/cases/fourslash/a.js diff --git a/tests/baselines/reference/declarationFileOverwriteError.errors.txt b/tests/baselines/reference/declarationFileOverwriteError.errors.txt index 1974976dee1fe..c585faff983d4 100644 --- a/tests/baselines/reference/declarationFileOverwriteError.errors.txt +++ b/tests/baselines/reference/declarationFileOverwriteError.errors.txt @@ -1,7 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.d.ts (0 errors) ==== declare class c { diff --git a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt index 658465de9c2d2..82875698dfb8f 100644 --- a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt +++ b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt @@ -1,7 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/out.d.ts (0 errors) ==== declare class c { diff --git a/tests/baselines/reference/exportDefaultInJsFile01.errors.txt b/tests/baselines/reference/exportDefaultInJsFile01.errors.txt index 34035e1e14e73..8ea14f9cb31da 100644 --- a/tests/baselines/reference/exportDefaultInJsFile01.errors.txt +++ b/tests/baselines/reference/exportDefaultInJsFile01.errors.txt @@ -1,7 +1,9 @@ error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile01.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile01.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/conformance/salsa/myFile01.js (0 errors) ==== export default "hello"; \ No newline at end of file diff --git a/tests/baselines/reference/exportDefaultInJsFile02.errors.txt b/tests/baselines/reference/exportDefaultInJsFile02.errors.txt index 5e17306e066f5..35e7e215b47a4 100644 --- a/tests/baselines/reference/exportDefaultInJsFile02.errors.txt +++ b/tests/baselines/reference/exportDefaultInJsFile02.errors.txt @@ -1,7 +1,9 @@ error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile02.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile02.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/conformance/salsa/myFile02.js (0 errors) ==== export default "hello"; \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt index 19bfd5d1c0205..33999e7d536ab 100644 --- a/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,1): error TS8009: 'declare' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== declare var v; ~~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt b/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt index 0aa9d5733d532..144f7572fa023 100644 --- a/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt +++ b/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files. ==== tests/cases/compiler/a.ts (0 errors) ==== class c { diff --git a/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt index 538dfb38972bc..0ec52958d0f68 100644 --- a/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,6): error TS8015: 'enum declarations' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== enum E { } ~ diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt index 641731936f84a..e3756752e3936 100644 --- a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt +++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt @@ -1,9 +1,11 @@ error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. !!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt index f537941c55cf1..048d59eae9baa 100644 --- a/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,1): error TS8003: 'export=' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== export = b; ~~~~~~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt b/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt index 33b8a45f1aab0..b9e1daf66fc06 100644 --- a/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt +++ b/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,9): error TS8005: 'implements clauses' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== class C implements D { } ~~~~~~~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt index b416136703755..d37f39555fed3 100644 --- a/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,1): error TS8002: 'import ... =' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== import a = b; ~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt index 17fb8fcb18741..fcce925133058 100644 --- a/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,11): error TS8006: 'interface declarations' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== interface I { } ~ diff --git a/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt index 662028c53ed93..c68082b6855ce 100644 --- a/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,8): error TS8007: 'module declarations' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== module M { } ~ diff --git a/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt index f2f4142b99380..2b936acd4e207 100644 --- a/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt +++ b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt @@ -1,7 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt b/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt index 295f827dd2d7c..2a84b40c9ede7 100644 --- a/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt +++ b/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,13): error TS8009: '?' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== function F(p?) { } ~ diff --git a/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt b/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt index d67c9baea70e5..7debd544a60da 100644 --- a/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt +++ b/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(2,5): error TS8009: 'public' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== class C { public foo() { diff --git a/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt b/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt index bc4913f6217b4..c30e64c75f875 100644 --- a/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt +++ b/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,23): error TS8012: 'parameter modifiers' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== class C { constructor(public x) { }} ~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt b/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt index 6dad5a294854c..e45fe5e02cf95 100644 --- a/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt +++ b/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,15): error TS8010: 'types' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== function F(): number { } ~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt b/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt index d98a1e7e7bbc8..d1a046728d208 100644 --- a/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt +++ b/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt @@ -1,7 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (0 errors) ==== /** * @type {number} diff --git a/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt index 2b5112e1ce2ed..250707970466c 100644 --- a/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,6): error TS8008: 'type aliases' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== type a = b; ~ diff --git a/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt b/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt index 8ac59196ed960..ed8a0dd97330e 100644 --- a/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,5): error TS8011: 'type arguments' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== Foo(); ~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt b/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt index 662eea4d4050c..1a00c04ee00f7 100644 --- a/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt @@ -1,9 +1,11 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,10): error TS17008: JSX element 'string' has no corresponding closing tag. tests/cases/compiler/a.js(1,27): error TS1005: 'undefined; ~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt b/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt index 680b32a64f1ad..d7300c7ffc521 100644 --- a/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,15): error TS8010: 'types' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== function F(a: number) { } ~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt index 161c832ffd5d4..624b721fc01ff 100644 --- a/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,9): error TS8004: 'type parameter declarations' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== class C { } ~ diff --git a/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt index d7626f68564cf..bebe2cf4f005f 100644 --- a/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,12): error TS8004: 'type parameter declarations' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== function F() { } ~ diff --git a/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt b/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt index 2c6ac3771bef8..a756b880a34a8 100644 --- a/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,8): error TS8010: 'types' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== var v: () => number; ~~~~~~~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt b/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt index 9e9c2adb0efa2..f12dfd2279a37 100644 --- a/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt @@ -1,7 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt b/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt index 4cc2cc2ab4547..d611bbc3b2480 100644 --- a/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files. ==== tests/cases/compiler/a.ts (0 errors) ==== class c { diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt b/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt index 06186b9f0b2fc..47590514fae42 100644 --- a/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'. !!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'. ==== tests/cases/compiler/a.ts (0 errors) ==== diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt index 06186b9f0b2fc..47590514fae42 100644 --- a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt @@ -1,8 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'. !!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'. ==== tests/cases/compiler/a.ts (0 errors) ==== diff --git a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt index 10c7b8c90ddad..72095f7501cf7 100644 --- a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt @@ -1,7 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt b/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt index 0f6852b21a0a2..cada35ab4a19f 100644 --- a/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt @@ -1,7 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt b/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt index 0f6852b21a0a2..cada35ab4a19f 100644 --- a/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt @@ -1,7 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt index ac25edc1bd565..7a33822e4faa2 100644 --- a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt @@ -1,9 +1,11 @@ error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. !!! error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== SameNameDTsNotSpecifiedWithAllowJs/a.d.ts (0 errors) ==== declare var a: number; ==== SameNameDTsNotSpecifiedWithAllowJs/a.js (0 errors) ==== diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt index ac25edc1bd565..7a33822e4faa2 100644 --- a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt @@ -1,9 +1,11 @@ error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file. + Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. !!! error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file. +!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== SameNameDTsNotSpecifiedWithAllowJs/a.d.ts (0 errors) ==== declare var a: number; ==== SameNameDTsNotSpecifiedWithAllowJs/a.js (0 errors) ==== From c5c9e5be89d55d8adc88260182c6ebaac632a41f Mon Sep 17 00:00:00 2001 From: Zhengbo Li Date: Mon, 31 Oct 2016 15:49:27 -0700 Subject: [PATCH 3/6] fix lint error --- src/harness/fourslash.ts | 2 +- src/server/session.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index d8ae44f6485d3..adff02f48fb24 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1278,7 +1278,7 @@ namespace FourSlash { if (typeof diagnostic.messageText !== "string") { let chainedMessage = diagnostic.messageText; let indentation = " "; - while (chainedMessage) { + while (chainedMessage) { resultString += indentation + chainedMessage.messageText + Harness.IO.newLine(); chainedMessage = chainedMessage.next; indentation = indentation + " "; diff --git a/src/server/session.ts b/src/server/session.ts index 602decd0958c0..27b949f8f5192 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -374,7 +374,7 @@ namespace ts.server { private getCompilerOptionsDiagnostics(args: protocol.CompilerOptionsDiagnosticsRequestArgs) { const project = this.getProject(args.projectFileName); - let diagnostics = this.convertToDiagnosticsWithLinePosition(project.getLanguageService().getCompilerOptionsDiagnostics(), /*scriptInfo*/ undefined); + const diagnostics = this.convertToDiagnosticsWithLinePosition(project.getLanguageService().getCompilerOptionsDiagnostics(), /*scriptInfo*/ undefined); return diagnostics; } From da5c41d27114ea28c2f3ba7ea1b67146631040b9 Mon Sep 17 00:00:00 2001 From: zhengbli Date: Mon, 31 Oct 2016 16:07:28 -0700 Subject: [PATCH 4/6] Address pr --- src/compiler/program.ts | 1 - src/server/session.ts | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 990a4cd17bbbf..4bc8309f44cdd 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1538,7 +1538,6 @@ namespace ts { // Report error if the output overwrites input file if (filesByName.contains(emitFilePath)) { let chain: DiagnosticMessageChain; - const options = program.getCompilerOptions(); if (!options.configFilePath) { // The program is from either inferred project or chain = chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Adding_a_tsconfig_json_file_will_help_organizing_projects_with_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); diff --git a/src/server/session.ts b/src/server/session.ts index 27b949f8f5192..545701f1449fa 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -374,9 +374,7 @@ namespace ts.server { private getCompilerOptionsDiagnostics(args: protocol.CompilerOptionsDiagnosticsRequestArgs) { const project = this.getProject(args.projectFileName); - const diagnostics = this.convertToDiagnosticsWithLinePosition(project.getLanguageService().getCompilerOptionsDiagnostics(), /*scriptInfo*/ undefined); - - return diagnostics; + return this.convertToDiagnosticsWithLinePosition(project.getLanguageService().getCompilerOptionsDiagnostics(), /*scriptInfo*/ undefined); } private convertToDiagnosticsWithLinePosition(diagnostics: Diagnostic[], scriptInfo: ScriptInfo) { From 36b60dc21702de2c12bf35995504e6e7b3336974 Mon Sep 17 00:00:00 2001 From: Zhengbo Li Date: Mon, 31 Oct 2016 16:37:09 -0700 Subject: [PATCH 5/6] fix comment --- src/compiler/program.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 4bc8309f44cdd..f595f0d70a692 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1539,7 +1539,7 @@ namespace ts { if (filesByName.contains(emitFilePath)) { let chain: DiagnosticMessageChain; if (!options.configFilePath) { - // The program is from either inferred project or + // The program is from either an inferred project or an external project chain = chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Adding_a_tsconfig_json_file_will_help_organizing_projects_with_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); } chain = chainDiagnosticMessages(chain, Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); From c688852d124de94419b4e2bcd4ffe353346dad4a Mon Sep 17 00:00:00 2001 From: zhengbli Date: Tue, 1 Nov 2016 11:38:49 -0700 Subject: [PATCH 6/6] Update error message --- src/compiler/diagnosticMessages.json | 2 +- src/compiler/program.ts | 2 +- ...ompileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline | 2 +- .../reference/declarationFileOverwriteError.errors.txt | 4 ++-- .../reference/declarationFileOverwriteErrorWithOut.errors.txt | 4 ++-- tests/baselines/reference/exportDefaultInJsFile01.errors.txt | 4 ++-- tests/baselines/reference/exportDefaultInJsFile02.errors.txt | 4 ++-- .../jsFileCompilationAmbientVarDeclarationSyntax.errors.txt | 4 ++-- .../jsFileCompilationEmitBlockedCorrectly.errors.txt | 4 ++-- .../reference/jsFileCompilationEnumSyntax.errors.txt | 4 ++-- ...ErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt | 4 ++-- .../jsFileCompilationExportAssignmentSyntax.errors.txt | 4 ++-- .../jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt | 4 ++-- .../reference/jsFileCompilationImportEqualsSyntax.errors.txt | 4 ++-- .../reference/jsFileCompilationInterfaceSyntax.errors.txt | 4 ++-- .../reference/jsFileCompilationModuleSyntax.errors.txt | 4 ++-- ...WithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt | 4 ++-- .../reference/jsFileCompilationOptionalParameter.errors.txt | 4 ++-- .../jsFileCompilationPublicMethodSyntaxOfClass.errors.txt | 4 ++-- .../jsFileCompilationPublicParameterModifier.errors.txt | 4 ++-- .../jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt | 4 ++-- .../reference/jsFileCompilationSyntaxError.errors.txt | 4 ++-- .../reference/jsFileCompilationTypeAliasSyntax.errors.txt | 4 ++-- .../jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt | 4 ++-- .../reference/jsFileCompilationTypeAssertions.errors.txt | 4 ++-- .../reference/jsFileCompilationTypeOfParameter.errors.txt | 4 ++-- .../jsFileCompilationTypeParameterSyntaxOfClass.errors.txt | 4 ++-- .../jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt | 4 ++-- .../reference/jsFileCompilationTypeSyntaxOfVar.errors.txt | 4 ++-- ...leCompilationWithDeclarationEmitPathSameAsInput.errors.txt | 4 ++-- .../jsFileCompilationWithJsEmitPathSameAsInput.errors.txt | 4 ++-- .../reference/jsFileCompilationWithMapFileAsJs.errors.txt | 4 ++-- ...leCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt | 4 ++-- ...tionWithOutDeclarationFileNameSameAsInputJsFile.errors.txt | 4 ++-- ...FileCompilationWithOutFileNameSameAsInputJsFile.errors.txt | 4 ++-- .../reference/jsFileCompilationWithoutOut.errors.txt | 4 ++-- ...leCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt | 4 ++-- ...leCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt | 4 ++-- 38 files changed, 73 insertions(+), 73 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 2cea539b50d17..184cd8e413e2e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3119,7 +3119,7 @@ "category": "Message", "code": 90007 }, - "Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig": { + "Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig": { "category": "Error", "code": 90009 } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index f595f0d70a692..c9f3de0f3d7fa 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1540,7 +1540,7 @@ namespace ts { let chain: DiagnosticMessageChain; if (!options.configFilePath) { // The program is from either an inferred project or an external project - chain = chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Adding_a_tsconfig_json_file_will_help_organizing_projects_with_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); + chain = chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig); } chain = chainDiagnosticMessages(chain, Diagnostics.Cannot_write_file_0_because_it_would_overwrite_input_file, emitFileName); const diagnostic = createCompilerDiagnosticFromMessageChain(chain); diff --git a/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline b/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline index 76503a42cbb34..f8b479e6d7b7b 100644 --- a/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline +++ b/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline @@ -1,7 +1,7 @@ EmitSkipped: true Diagnostics: Cannot write file '/tests/cases/fourslash/b.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig EmitSkipped: false FileName : /tests/cases/fourslash/a.js diff --git a/tests/baselines/reference/declarationFileOverwriteError.errors.txt b/tests/baselines/reference/declarationFileOverwriteError.errors.txt index c585faff983d4..211469778b1fe 100644 --- a/tests/baselines/reference/declarationFileOverwriteError.errors.txt +++ b/tests/baselines/reference/declarationFileOverwriteError.errors.txt @@ -1,9 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.d.ts (0 errors) ==== declare class c { diff --git a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt index 82875698dfb8f..ea4a93b3b12db 100644 --- a/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt +++ b/tests/baselines/reference/declarationFileOverwriteErrorWithOut.errors.txt @@ -1,9 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/out.d.ts' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/out.d.ts (0 errors) ==== declare class c { diff --git a/tests/baselines/reference/exportDefaultInJsFile01.errors.txt b/tests/baselines/reference/exportDefaultInJsFile01.errors.txt index 8ea14f9cb31da..0565c8bd61ef2 100644 --- a/tests/baselines/reference/exportDefaultInJsFile01.errors.txt +++ b/tests/baselines/reference/exportDefaultInJsFile01.errors.txt @@ -1,9 +1,9 @@ error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile01.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile01.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/conformance/salsa/myFile01.js (0 errors) ==== export default "hello"; \ No newline at end of file diff --git a/tests/baselines/reference/exportDefaultInJsFile02.errors.txt b/tests/baselines/reference/exportDefaultInJsFile02.errors.txt index 35e7e215b47a4..a74fbacfcfd87 100644 --- a/tests/baselines/reference/exportDefaultInJsFile02.errors.txt +++ b/tests/baselines/reference/exportDefaultInJsFile02.errors.txt @@ -1,9 +1,9 @@ error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile02.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/conformance/salsa/myFile02.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/conformance/salsa/myFile02.js (0 errors) ==== export default "hello"; \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt index 33999e7d536ab..039834ff702af 100644 --- a/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationAmbientVarDeclarationSyntax.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,1): error TS8009: 'declare' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== declare var v; ~~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt b/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt index 144f7572fa023..75bcf88b10a13 100644 --- a/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt +++ b/tests/baselines/reference/jsFileCompilationEmitBlockedCorrectly.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files. ==== tests/cases/compiler/a.ts (0 errors) ==== class c { diff --git a/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt index 0ec52958d0f68..c6da8931d5e3e 100644 --- a/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationEnumSyntax.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,6): error TS8015: 'enum declarations' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== enum E { } ~ diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt index e3756752e3936..54e91c5d1961e 100644 --- a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt +++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt @@ -1,11 +1,11 @@ error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. !!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt index 048d59eae9baa..babbeea800455 100644 --- a/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationExportAssignmentSyntax.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,1): error TS8003: 'export=' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== export = b; ~~~~~~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt b/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt index b9e1daf66fc06..3b30663308fa5 100644 --- a/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt +++ b/tests/baselines/reference/jsFileCompilationHeritageClauseSyntaxOfClass.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,9): error TS8005: 'implements clauses' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== class C implements D { } ~~~~~~~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt index d37f39555fed3..a064f53e92fa4 100644 --- a/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationImportEqualsSyntax.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,1): error TS8002: 'import ... =' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== import a = b; ~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt index fcce925133058..9e53438c732fd 100644 --- a/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationInterfaceSyntax.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,11): error TS8006: 'interface declarations' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== interface I { } ~ diff --git a/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt index c68082b6855ce..6952c0055c0ee 100644 --- a/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationModuleSyntax.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,8): error TS8007: 'module declarations' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== module M { } ~ diff --git a/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt index 2b936acd4e207..888310414f275 100644 --- a/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt +++ b/tests/baselines/reference/jsFileCompilationNoErrorWithoutDeclarationsWithJsFileReferenceWithNoOut.errors.txt @@ -1,9 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt b/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt index 2a84b40c9ede7..15bfe2281d96f 100644 --- a/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt +++ b/tests/baselines/reference/jsFileCompilationOptionalParameter.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,13): error TS8009: '?' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== function F(p?) { } ~ diff --git a/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt b/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt index 7debd544a60da..af95c13620559 100644 --- a/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt +++ b/tests/baselines/reference/jsFileCompilationPublicMethodSyntaxOfClass.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(2,5): error TS8009: 'public' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== class C { public foo() { diff --git a/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt b/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt index c30e64c75f875..9314e1da807aa 100644 --- a/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt +++ b/tests/baselines/reference/jsFileCompilationPublicParameterModifier.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,23): error TS8012: 'parameter modifiers' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== class C { constructor(public x) { }} ~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt b/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt index e45fe5e02cf95..acae950d0816a 100644 --- a/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt +++ b/tests/baselines/reference/jsFileCompilationReturnTypeSyntaxOfFunction.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,15): error TS8010: 'types' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== function F(): number { } ~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt b/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt index d1a046728d208..eb4c114d3d074 100644 --- a/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt +++ b/tests/baselines/reference/jsFileCompilationSyntaxError.errors.txt @@ -1,9 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (0 errors) ==== /** * @type {number} diff --git a/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt b/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt index 250707970466c..74978eddf8ce1 100644 --- a/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeAliasSyntax.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,6): error TS8008: 'type aliases' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== type a = b; ~ diff --git a/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt b/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt index ed8a0dd97330e..f53ec55d2b1e0 100644 --- a/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeArgumentSyntaxOfCall.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,5): error TS8011: 'type arguments' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== Foo(); ~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt b/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt index 1a00c04ee00f7..be1e6d3243699 100644 --- a/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeAssertions.errors.txt @@ -1,11 +1,11 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,10): error TS17008: JSX element 'string' has no corresponding closing tag. tests/cases/compiler/a.js(1,27): error TS1005: 'undefined; ~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt b/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt index d7300c7ffc521..811c0793ffe15 100644 --- a/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeOfParameter.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,15): error TS8010: 'types' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== function F(a: number) { } ~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt index 624b721fc01ff..0fe902aa661cb 100644 --- a/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfClass.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,9): error TS8004: 'type parameter declarations' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== class C { } ~ diff --git a/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt index bebe2cf4f005f..bfc4c7be26a4d 100644 --- a/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeParameterSyntaxOfFunction.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,12): error TS8004: 'type parameter declarations' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== function F() { } ~ diff --git a/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt b/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt index a756b880a34a8..653337517800b 100644 --- a/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt +++ b/tests/baselines/reference/jsFileCompilationTypeSyntaxOfVar.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig tests/cases/compiler/a.js(1,8): error TS8010: 'types' can only be used in a .ts file. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.js (1 errors) ==== var v: () => number; ~~~~~~~~~~~~ diff --git a/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt b/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt index f12dfd2279a37..4170e818fd76b 100644 --- a/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithDeclarationEmitPathSameAsInput.errors.txt @@ -1,9 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/a.d.ts' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt b/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt index d611bbc3b2480..8004efd02eff4 100644 --- a/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithJsEmitPathSameAsInput.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files. !!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5056: Cannot write file 'tests/cases/compiler/a.js' because it would be overwritten by multiple input files. ==== tests/cases/compiler/a.ts (0 errors) ==== class c { diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt b/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt index 47590514fae42..069c562f29bf8 100644 --- a/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJs.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'. !!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'. ==== tests/cases/compiler/a.ts (0 errors) ==== diff --git a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt index 47590514fae42..069c562f29bf8 100644 --- a/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithMapFileAsJsWithInlineSourceMap.errors.txt @@ -1,10 +1,10 @@ error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'. !!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS6054: File 'tests/cases/compiler/b.js.map' has unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.js', '.jsx'. ==== tests/cases/compiler/a.ts (0 errors) ==== diff --git a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt index 72095f7501cf7..0a4f0cdf1a45b 100644 --- a/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithOutDeclarationFileNameSameAsInputJsFile.errors.txt @@ -1,9 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/b.d.ts' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt b/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt index cada35ab4a19f..3f72a8113ef2c 100644 --- a/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithOutFileNameSameAsInputJsFile.errors.txt @@ -1,9 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt b/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt index cada35ab4a19f..3f72a8113ef2c 100644 --- a/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt +++ b/tests/baselines/reference/jsFileCompilationWithoutOut.errors.txt @@ -1,9 +1,9 @@ error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5055: Cannot write file 'tests/cases/compiler/b.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== tests/cases/compiler/a.ts (0 errors) ==== class c { } diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt index 7a33822e4faa2..668f037a03b4d 100644 --- a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt @@ -1,11 +1,11 @@ error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. !!! error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== SameNameDTsNotSpecifiedWithAllowJs/a.d.ts (0 errors) ==== declare var a: number; ==== SameNameDTsNotSpecifiedWithAllowJs/a.js (0 errors) ==== diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt index 7a33822e4faa2..668f037a03b4d 100644 --- a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt +++ b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt @@ -1,11 +1,11 @@ error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file. - Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig + Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig !!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'. !!! error TS5055: Cannot write file 'SameNameDTsNotSpecifiedWithAllowJs/a.js' because it would overwrite input file. -!!! error TS5055: Adding a tsconfig.json file will help organizing projects with both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig +!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig ==== SameNameDTsNotSpecifiedWithAllowJs/a.d.ts (0 errors) ==== declare var a: number; ==== SameNameDTsNotSpecifiedWithAllowJs/a.js (0 errors) ====