0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

Support CheckJS

This commit is contained in:
Kitson Kelly 2018-10-25 06:26:21 +11:00 committed by Ryan Dahl
parent 0501330607
commit 2cfa608324
10 changed files with 28 additions and 15 deletions

View file

@ -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

View file

@ -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();

View file

@ -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.

View file

@ -1,3 +1 @@
define(["exports"], function(exports) {
exports.loaded = true;
});
export const loaded = true;

View file

@ -1,3 +1 @@
define(["exports"], function(exports) {
exports.loaded = true;
});
export const loaded = true;

View file

@ -1,3 +1 @@
define(["exports"], function(exports) {
exports.loaded = true;
});
export const loaded = true;

View file

@ -1,3 +1 @@
define(["exports"], function(exports) {
exports.loaded = true;
});
export const loaded = true;

View file

@ -1,3 +1 @@
define(["exports"], function(exports) {
exports.loaded = true;
});
export const loaded = true;

View file

@ -1,7 +1,9 @@
{
"compilerOptions": {
"allowJs": true,
"allowUnreachableCode": false,
"baseUrl": ".",
"checkJs": true,
"module": "esnext",
"moduleResolution": "node",
"noImplicitReturns": true,

View file

@ -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"]]}`
);