diff --git a/tests/baselines/reference/checkJsFiles.errors.txt b/tests/baselines/reference/checkJsFiles.errors.txt new file mode 100644 index 00000000000..8371e101dd1 --- /dev/null +++ b/tests/baselines/reference/checkJsFiles.errors.txt @@ -0,0 +1,13 @@ +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(3,1): error TS2322: Type '0' is not assignable to type 'string'. + + +!!! 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 x = "string"; + x = 0; + ~ +!!! error TS2322: Type '0' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/checkJsFiles2.errors.txt b/tests/baselines/reference/checkJsFiles2.errors.txt new file mode 100644 index 00000000000..566ba3786b8 --- /dev/null +++ b/tests/baselines/reference/checkJsFiles2.errors.txt @@ -0,0 +1,14 @@ +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(4,1): error TS2322: Type '0' is not assignable to type 'string'. + + +!!! 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) ==== + + // @check + var x = "string"; + x = 0; + ~ +!!! error TS2322: Type '0' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/checkJsFiles3.errors.txt b/tests/baselines/reference/checkJsFiles3.errors.txt new file mode 100644 index 00000000000..566ba3786b8 --- /dev/null +++ b/tests/baselines/reference/checkJsFiles3.errors.txt @@ -0,0 +1,14 @@ +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(4,1): error TS2322: Type '0' is not assignable to type 'string'. + + +!!! 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) ==== + + // @check + var x = "string"; + x = 0; + ~ +!!! error TS2322: Type '0' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/cases/compiler/checkJsFiles.ts b/tests/cases/compiler/checkJsFiles.ts new file mode 100644 index 00000000000..c36673b0239 --- /dev/null +++ b/tests/cases/compiler/checkJsFiles.ts @@ -0,0 +1,6 @@ +// @allowJs: true +// @checkJsFiles: true + +// @fileName: a.js +var x = "string"; +x = 0; \ No newline at end of file diff --git a/tests/cases/compiler/checkJsFiles2.ts b/tests/cases/compiler/checkJsFiles2.ts new file mode 100644 index 00000000000..fe8978666b0 --- /dev/null +++ b/tests/cases/compiler/checkJsFiles2.ts @@ -0,0 +1,7 @@ +// @allowJs: true +// @checkJsFiles: false + +// @fileName: a.js +// @check +var x = "string"; +x = 0; \ No newline at end of file diff --git a/tests/cases/compiler/checkJsFiles3.ts b/tests/cases/compiler/checkJsFiles3.ts new file mode 100644 index 00000000000..964f909bc6f --- /dev/null +++ b/tests/cases/compiler/checkJsFiles3.ts @@ -0,0 +1,6 @@ +// @allowJs: true + +// @fileName: a.js +// @check +var x = "string"; +x = 0; \ No newline at end of file