diff --git a/src/compiler/program.ts b/src/compiler/program.ts
index a191c9f3e1c..a029a481d19 100644
--- a/src/compiler/program.ts
+++ b/src/compiler/program.ts
@@ -1252,6 +1252,9 @@ namespace ts {
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "noEmit", "declaration"));
}
}
+ else if (options.allowJs && options.declaration) {
+ programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration"));
+ }
if (options.emitDecoratorMetadata &&
!options.experimentalDecorators) {
diff --git a/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementation.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementation.errors.txt
index fb0c214ddf6..b05fc6fa6d9 100644
--- a/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementation.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementation.errors.txt
@@ -1,6 +1,8 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
tests/cases/compiler/a.ts(1,10): error TS2393: Duplicate function implementation.
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
==== tests/cases/compiler/b.js (0 errors) ====
function foo() {
return 10;
diff --git a/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.errors.txt
index 78eb22546e8..82dbc27db0f 100644
--- a/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.errors.txt
@@ -1,6 +1,8 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
tests/cases/compiler/a.ts(1,10): error TS2393: Duplicate function implementation.
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
==== tests/cases/compiler/a.ts (1 errors) ====
function foo() {
~~~
diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariable.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateVariable.errors.txt
new file mode 100644
index 00000000000..f8ae4a1ba74
--- /dev/null
+++ b/tests/baselines/reference/jsFileCompilationDuplicateVariable.errors.txt
@@ -0,0 +1,9 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== tests/cases/compiler/a.ts (0 errors) ====
+ var x = 10;
+
+==== tests/cases/compiler/b.js (0 errors) ====
+ var x = "hello"; // No error is recorded here and declaration file will show this as number
\ No newline at end of file
diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariable.symbols b/tests/baselines/reference/jsFileCompilationDuplicateVariable.symbols
deleted file mode 100644
index 9bfc61a64f8..00000000000
--- a/tests/baselines/reference/jsFileCompilationDuplicateVariable.symbols
+++ /dev/null
@@ -1,8 +0,0 @@
-=== tests/cases/compiler/a.ts ===
-var x = 10;
->x : Symbol(x, Decl(a.ts, 0, 3), Decl(b.js, 0, 3))
-
-=== tests/cases/compiler/b.js ===
-var x = "hello"; // No error is recorded here and declaration file will show this as number
->x : Symbol(x, Decl(a.ts, 0, 3), Decl(b.js, 0, 3))
-
diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariable.types b/tests/baselines/reference/jsFileCompilationDuplicateVariable.types
deleted file mode 100644
index fefad3f6dda..00000000000
--- a/tests/baselines/reference/jsFileCompilationDuplicateVariable.types
+++ /dev/null
@@ -1,10 +0,0 @@
-=== tests/cases/compiler/a.ts ===
-var x = 10;
->x : number
->10 : number
-
-=== tests/cases/compiler/b.js ===
-var x = "hello"; // No error is recorded here and declaration file will show this as number
->x : number
->"hello" : string
-
diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt
index a3abc114118..f1374d95767 100644
--- a/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt
@@ -1,6 +1,8 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
tests/cases/compiler/a.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'.
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
==== tests/cases/compiler/b.js (0 errors) ====
var x = "hello";
diff --git a/tests/baselines/reference/jsFileCompilationEmitDeclarations.errors.txt b/tests/baselines/reference/jsFileCompilationEmitDeclarations.errors.txt
new file mode 100644
index 00000000000..3e89f9c9436
--- /dev/null
+++ b/tests/baselines/reference/jsFileCompilationEmitDeclarations.errors.txt
@@ -0,0 +1,12 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== tests/cases/compiler/a.ts (0 errors) ====
+ class c {
+ }
+
+==== tests/cases/compiler/b.js (0 errors) ====
+ function foo() {
+ }
+
\ No newline at end of file
diff --git a/tests/baselines/reference/jsFileCompilationEmitDeclarations.symbols b/tests/baselines/reference/jsFileCompilationEmitDeclarations.symbols
deleted file mode 100644
index 5260b8d6cf3..00000000000
--- a/tests/baselines/reference/jsFileCompilationEmitDeclarations.symbols
+++ /dev/null
@@ -1,10 +0,0 @@
-=== tests/cases/compiler/a.ts ===
-class c {
->c : Symbol(c, Decl(a.ts, 0, 0))
-}
-
-=== tests/cases/compiler/b.js ===
-function foo() {
->foo : Symbol(foo, Decl(b.js, 0, 0))
-}
-
diff --git a/tests/baselines/reference/jsFileCompilationEmitDeclarations.types b/tests/baselines/reference/jsFileCompilationEmitDeclarations.types
deleted file mode 100644
index dce83eeb8eb..00000000000
--- a/tests/baselines/reference/jsFileCompilationEmitDeclarations.types
+++ /dev/null
@@ -1,10 +0,0 @@
-=== tests/cases/compiler/a.ts ===
-class c {
->c : c
-}
-
-=== tests/cases/compiler/b.js ===
-function foo() {
->foo : () => void
-}
-
diff --git a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.errors.txt b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.errors.txt
new file mode 100644
index 00000000000..0cefa2eedac
--- /dev/null
+++ b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.errors.txt
@@ -0,0 +1,16 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== tests/cases/compiler/a.ts (0 errors) ====
+ class c {
+ }
+
+==== tests/cases/compiler/b.js (0 errors) ====
+ ///
+ function foo() {
+ }
+
+==== tests/cases/compiler/c.js (0 errors) ====
+ function bar() {
+ }
\ No newline at end of file
diff --git a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.symbols b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.symbols
deleted file mode 100644
index 805d202a14c..00000000000
--- a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.symbols
+++ /dev/null
@@ -1,15 +0,0 @@
-=== tests/cases/compiler/a.ts ===
-class c {
->c : Symbol(c, Decl(a.ts, 0, 0))
-}
-
-=== tests/cases/compiler/b.js ===
-///
-function foo() {
->foo : Symbol(foo, Decl(b.js, 0, 0))
-}
-
-=== tests/cases/compiler/c.js ===
-function bar() {
->bar : Symbol(bar, Decl(c.js, 0, 0))
-}
diff --git a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.types b/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.types
deleted file mode 100644
index b206a486351..00000000000
--- a/tests/baselines/reference/jsFileCompilationEmitTrippleSlashReference.types
+++ /dev/null
@@ -1,15 +0,0 @@
-=== tests/cases/compiler/a.ts ===
-class c {
->c : c
-}
-
-=== tests/cases/compiler/b.js ===
-///
-function foo() {
->foo : () => void
-}
-
-=== tests/cases/compiler/c.js ===
-function bar() {
->bar : () => void
-}
diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt
index 273717d151c..433a3c6b7be 100644
--- a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithNoOut.errors.txt
@@ -1,6 +1,8 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
error TS5055: Cannot write file 'tests/cases/compiler/c.js' which is one of the input files.
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
!!! error TS5055: Cannot write file 'tests/cases/compiler/c.js' which is one of the input files.
==== tests/cases/compiler/a.ts (0 errors) ====
class c {
diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.errors.txt b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.errors.txt
new file mode 100644
index 00000000000..44151401479
--- /dev/null
+++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.errors.txt
@@ -0,0 +1,17 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== tests/cases/compiler/a.ts (0 errors) ====
+ class c {
+ }
+
+==== tests/cases/compiler/b.ts (0 errors) ====
+ ///
+ // error on above reference when emitting declarations
+ function foo() {
+ }
+
+==== tests/cases/compiler/c.js (0 errors) ====
+ function bar() {
+ }
\ No newline at end of file
diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.symbols b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.symbols
deleted file mode 100644
index 544fe53f425..00000000000
--- a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.symbols
+++ /dev/null
@@ -1,16 +0,0 @@
-=== tests/cases/compiler/a.ts ===
-class c {
->c : Symbol(c, Decl(a.ts, 0, 0))
-}
-
-=== tests/cases/compiler/b.ts ===
-///
-// error on above reference when emitting declarations
-function foo() {
->foo : Symbol(foo, Decl(b.ts, 0, 0))
-}
-
-=== tests/cases/compiler/c.js ===
-function bar() {
->bar : Symbol(bar, Decl(c.js, 0, 0))
-}
diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.types b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.types
deleted file mode 100644
index 8aafb9f61d0..00000000000
--- a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOut.types
+++ /dev/null
@@ -1,16 +0,0 @@
-=== tests/cases/compiler/a.ts ===
-class c {
->c : c
-}
-
-=== tests/cases/compiler/b.ts ===
-///
-// error on above reference when emitting declarations
-function foo() {
->foo : () => void
-}
-
-=== tests/cases/compiler/c.js ===
-function bar() {
->bar : () => void
-}
diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.errors.txt b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.errors.txt
new file mode 100644
index 00000000000..fb6c801b42e
--- /dev/null
+++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.errors.txt
@@ -0,0 +1,17 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== tests/cases/compiler/a.ts (0 errors) ====
+ class c {
+ }
+
+==== tests/cases/compiler/b.ts (0 errors) ====
+ ///
+ // b.d.ts should have c.js as the reference path since we dont emit declarations for js files
+ function foo() {
+ }
+
+==== tests/cases/compiler/c.js (0 errors) ====
+ function bar() {
+ }
\ No newline at end of file
diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.js b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.js
new file mode 100644
index 00000000000..afed8cd42e3
--- /dev/null
+++ b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.js
@@ -0,0 +1,38 @@
+//// [tests/cases/compiler/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.ts] ////
+
+//// [a.ts]
+class c {
+}
+
+//// [b.ts]
+///
+// b.d.ts should have c.js as the reference path since we dont emit declarations for js files
+function foo() {
+}
+
+//// [c.js]
+function bar() {
+}
+
+//// [a.js]
+var c = (function () {
+ function c() {
+ }
+ return c;
+})();
+//// [c.js]
+function bar() {
+}
+//// [b.js]
+///
+// b.d.ts should have c.js as the reference path since we dont emit declarations for js files
+function foo() {
+}
+
+
+//// [a.d.ts]
+declare class c {
+}
+//// [b.d.ts]
+///
+declare function foo(): void;
diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.symbols b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.symbols
deleted file mode 100644
index 424fd85c165..00000000000
--- a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.symbols
+++ /dev/null
@@ -1,16 +0,0 @@
-=== tests/cases/compiler/a.ts ===
-class c {
->c : Symbol(c, Decl(a.ts, 0, 0))
-}
-
-=== tests/cases/compiler/b.ts ===
-///
-// b.d.ts should have c.js as the reference path since we dont emit declarations for js files
-function foo() {
->foo : Symbol(foo, Decl(b.ts, 0, 0))
-}
-
-=== tests/cases/compiler/c.js ===
-function bar() {
->bar : Symbol(bar, Decl(c.js, 0, 0))
-}
diff --git a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.types b/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.types
deleted file mode 100644
index f8b82383ac4..00000000000
--- a/tests/baselines/reference/jsFileCompilationErrorOnDeclarationsWithJsFileReferenceWithOutDir.types
+++ /dev/null
@@ -1,16 +0,0 @@
-=== tests/cases/compiler/a.ts ===
-class c {
->c : c
-}
-
-=== tests/cases/compiler/b.ts ===
-///
-// b.d.ts should have c.js as the reference path since we dont emit declarations for js files
-function foo() {
->foo : () => void
-}
-
-=== tests/cases/compiler/c.js ===
-function bar() {
->bar : () => void
-}
diff --git a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.errors.txt b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.errors.txt
new file mode 100644
index 00000000000..20a9c81ea9c
--- /dev/null
+++ b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.errors.txt
@@ -0,0 +1,12 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== tests/cases/compiler/b.js (0 errors) ====
+ let a = 10;
+ b = 30;
+
+==== tests/cases/compiler/a.ts (0 errors) ====
+ let b = 30;
+ a = 10;
+
\ No newline at end of file
diff --git a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.symbols b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.symbols
deleted file mode 100644
index c1e97340dc9..00000000000
--- a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.symbols
+++ /dev/null
@@ -1,14 +0,0 @@
-=== tests/cases/compiler/b.js ===
-let a = 10;
->a : Symbol(a, Decl(b.js, 0, 3))
-
-b = 30;
->b : Symbol(b, Decl(a.ts, 0, 3))
-
-=== tests/cases/compiler/a.ts ===
-let b = 30;
->b : Symbol(b, Decl(a.ts, 0, 3))
-
-a = 10;
->a : Symbol(a, Decl(b.js, 0, 3))
-
diff --git a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.types b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.types
deleted file mode 100644
index a28c62813de..00000000000
--- a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder.types
+++ /dev/null
@@ -1,20 +0,0 @@
-=== tests/cases/compiler/b.js ===
-let a = 10;
->a : number
->10 : number
-
-b = 30;
->b = 30 : number
->b : number
->30 : number
-
-=== tests/cases/compiler/a.ts ===
-let b = 30;
->b : number
->30 : number
-
-a = 10;
->a = 10 : number
->a : number
->10 : number
-
diff --git a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt
index fb213ec4433..b88c73e0439 100644
--- a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt
+++ b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt
@@ -1,6 +1,8 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
tests/cases/compiler/a.ts(2,1): error TS2448: Block-scoped variable 'a' used before its declaration.
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
==== tests/cases/compiler/a.ts (1 errors) ====
let b = 30;
a = 10;
diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt
new file mode 100644
index 00000000000..67b0592c05f
--- /dev/null
+++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt
@@ -0,0 +1,8 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== DifferentNamesNotSpecifiedWithAllowJs/a.ts (0 errors) ====
+ var test = 10;
+==== DifferentNamesNotSpecifiedWithAllowJs/b.js (0 errors) ====
+ var test2 = 10; // Should get compiled
\ No newline at end of file
diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt
new file mode 100644
index 00000000000..67b0592c05f
--- /dev/null
+++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesNotSpecifiedWithAllowJs.errors.txt
@@ -0,0 +1,8 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== DifferentNamesNotSpecifiedWithAllowJs/a.ts (0 errors) ====
+ var test = 10;
+==== DifferentNamesNotSpecifiedWithAllowJs/b.js (0 errors) ====
+ var test2 = 10; // Should get compiled
\ No newline at end of file
diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt
new file mode 100644
index 00000000000..35c913a5835
--- /dev/null
+++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/amd/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt
@@ -0,0 +1,8 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== DifferentNamesSpecifiedWithAllowJs/a.ts (0 errors) ====
+ var test = 10;
+==== DifferentNamesSpecifiedWithAllowJs/b.js (0 errors) ====
+ var test2 = 10; // Should get compiled
\ No newline at end of file
diff --git a/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt
new file mode 100644
index 00000000000..35c913a5835
--- /dev/null
+++ b/tests/baselines/reference/project/jsFileCompilationDifferentNamesSpecifiedWithAllowJs/node/jsFileCompilationDifferentNamesSpecifiedWithAllowJs.errors.txt
@@ -0,0 +1,8 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== DifferentNamesSpecifiedWithAllowJs/a.ts (0 errors) ====
+ var test = 10;
+==== DifferentNamesSpecifiedWithAllowJs/b.js (0 errors) ====
+ var test2 = 10; // Should get compiled
\ No newline at end of file
diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.errors.txt
new file mode 100644
index 00000000000..cdec4ffb398
--- /dev/null
+++ b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.errors.txt
@@ -0,0 +1,6 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== SameNameDTsSpecifiedWithAllowJs/a.d.ts (0 errors) ====
+ declare var test: number;
\ No newline at end of file
diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/node/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/node/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.errors.txt
new file mode 100644
index 00000000000..cdec4ffb398
--- /dev/null
+++ b/tests/baselines/reference/project/jsFileCompilationSameNameDTsSpecifiedWithAllowJs/node/jsFileCompilationSameNameDTsSpecifiedWithAllowJs.errors.txt
@@ -0,0 +1,6 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== SameNameDTsSpecifiedWithAllowJs/a.d.ts (0 errors) ====
+ declare var test: number;
\ No newline at end of file
diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt
new file mode 100644
index 00000000000..8da5b629ca8
--- /dev/null
+++ b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt
@@ -0,0 +1,6 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== SameNameDTsNotSpecifiedWithAllowJs/a.d.ts (0 errors) ====
+ declare var a: number;
\ No newline at end of file
diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt
new file mode 100644
index 00000000000..8da5b629ca8
--- /dev/null
+++ b/tests/baselines/reference/project/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameDtsNotSpecifiedWithAllowJs.errors.txt
@@ -0,0 +1,6 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== SameNameDTsNotSpecifiedWithAllowJs/a.d.ts (0 errors) ====
+ declare var a: number;
\ No newline at end of file
diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.errors.txt
new file mode 100644
index 00000000000..9eb81a5f9f1
--- /dev/null
+++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.errors.txt
@@ -0,0 +1,6 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== SameNameFilesNotSpecifiedWithAllowJs/a.ts (0 errors) ====
+ var test = 10;
\ No newline at end of file
diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.errors.txt
new file mode 100644
index 00000000000..9eb81a5f9f1
--- /dev/null
+++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesNotSpecifiedWithAllowJs.errors.txt
@@ -0,0 +1,6 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== SameNameFilesNotSpecifiedWithAllowJs/a.ts (0 errors) ====
+ var test = 10;
\ No newline at end of file
diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.errors.txt
new file mode 100644
index 00000000000..ddfb63686b4
--- /dev/null
+++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/amd/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.errors.txt
@@ -0,0 +1,6 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== SameNameTsSpecifiedWithAllowJs/a.ts (0 errors) ====
+ var test = 10;
\ No newline at end of file
diff --git a/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.errors.txt b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.errors.txt
new file mode 100644
index 00000000000..ddfb63686b4
--- /dev/null
+++ b/tests/baselines/reference/project/jsFileCompilationSameNameFilesSpecifiedWithAllowJs/node/jsFileCompilationSameNameFilesSpecifiedWithAllowJs.errors.txt
@@ -0,0 +1,6 @@
+error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+
+
+!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
+==== SameNameTsSpecifiedWithAllowJs/a.ts (0 errors) ====
+ var test = 10;
\ No newline at end of file