mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
Support CheckJS
This commit is contained in:
parent
0501330607
commit
2cfa608324
10 changed files with 28 additions and 15 deletions
|
@ -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
|
||||
|
|
6
tests/error_008_checkjs.js
Normal file
6
tests/error_008_checkjs.js
Normal 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();
|
10
tests/error_008_checkjs.js.out
Normal file
10
tests/error_008_checkjs.js.out
Normal file
|
@ -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.
|
||||
|
|
@ -1,3 +1 @@
|
|||
define(["exports"], function(exports) {
|
||||
exports.loaded = true;
|
||||
});
|
||||
export const loaded = true;
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
define(["exports"], function(exports) {
|
||||
exports.loaded = true;
|
||||
});
|
||||
export const loaded = true;
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
define(["exports"], function(exports) {
|
||||
exports.loaded = true;
|
||||
});
|
||||
export const loaded = true;
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
define(["exports"], function(exports) {
|
||||
exports.loaded = true;
|
||||
});
|
||||
export const loaded = true;
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
define(["exports"], function(exports) {
|
||||
exports.loaded = true;
|
||||
});
|
||||
export const loaded = true;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"allowUnreachableCode": false,
|
||||
"baseUrl": ".",
|
||||
"checkJs": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"noImplicitReturns": true,
|
||||
|
|
|
@ -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"]]}`
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue