diff --git a/src/compiler/core.ts b/src/compiler/core.ts index dd71877930a62..8175730159b0b 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1127,6 +1127,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 5290782c156a2..9a353e6fb3651 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3158,5 +3158,9 @@ "Implement inherited abstract class": { "category": "Message", "code": 90007 + }, + "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 82d274e0487df..dcb9cce0adb55 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; } @@ -1685,13 +1685,24 @@ 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); + if (options.noEmitOverwritenFiles && !options.out && !options.outDir && !options.outFile) { + blockEmittingOfFile(emitFileName); + } + else { + 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_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); + blockEmittingOfFile(emitFileName, createCompilerDiagnosticFromMessageChain(chain)); + } } // 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); + blockEmittingOfFile(emitFileName, createCompilerDiagnostic(Diagnostics.Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files, emitFileName)); } else { emitFilesSeen.set(emitFilePath, true); @@ -1700,9 +1711,11 @@ namespace ts { } } - function createEmitBlockingDiagnostics(emitFileName: string, message: DiagnosticMessage) { + function blockEmittingOfFile(emitFileName: string, diag?: Diagnostic) { hasEmitBlockingDiagnostics.set(toPath(emitFileName, currentDirectory, getCanonicalFileName), true); - programDiagnostics.add(createCompilerDiagnostic(message, emitFileName)); + if (diag) { + programDiagnostics.add(diag); + } } } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index b865beca76b9a..5536a818df536 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3058,6 +3058,7 @@ namespace ts { moduleResolution?: ModuleResolutionKind; newLine?: NewLineKind; noEmit?: boolean; + /*@internal*/noEmitOverwritenFiles?: boolean; noEmitHelpers?: boolean; noEmitOnError?: boolean; noErrorTruncation?: boolean; diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index b008ca653702d..ae32fe3db1631 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1253,7 +1253,18 @@ namespace FourSlash { resultString += "Diagnostics:" + Harness.IO.newLine(); const diagnostics = ts.getPreEmitDiagnostics(this.languageService.getProgram()); for (const diagnostic of diagnostics) { - resultString += " " + diagnostic.messageText + Harness.IO.newLine(); + 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/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 870926a8c5595..15cfa3f8c8e7c 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -2505,4 +2505,28 @@ namespace ts.projectSystem { checkProjectActualFiles(projectService.inferredProjects[0], [f.path]); }); }); + + describe("No overwrite emit error", () => { + it("for inferred project", () => { + const f1 = { + path: "/a/b/f1.js", + content: "function test1() { }" + }; + const host = createServerHost([f1, libFile]); + const session = createSession(host); + openFilesForSession([f1], session); + + const projectService = session.getProjectService(); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + const projectName = projectService.inferredProjects[0].getProjectName(); + + const diags = session.executeCommand({ + type: "request", + command: server.CommandNames.CompilerOptionsDiagnosticsFull, + seq: 2, + arguments: { projectFileName: projectName } + }).response; + assert.isTrue(diags.length === 0); + }); + }); } \ No newline at end of file diff --git a/src/server/project.ts b/src/server/project.ts index 457f5e2b261df..563b045691071 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -161,6 +161,10 @@ namespace ts.server { this.compilerOptions.allowNonTsExtensions = true; } + if (this.projectKind === ProjectKind.Inferred) { + this.compilerOptions.noEmitOverwritenFiles = true; + } + if (languageServiceEnabled) { this.enableLanguageService(); } diff --git a/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline b/tests/baselines/reference/compileOnSaveWorksWhenEmitBlockingErrorOnOtherFile.baseline index a088006d1450e..f8b479e6d7b7b 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 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 1974976dee1fe..211469778b1fe 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 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 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 658465de9c2d2..ea4a93b3b12db 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 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 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 34035e1e14e73..0565c8bd61ef2 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 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 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 5e17306e066f5..a74fbacfcfd87 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 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 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 19bfd5d1c0205..039834ff702af 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 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 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 0aa9d5733d532..75bcf88b10a13 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 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 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 538dfb38972bc..c6da8931d5e3e 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 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 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 641731936f84a..54e91c5d1961e 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 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 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 f537941c55cf1..babbeea800455 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 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 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 33b8a45f1aab0..3b30663308fa5 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 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 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 b416136703755..a064f53e92fa4 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 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 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 17fb8fcb18741..9e53438c732fd 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 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 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 662028c53ed93..6952c0055c0ee 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 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 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 f2f4142b99380..888310414f275 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 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 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 295f827dd2d7c..15bfe2281d96f 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 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 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 d67c9baea70e5..af95c13620559 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 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 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 bc4913f6217b4..9314e1da807aa 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 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 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 6dad5a294854c..acae950d0816a 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 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 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 d98a1e7e7bbc8..eb4c114d3d074 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 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 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 2b5112e1ce2ed..74978eddf8ce1 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 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 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 8ac59196ed960..f53ec55d2b1e0 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 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 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 662eea4d4050c..be1e6d3243699 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 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 680b32a64f1ad..811c0793ffe15 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 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 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 161c832ffd5d4..0fe902aa661cb 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 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 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 d7626f68564cf..bfc4c7be26a4d 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 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 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 2c6ac3771bef8..653337517800b 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 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 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 9e9c2adb0efa2..4170e818fd76b 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 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 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 4cc2cc2ab4547..8004efd02eff4 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 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 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 06186b9f0b2fc..069c562f29bf8 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 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 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 06186b9f0b2fc..069c562f29bf8 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 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 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 10c7b8c90ddad..0a4f0cdf1a45b 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 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 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 0f6852b21a0a2..3f72a8113ef2c 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 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 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 0f6852b21a0a2..3f72a8113ef2c 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 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 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 ac25edc1bd565..668f037a03b4d 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 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 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 ac25edc1bd565..668f037a03b4d 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 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 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) ====