summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/compiler.ts1
-rw-r--r--tests/error_008_checkjs.js6
-rw-r--r--tests/error_008_checkjs.js.out10
-rw-r--r--tsconfig.json2
-rw-r--r--website/app.js4
5 files changed, 23 insertions, 0 deletions
diff --git a/js/compiler.ts b/js/compiler.ts
index c872afa14..bac328937 100644
--- a/js/compiler.ts
+++ b/js/compiler.ts
@@ -152,6 +152,7 @@ export class DenoCompiler
// arguments
private readonly _options: Readonly<ts.CompilerOptions> = {
allowJs: true,
+ checkJs: true,
module: ts.ModuleKind.AMD,
outDir: "$deno$",
// TODO https://github.com/denoland/deno/issues/23
diff --git a/tests/error_008_checkjs.js b/tests/error_008_checkjs.js
new file mode 100644
index 000000000..08d4873c7
--- /dev/null
+++ b/tests/error_008_checkjs.js
@@ -0,0 +1,6 @@
+// console.log intentionally misspelled to trigger a type error
+consol.log("hello world!");
+
+// the following error should be ignored and not output to the console
+// @ts-ignore
+const foo = new Foo();
diff --git a/tests/error_008_checkjs.js.out b/tests/error_008_checkjs.js.out
new file mode 100644
index 000000000..9220efaf1
--- /dev/null
+++ b/tests/error_008_checkjs.js.out
@@ -0,0 +1,10 @@
+[WILDCARD]/tests/error_008_checkjs.jsILDCARD] - error TS2552: Cannot find name 'consol'. Did you mean 'console'?
+
+ILDCARD] consol.log("hello world!");
+[WILDCARD]~~~~~~
+
+ $asset$/lib.deno_runtime.d.tsILDCARD]
+[WILDCARD]declare const console: console_.Console;
+[WILDCARD]~~~~~~~
+[WILDCARD]'console' is declared here.
+
diff --git a/tsconfig.json b/tsconfig.json
index e6bf1688b..806143644 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,7 +1,9 @@
{
"compilerOptions": {
+ "allowJs": true,
"allowUnreachableCode": false,
"baseUrl": ".",
+ "checkJs": true,
"module": "esnext",
"moduleResolution": "node",
"noImplicitReturns": true,
diff --git a/website/app.js b/website/app.js
index b0ac3482b..74d97b41c 100644
--- a/website/app.js
+++ b/website/app.js
@@ -154,10 +154,12 @@ function gen2(
};
}
+ // @ts-ignore
c3.generate({
bindto: id,
size: {
height: 300,
+ // @ts-ignore
width: window.chartWidth || 375 // TODO: do not use global variable
},
data: {
@@ -201,6 +203,7 @@ export async function drawChartsFromBenchmarkData(dataUrl) {
const sha1ShortList = sha1List.map(sha1 => sha1.substring(0, 6));
const viewCommitOnClick = _sha1List => d => {
+ // @ts-ignore
window.open(
`https://github.com/denoland/deno/commit/${_sha1List[d["index"]]}`
);
@@ -230,6 +233,7 @@ export async function drawChartsFromBenchmarkData(dataUrl) {
*/
export async function drawChartsFromTravisData() {
const viewPullRequestOnClick = _prNumberList => d => {
+ // @ts-ignore
window.open(
`https://github.com/denoland/deno/pull/${_prNumberList[d["index"]]}`
);