diff options
-rw-r--r-- | js/compiler.ts | 1 | ||||
-rw-r--r-- | tests/error_008_checkjs.js | 6 | ||||
-rw-r--r-- | tests/error_008_checkjs.js.out | 10 | ||||
-rw-r--r-- | tests/subdir/mt_application_ecmascript.j2.js | 4 | ||||
-rw-r--r-- | tests/subdir/mt_application_x_javascript.j4.js | 4 | ||||
-rw-r--r-- | tests/subdir/mt_javascript.js | 4 | ||||
-rw-r--r-- | tests/subdir/mt_text_ecmascript.j3.js | 4 | ||||
-rw-r--r-- | tests/subdir/mt_text_javascript.j1.js | 4 | ||||
-rw-r--r-- | tsconfig.json | 2 | ||||
-rw-r--r-- | website/app.js | 4 |
10 files changed, 28 insertions, 15 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 @@ +[96m[WILDCARD]/tests/error_008_checkjs.js[WILDCARD] - [91merror[0m[90m TS2552: [0mCannot find name 'consol'. Did you mean 'console'? + +[WILDCARD] consol.log("hello world!"); +[WILDCARD]~~~~~~[0m + + [96m$asset$/lib.deno_runtime.d.ts[WILDCARD] +[WILDCARD]declare const console: console_.Console; +[WILDCARD]~~~~~~~[0m +[WILDCARD]'console' is declared here. + diff --git a/tests/subdir/mt_application_ecmascript.j2.js b/tests/subdir/mt_application_ecmascript.j2.js index ec30e0595..e67d2a017 100644 --- a/tests/subdir/mt_application_ecmascript.j2.js +++ b/tests/subdir/mt_application_ecmascript.j2.js @@ -1,3 +1 @@ -define(["exports"], function(exports) { - exports.loaded = true; -}); +export const loaded = true; diff --git a/tests/subdir/mt_application_x_javascript.j4.js b/tests/subdir/mt_application_x_javascript.j4.js index ec30e0595..e67d2a017 100644 --- a/tests/subdir/mt_application_x_javascript.j4.js +++ b/tests/subdir/mt_application_x_javascript.j4.js @@ -1,3 +1 @@ -define(["exports"], function(exports) { - exports.loaded = true; -}); +export const loaded = true; diff --git a/tests/subdir/mt_javascript.js b/tests/subdir/mt_javascript.js index ec30e0595..e67d2a017 100644 --- a/tests/subdir/mt_javascript.js +++ b/tests/subdir/mt_javascript.js @@ -1,3 +1 @@ -define(["exports"], function(exports) { - exports.loaded = true; -}); +export const loaded = true; diff --git a/tests/subdir/mt_text_ecmascript.j3.js b/tests/subdir/mt_text_ecmascript.j3.js index ec30e0595..e67d2a017 100644 --- a/tests/subdir/mt_text_ecmascript.j3.js +++ b/tests/subdir/mt_text_ecmascript.j3.js @@ -1,3 +1 @@ -define(["exports"], function(exports) { - exports.loaded = true; -}); +export const loaded = true; diff --git a/tests/subdir/mt_text_javascript.j1.js b/tests/subdir/mt_text_javascript.j1.js index ec30e0595..e67d2a017 100644 --- a/tests/subdir/mt_text_javascript.j1.js +++ b/tests/subdir/mt_text_javascript.j1.js @@ -1,3 +1 @@ -define(["exports"], function(exports) { - exports.loaded = true; -}); +export const loaded = true; 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 5185c936a..375c6a54b 100644 --- a/website/app.js +++ b/website/app.js @@ -148,10 +148,12 @@ function generate( }; } + // @ts-ignore c3.generate({ bindto: id, size: { height: 300, + // @ts-ignore width: window.chartWidth || 375 // TODO: do not use global variable }, data: { @@ -200,6 +202,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"]]}` ); @@ -229,6 +232,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"]]}` ); |