mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 20:38:55 +00:00
chore: enable no-console dlint rule (#25113)
This commit is contained in:
parent
2f47b4d1fd
commit
a7c002ae63
@ -4,6 +4,7 @@
|
|||||||
"include": [
|
"include": [
|
||||||
"ban-untagged-todo",
|
"ban-untagged-todo",
|
||||||
"camelcase",
|
"camelcase",
|
||||||
|
"no-console",
|
||||||
"guard-for-in"
|
"guard-for-in"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
const count = 100000;
|
const count = 100000;
|
||||||
for (let i = 0; i < count; i++) console.log("Hello World");
|
for (let i = 0; i < count; i++) console.log("Hello World");
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
let [total, count] = typeof Deno !== "undefined"
|
let [total, count] = typeof Deno !== "undefined"
|
||||||
? Deno.args
|
? Deno.args
|
||||||
: [process.argv[2], process.argv[3]];
|
: [process.argv[2], process.argv[3]];
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
let [total, count] = typeof Deno !== "undefined"
|
let [total, count] = typeof Deno !== "undefined"
|
||||||
? Deno.args
|
? Deno.args
|
||||||
: [process.argv[2], process.argv[3]];
|
: [process.argv[2], process.argv[3]];
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// TODO(bartlomieju): Replace this with a real HTTP server once
|
// TODO(bartlomieju): Replace this with a real HTTP server once
|
||||||
// https://github.com/denoland/deno/issues/726 is completed.
|
// https://github.com/denoland/deno/issues/726 is completed.
|
||||||
// Note: this is a keep-alive server.
|
// Note: this is a keep-alive server.
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
const addr = Deno.args[0] || "127.0.0.1:4500";
|
const addr = Deno.args[0] || "127.0.0.1:4500";
|
||||||
const [hostname, port] = addr.split(":");
|
const [hostname, port] = addr.split(":");
|
||||||
const listener = Deno.listen({ hostname, port: Number(port) });
|
const listener = Deno.listen({ hostname, port: Number(port) });
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
const queueMicrotask = globalThis.queueMicrotask || process.nextTick;
|
const queueMicrotask = globalThis.queueMicrotask || process.nextTick;
|
||||||
let [total, count] = typeof Deno !== "undefined"
|
let [total, count] = typeof Deno !== "undefined"
|
||||||
? Deno.args
|
? Deno.args
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
let [total, count] = typeof Deno !== "undefined"
|
let [total, count] = typeof Deno !== "undefined"
|
||||||
? Deno.args
|
? Deno.args
|
||||||
: [process.argv[2], process.argv[3]];
|
: [process.argv[2], process.argv[3]];
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
//
|
//
|
||||||
// From https://github.com/just-js/benchmarks/tree/main/01-stdio
|
// From https://github.com/just-js/benchmarks/tree/main/01-stdio
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
const blocksize = parseInt(Deno.args[0] || 65536);
|
const blocksize = parseInt(Deno.args[0] || 65536);
|
||||||
const buf = new Uint8Array(blocksize);
|
const buf = new Uint8Array(blocksize);
|
||||||
let size = 0;
|
let size = 0;
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
const queueMicrotask = globalThis.queueMicrotask || process.nextTick;
|
const queueMicrotask = globalThis.queueMicrotask || process.nextTick;
|
||||||
let [total, count] = typeof Deno !== "undefined"
|
let [total, count] = typeof Deno !== "undefined"
|
||||||
? Deno.args
|
? Deno.args
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
const queueMicrotask = globalThis.queueMicrotask || process.nextTick;
|
const queueMicrotask = globalThis.queueMicrotask || process.nextTick;
|
||||||
let [total, count] = typeof Deno !== "undefined"
|
let [total, count] = typeof Deno !== "undefined"
|
||||||
? Deno.args
|
? Deno.args
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
// Note: when benchmarking across different Deno version, make sure to clear
|
// Note: when benchmarking across different Deno version, make sure to clear
|
||||||
// the DENO_DIR cache.
|
// the DENO_DIR cache.
|
||||||
let [total, count] = typeof Deno !== "undefined" ? Deno.args : [];
|
let [total, count] = typeof Deno !== "undefined" ? Deno.args : [];
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
const queueMicrotask = globalThis.queueMicrotask || process.nextTick;
|
const queueMicrotask = globalThis.queueMicrotask || process.nextTick;
|
||||||
let [total, count] = typeof Deno !== "undefined"
|
let [total, count] = typeof Deno !== "undefined"
|
||||||
? Deno.args
|
? Deno.args
|
||||||
|
@ -157,6 +157,7 @@ function cron(
|
|||||||
const _res = isPromise(result) ? (await result) : result;
|
const _res = isPromise(result) ? (await result) : result;
|
||||||
success = true;
|
success = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.error(`Exception in cron handler ${name}`, error);
|
console.error(`Exception in cron handler ${name}`, error);
|
||||||
success = false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
@ -525,6 +525,7 @@ function mapToCallback(context, callback, onError) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.error("Exception in onError while handling exception", error);
|
console.error("Exception in onError while handling exception", error);
|
||||||
response = internalServerError();
|
response = internalServerError();
|
||||||
}
|
}
|
||||||
@ -533,6 +534,7 @@ function mapToCallback(context, callback, onError) {
|
|||||||
if (innerRequest?.[_upgraded]) {
|
if (innerRequest?.[_upgraded]) {
|
||||||
// We're done here as the connection has been upgraded during the callback and no longer requires servicing.
|
// We're done here as the connection has been upgraded during the callback and no longer requires servicing.
|
||||||
if (response !== UPGRADE_RESPONSE_SENTINEL) {
|
if (response !== UPGRADE_RESPONSE_SENTINEL) {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.error("Upgrade response was not returned from callback");
|
console.error("Upgrade response was not returned from callback");
|
||||||
context.close();
|
context.close();
|
||||||
}
|
}
|
||||||
@ -612,6 +614,7 @@ function serve(arg1, arg2) {
|
|||||||
const wantsUnix = ObjectHasOwn(options, "path");
|
const wantsUnix = ObjectHasOwn(options, "path");
|
||||||
const signal = options.signal;
|
const signal = options.signal;
|
||||||
const onError = options.onError ?? function (error) {
|
const onError = options.onError ?? function (error) {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return internalServerError();
|
return internalServerError();
|
||||||
};
|
};
|
||||||
@ -627,6 +630,7 @@ function serve(arg1, arg2) {
|
|||||||
if (options.onListen) {
|
if (options.onListen) {
|
||||||
options.onListen(listener.addr);
|
options.onListen(listener.addr);
|
||||||
} else {
|
} else {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.log(`Listening on ${path}`);
|
console.log(`Listening on ${path}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -684,6 +688,7 @@ function serve(arg1, arg2) {
|
|||||||
const host = StringPrototypeIncludes(addr.hostname, ":")
|
const host = StringPrototypeIncludes(addr.hostname, ":")
|
||||||
? `[${addr.hostname}]`
|
? `[${addr.hostname}]`
|
||||||
: addr.hostname;
|
: addr.hostname;
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.log(`Listening on ${scheme}${host}:${addr.port}/`);
|
console.log(`Listening on ${scheme}${host}:${addr.port}/`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -729,6 +734,7 @@ function serveHttpOn(context, addr, callback) {
|
|||||||
|
|
||||||
const promiseErrorHandler = (error) => {
|
const promiseErrorHandler = (error) => {
|
||||||
// Abnormal exit
|
// Abnormal exit
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.error(
|
console.error(
|
||||||
"Terminating Deno.serve loop due to unexpected error",
|
"Terminating Deno.serve loop due to unexpected error",
|
||||||
error,
|
error,
|
||||||
@ -856,6 +862,7 @@ function registerDeclarativeServer(exports) {
|
|||||||
const nThreads = serveWorkerCount > 1
|
const nThreads = serveWorkerCount > 1
|
||||||
? ` with ${serveWorkerCount} threads`
|
? ` with ${serveWorkerCount} threads`
|
||||||
: "";
|
: "";
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.debug(
|
console.debug(
|
||||||
`%cdeno serve%c: Listening on %chttp://${hostname}:${port}/%c${nThreads}`,
|
`%cdeno serve%c: Listening on %chttp://${hostname}:${port}/%c${nThreads}`,
|
||||||
"color: green",
|
"color: green",
|
||||||
|
@ -318,6 +318,7 @@ class Kv {
|
|||||||
const _res = isPromise(result) ? (await result) : result;
|
const _res = isPromise(result) ? (await result) : result;
|
||||||
success = true;
|
success = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.error("Exception in queue handler", error);
|
console.error("Exception in queue handler", error);
|
||||||
} finally {
|
} finally {
|
||||||
const promise: Promise<void> = op_kv_finish_dequeued_message(
|
const promise: Promise<void> = op_kv_finish_dequeued_message(
|
||||||
|
@ -42,6 +42,7 @@ export function warnNotImplemented(msg?: string) {
|
|||||||
const message = msg
|
const message = msg
|
||||||
? `Warning: Not implemented: ${msg}`
|
? `Warning: Not implemented: ${msg}`
|
||||||
: "Warning: Not implemented";
|
: "Warning: Not implemented";
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.warn(message);
|
console.warn(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1836,6 +1836,7 @@ export class ServerImpl extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setTimeout() {
|
setTimeout() {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.error("Not implemented: Server.setTimeout()");
|
console.error("Not implemented: Server.setTimeout()");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,6 +127,7 @@ type Http2Headers = Record<string, string | string[]>;
|
|||||||
const debugHttp2Enabled = false;
|
const debugHttp2Enabled = false;
|
||||||
function debugHttp2(...args) {
|
function debugHttp2(...args) {
|
||||||
if (debugHttp2Enabled) {
|
if (debugHttp2Enabled) {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.log(...args);
|
console.log(...args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1636,16 +1637,19 @@ export class Http2Server extends Server {
|
|||||||
this.emit("stream", stream, headers);
|
this.emit("stream", stream, headers);
|
||||||
return await stream._deferred.promise;
|
return await stream._deferred.promise;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.log(">>> Error in serveHttpOnConnection", e);
|
console.log(">>> Error in serveHttpOnConnection", e);
|
||||||
}
|
}
|
||||||
return new Response("");
|
return new Response("");
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.log(">>> error");
|
console.log(">>> error");
|
||||||
},
|
},
|
||||||
() => {},
|
() => {},
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.log(">>> Error in Http2Server", e);
|
console.log(">>> Error in Http2Server", e);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -30,6 +30,7 @@ export function initializeDebugEnv(debugEnv: string) {
|
|||||||
// NODE_DEBUG=http or NODE_DEBUG=http2.
|
// NODE_DEBUG=http or NODE_DEBUG=http2.
|
||||||
function emitWarningIfNeeded(set: string) {
|
function emitWarningIfNeeded(set: string) {
|
||||||
if ("HTTP" === set || "HTTP2" === set) {
|
if ("HTTP" === set || "HTTP2" === set) {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.warn(
|
console.warn(
|
||||||
"Setting the NODE_DEBUG environment variable " +
|
"Setting the NODE_DEBUG environment variable " +
|
||||||
"to '" + set.toLowerCase() + "' can expose sensitive " +
|
"to '" + set.toLowerCase() + "' can expose sensitive " +
|
||||||
@ -50,6 +51,7 @@ function debuglogImpl(
|
|||||||
emitWarningIfNeeded(set);
|
emitWarningIfNeeded(set);
|
||||||
debugImpls[set] = function debug(...args: unknown[]) {
|
debugImpls[set] = function debug(...args: unknown[]) {
|
||||||
const msg = args.map((arg) => inspect(arg)).join(" ");
|
const msg = args.map((arg) => inspect(arg)).join(" ");
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.error("%s %s: %s", set, String(Deno.pid), msg);
|
console.error("%s %s: %s", set, String(Deno.pid), msg);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
@ -28,6 +28,7 @@ class NodeTestContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
diagnostic(message) {
|
diagnostic(message) {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.log("DIAGNOSTIC:", message);
|
console.log("DIAGNOSTIC:", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,6 +234,7 @@ function timestamp(): string {
|
|||||||
*/
|
*/
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
export function log(...args: any[]) {
|
export function log(...args: any[]) {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.log("%s - %s", timestamp(), ReflectApply(format, undefined, args));
|
console.log("%s - %s", timestamp(), ReflectApply(format, undefined, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ const {
|
|||||||
const debugWorkerThreads = false;
|
const debugWorkerThreads = false;
|
||||||
function debugWT(...args) {
|
function debugWT(...args) {
|
||||||
if (debugWorkerThreads) {
|
if (debugWorkerThreads) {
|
||||||
// deno-lint-ignore prefer-primordials
|
// deno-lint-ignore prefer-primordials no-console
|
||||||
console.log(...args);
|
console.log(...args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,6 +164,7 @@ function resolvePromiseWith(value) {
|
|||||||
function rethrowAssertionErrorRejection(e) {
|
function rethrowAssertionErrorRejection(e) {
|
||||||
if (e && ObjectPrototypeIsPrototypeOf(AssertionError.prototype, e)) {
|
if (e && ObjectPrototypeIsPrototypeOf(AssertionError.prototype, e)) {
|
||||||
queueMicrotask(() => {
|
queueMicrotask(() => {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.error(`Internal Error: ${e.stack}`);
|
console.error(`Internal Error: ${e.stack}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -125,12 +125,15 @@ function warnOnDeprecatedApi(apiName, stack, ...suggestions) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// deno-lint-ignore no-console
|
||||||
|
const logError = console.error;
|
||||||
|
|
||||||
if (!verboseDeprecatedApiWarning) {
|
if (!verboseDeprecatedApiWarning) {
|
||||||
if (ALREADY_WARNED_DEPRECATED.has(apiName)) {
|
if (ALREADY_WARNED_DEPRECATED.has(apiName)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ALREADY_WARNED_DEPRECATED.add(apiName);
|
ALREADY_WARNED_DEPRECATED.add(apiName);
|
||||||
console.error(
|
logError(
|
||||||
`%cwarning: %cUse of deprecated "${apiName}" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.`,
|
`%cwarning: %cUse of deprecated "${apiName}" API. This API will be removed in Deno 2. Run again with DENO_VERBOSE_WARNINGS=1 to get more details.`,
|
||||||
"color: yellow;",
|
"color: yellow;",
|
||||||
"font-weight: bold;",
|
"font-weight: bold;",
|
||||||
@ -176,40 +179,40 @@ function warnOnDeprecatedApi(apiName, stack, ...suggestions) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ALREADY_WARNED_DEPRECATED.add(apiName + stack);
|
ALREADY_WARNED_DEPRECATED.add(apiName + stack);
|
||||||
console.error(
|
logError(
|
||||||
`%cwarning: %cUse of deprecated "${apiName}" API. This API will be removed in Deno 2.`,
|
`%cwarning: %cUse of deprecated "${apiName}" API. This API will be removed in Deno 2.`,
|
||||||
"color: yellow;",
|
"color: yellow;",
|
||||||
"font-weight: bold;",
|
"font-weight: bold;",
|
||||||
);
|
);
|
||||||
|
|
||||||
console.error();
|
logError();
|
||||||
console.error(
|
logError(
|
||||||
"See the Deno 1 to 2 Migration Guide for more information at https://docs.deno.com/runtime/manual/advanced/migrate_deprecations",
|
"See the Deno 1 to 2 Migration Guide for more information at https://docs.deno.com/runtime/manual/advanced/migrate_deprecations",
|
||||||
);
|
);
|
||||||
console.error();
|
logError();
|
||||||
if (stackLines.length > 0) {
|
if (stackLines.length > 0) {
|
||||||
console.error("Stack trace:");
|
logError("Stack trace:");
|
||||||
for (let i = 0; i < stackLines.length; i++) {
|
for (let i = 0; i < stackLines.length; i++) {
|
||||||
console.error(` ${StringPrototypeTrim(stackLines[i])}`);
|
logError(` ${StringPrototypeTrim(stackLines[i])}`);
|
||||||
}
|
}
|
||||||
console.error();
|
logError();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < suggestions.length; i++) {
|
for (let i = 0; i < suggestions.length; i++) {
|
||||||
const suggestion = suggestions[i];
|
const suggestion = suggestions[i];
|
||||||
console.error(
|
logError(
|
||||||
`%chint: ${suggestion}`,
|
`%chint: ${suggestion}`,
|
||||||
"font-weight: bold;",
|
"font-weight: bold;",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isFromRemoteDependency) {
|
if (isFromRemoteDependency) {
|
||||||
console.error(
|
logError(
|
||||||
`%chint: It appears this API is used by a remote dependency. Try upgrading to the latest version of that dependency.`,
|
`%chint: It appears this API is used by a remote dependency. Try upgrading to the latest version of that dependency.`,
|
||||||
"font-weight: bold;",
|
"font-weight: bold;",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
console.error();
|
logError();
|
||||||
}
|
}
|
||||||
|
|
||||||
function windowClose() {
|
function windowClose() {
|
||||||
@ -716,25 +719,33 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
|
|||||||
|
|
||||||
if (mode === executionModes.serve) {
|
if (mode === executionModes.serve) {
|
||||||
if (serveIsMain && serveWorkerCount) {
|
if (serveIsMain && serveWorkerCount) {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
const origLog = console.log;
|
const origLog = console.log;
|
||||||
|
// deno-lint-ignore no-console
|
||||||
const origError = console.error;
|
const origError = console.error;
|
||||||
const prefix = `[serve-worker-0 ]`;
|
const prefix = `[serve-worker-0 ]`;
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.log = (...args) => {
|
console.log = (...args) => {
|
||||||
return origLog(prefix, ...new primordials.SafeArrayIterator(args));
|
return origLog(prefix, ...new primordials.SafeArrayIterator(args));
|
||||||
};
|
};
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.error = (...args) => {
|
console.error = (...args) => {
|
||||||
return origError(prefix, ...new primordials.SafeArrayIterator(args));
|
return origError(prefix, ...new primordials.SafeArrayIterator(args));
|
||||||
};
|
};
|
||||||
} else if (serveWorkerCount !== null) {
|
} else if (serveWorkerCount !== null) {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
const origLog = console.log;
|
const origLog = console.log;
|
||||||
|
// deno-lint-ignore no-console
|
||||||
const origError = console.error;
|
const origError = console.error;
|
||||||
const base = `serve-worker-${serveWorkerCount + 1}`;
|
const base = `serve-worker-${serveWorkerCount + 1}`;
|
||||||
// 15 = "serve-worker-nn".length, assuming
|
// 15 = "serve-worker-nn".length, assuming
|
||||||
// serveWorkerCount < 100
|
// serveWorkerCount < 100
|
||||||
const prefix = `[${StringPrototypePadEnd(base, 15, " ")}]`;
|
const prefix = `[${StringPrototypePadEnd(base, 15, " ")}]`;
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.log = (...args) => {
|
console.log = (...args) => {
|
||||||
return origLog(prefix, ...new primordials.SafeArrayIterator(args));
|
return origLog(prefix, ...new primordials.SafeArrayIterator(args));
|
||||||
};
|
};
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.error = (...args) => {
|
console.error = (...args) => {
|
||||||
return origError(prefix, ...new primordials.SafeArrayIterator(args));
|
return origError(prefix, ...new primordials.SafeArrayIterator(args));
|
||||||
};
|
};
|
||||||
@ -757,6 +768,7 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
|
|||||||
if (mode === executionModes.serve && !serve) {
|
if (mode === executionModes.serve && !serve) {
|
||||||
if (serveIsMain) {
|
if (serveIsMain) {
|
||||||
// Only error if main worker
|
// Only error if main worker
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.error(
|
console.error(
|
||||||
`%cerror: %cdeno serve requires %cexport default { fetch }%c in the main module, did you mean to run \"deno run\"?`,
|
`%cerror: %cdeno serve requires %cexport default { fetch }%c in the main module, did you mean to run \"deno run\"?`,
|
||||||
"color: yellow;",
|
"color: yellow;",
|
||||||
@ -770,6 +782,7 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
|
|||||||
|
|
||||||
if (serve) {
|
if (serve) {
|
||||||
if (mode === executionModes.run) {
|
if (mode === executionModes.run) {
|
||||||
|
// deno-lint-ignore no-console
|
||||||
console.error(
|
console.error(
|
||||||
`%cwarning: %cDetected %cexport default { fetch }%c, did you mean to run \"deno serve\"?`,
|
`%cwarning: %cDetected %cexport default { fetch }%c, did you mean to run \"deno serve\"?`,
|
||||||
"color: yellow;",
|
"color: yellow;",
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
const targetDir = Deno.execPath().replace(/[^\/\\]+$/, "");
|
const targetDir = Deno.execPath().replace(/[^\/\\]+$/, "");
|
||||||
const [libPrefix, libSuffix] = {
|
const [libPrefix, libSuffix] = {
|
||||||
darwin: ["lib", "dylib"],
|
darwin: ["lib", "dylib"],
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
const targetDir = Deno.execPath().replace(/[^\/\\]+$/, "");
|
const targetDir = Deno.execPath().replace(/[^\/\\]+$/, "");
|
||||||
const [libPrefix, libSuffix] = {
|
const [libPrefix, libSuffix] = {
|
||||||
darwin: ["lib", "dylib"],
|
darwin: ["lib", "dylib"],
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import { assertEquals, loadTestLibrary } from "./common.js";
|
import { assertEquals, loadTestLibrary } from "./common.js";
|
||||||
|
|
||||||
const properties = loadTestLibrary();
|
const properties = loadTestLibrary();
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env -S deno run --allow-read=. --allow-write=. --allow-run=git --config=tests/config/deno.json
|
#!/usr/bin/env -S deno run --allow-read=. --allow-write=. --allow-run=git --config=tests/config/deno.json
|
||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
/** This copies the test files according to the config file `tests/node_compat/config.jsonc` */
|
/** This copies the test files according to the config file `tests/node_compat/config.jsonc` */
|
||||||
|
|
||||||
import { walk } from "@std/fs/walk";
|
import { walk } from "@std/fs/walk";
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This script will run the test files specified in the configuration file.
|
* This script will run the test files specified in the configuration file.
|
||||||
*
|
*
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
const assert = require("assert");
|
const assert = require("assert");
|
||||||
// TODO(kt3k): Uncomment this when util.debuglog is added
|
const debug = require('util').debuglog('test');
|
||||||
// const debug = require('util').debuglog('test');
|
|
||||||
const debug = console.log;
|
|
||||||
|
|
||||||
function onmessage(m) {
|
function onmessage(m) {
|
||||||
debug("CHILD got message:", m);
|
debug("CHILD got message:", m);
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
// std/fmt/colors auto determines whether to put colors in or not. We need
|
// std/fmt/colors auto determines whether to put colors in or not. We need
|
||||||
// better infrastructure here so we can properly test the colors.
|
// better infrastructure here so we can properly test the colors.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import {
|
import {
|
||||||
assert,
|
assert,
|
||||||
assertEquals,
|
assertEquals,
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import {
|
import {
|
||||||
assert,
|
assert,
|
||||||
assertEquals,
|
assertEquals,
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import { assertMatch, assertRejects } from "@std/assert";
|
import { assertMatch, assertRejects } from "@std/assert";
|
||||||
import { Buffer, BufReader, BufWriter } from "@std/io";
|
import { Buffer, BufReader, BufWriter } from "@std/io";
|
||||||
import { TextProtoReader } from "../testdata/run/textproto.ts";
|
import { TextProtoReader } from "../testdata/run/textproto.ts";
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import {
|
import {
|
||||||
assert,
|
assert,
|
||||||
assertEquals,
|
assertEquals,
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
// Requires to be run with `--allow-net` flag
|
// Requires to be run with `--allow-net` flag
|
||||||
|
|
||||||
import { assert, assertEquals, assertMatch, assertThrows } from "@std/assert";
|
import { assert, assertEquals, assertMatch, assertThrows } from "@std/assert";
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import { write, writeSync } from "node:fs";
|
import { write, writeSync } from "node:fs";
|
||||||
import { assertEquals } from "@std/assert";
|
import { assertEquals } from "@std/assert";
|
||||||
import { Buffer } from "node:buffer";
|
import { Buffer } from "node:buffer";
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import * as http2 from "node:http2";
|
import * as http2 from "node:http2";
|
||||||
import { Buffer } from "node:buffer";
|
import { Buffer } from "node:buffer";
|
||||||
import { readFile } from "node:fs/promises";
|
import { readFile } from "node:fs/promises";
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import EventEmitter from "node:events";
|
import EventEmitter from "node:events";
|
||||||
import http, { type RequestOptions, type ServerResponse } from "node:http";
|
import http, { type RequestOptions, type ServerResponse } from "node:http";
|
||||||
import url from "node:url";
|
import url from "node:url";
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import * as net from "node:net";
|
import * as net from "node:net";
|
||||||
import { assert, assertEquals } from "@std/assert";
|
import { assert, assertEquals } from "@std/assert";
|
||||||
import * as path from "@std/path";
|
import * as path from "@std/path";
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// deno-lint-ignore-file no-undef
|
|
||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-undef no-console
|
||||||
|
|
||||||
import process, {
|
import process, {
|
||||||
arch as importedArch,
|
arch as importedArch,
|
||||||
argv,
|
argv,
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env -S deno run --allow-write --allow-read --allow-net --allow-env --allow-run --config=tests/config/deno.json
|
#!/usr/bin/env -S deno run --allow-write --allow-read --allow-net --allow-env --allow-run --config=tests/config/deno.json
|
||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
// This script is used to run WPT tests for Deno.
|
// This script is used to run WPT tests for Deno.
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env -S deno run --allow-read=. --allow-run=git --config=tests/config/deno.json
|
#!/usr/bin/env -S deno run --allow-read=. --allow-run=git --config=tests/config/deno.json
|
||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import { getSources, ROOT_PATH } from "./util.js";
|
import { getSources, ROOT_PATH } from "./util.js";
|
||||||
|
|
||||||
const copyrightYear = 2024;
|
const copyrightYear = 2024;
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#!/usr/bin/env -S deno run --allow-write --allow-read --allow-run --allow-net --config=tests/config/deno.json
|
#!/usr/bin/env -S deno run --allow-write --allow-read --allow-run --allow-net --config=tests/config/deno.json
|
||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import { buildMode, getPrebuilt, getSources, join, ROOT_PATH } from "./util.js";
|
import { buildMode, getPrebuilt, getSources, join, ROOT_PATH } from "./util.js";
|
||||||
import { checkCopyright } from "./copyright_checker.js";
|
import { checkCopyright } from "./copyright_checker.js";
|
||||||
import * as ciFile from "../.github/workflows/ci.generate.ts";
|
import * as ciFile from "../.github/workflows/ci.generate.ts";
|
||||||
@ -44,27 +47,19 @@ async function dlint() {
|
|||||||
"*.js",
|
"*.js",
|
||||||
"*.ts",
|
"*.ts",
|
||||||
":!:.github/mtime_cache/action.js",
|
":!:.github/mtime_cache/action.js",
|
||||||
":!:tests/testdata/swc_syntax_error.ts",
|
|
||||||
":!:tests/testdata/error_008_checkjs.js",
|
|
||||||
":!:cli/bench/testdata/npm/*",
|
":!:cli/bench/testdata/npm/*",
|
||||||
":!:cli/bench/testdata/express-router.js",
|
":!:cli/bench/testdata/express-router.js",
|
||||||
":!:cli/bench/testdata/react-dom.js",
|
":!:cli/bench/testdata/react-dom.js",
|
||||||
":!:cli/compilers/wasm_wrap.js",
|
":!:cli/compilers/wasm_wrap.js",
|
||||||
":!:cli/tsc/dts/**",
|
":!:cli/tsc/dts/**",
|
||||||
|
":!:cli/tsc/*typescript.js",
|
||||||
|
":!:cli/tsc/compiler.d.ts",
|
||||||
|
":!:runtime/examples/",
|
||||||
":!:target/",
|
":!:target/",
|
||||||
":!:tests/registry/**",
|
":!:tests/registry/**",
|
||||||
":!:tests/specs/**",
|
":!:tests/specs/**",
|
||||||
":!:tests/testdata/encoding/**",
|
":!:tests/testdata/**",
|
||||||
":!:tests/testdata/error_syntax.js",
|
":!:tests/unit_node/testdata/**",
|
||||||
":!:tests/testdata/file_extensions/ts_with_js_extension.js",
|
|
||||||
":!:tests/testdata/fmt/**",
|
|
||||||
":!:tests/testdata/lint/**",
|
|
||||||
":!:tests/testdata/npm/**",
|
|
||||||
":!:tests/testdata/run/**",
|
|
||||||
":!:tests/testdata/tsc/**",
|
|
||||||
":!:tests/testdata/test/glob/**",
|
|
||||||
":!:cli/tsc/*typescript.js",
|
|
||||||
":!:cli/tsc/compiler.d.ts",
|
|
||||||
":!:tests/wpt/suite/**",
|
":!:tests/wpt/suite/**",
|
||||||
":!:tests/wpt/runner/**",
|
":!:tests/wpt/runner/**",
|
||||||
]);
|
]);
|
||||||
@ -93,7 +88,7 @@ async function dlint() {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
await Promise.all(pending);
|
await Promise.allSettled(pending);
|
||||||
}
|
}
|
||||||
|
|
||||||
// `prefer-primordials` has to apply only to files related to bootstrapping,
|
// `prefer-primordials` has to apply only to files related to bootstrapping,
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#!/usr/bin/env -S deno run -A --quiet --lock=tools/deno.lock.json
|
#!/usr/bin/env -S deno run -A --quiet --lock=tools/deno.lock.json
|
||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import { $, createOctoKit, semver } from "./deps.ts";
|
import { $, createOctoKit, semver } from "./deps.ts";
|
||||||
|
|
||||||
const currentDirPath = $.path(import.meta).parentOrThrow();
|
const currentDirPath = $.path(import.meta).parentOrThrow();
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#!/usr/bin/env -S deno run -A --lock=tools/deno.lock.json
|
#!/usr/bin/env -S deno run -A --lock=tools/deno.lock.json
|
||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import { DenoWorkspace } from "./deno_workspace.ts";
|
import { DenoWorkspace } from "./deno_workspace.ts";
|
||||||
import { $, getCratesPublishOrder } from "./deps.ts";
|
import { $, getCratesPublishOrder } from "./deps.ts";
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env -S deno run -A --lock=tools/deno.lock.json
|
#!/usr/bin/env -S deno run -A --lock=tools/deno.lock.json
|
||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import { $ } from "jsr:@david/dax@0.41.0";
|
import { $ } from "jsr:@david/dax@0.41.0";
|
||||||
import { gray } from "jsr:@std/fmt@1/colors";
|
import { gray } from "jsr:@std/fmt@1/colors";
|
||||||
import { patchver } from "jsr:@deno/patchver@0.1.0";
|
import { patchver } from "jsr:@deno/patchver@0.1.0";
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
// passed, will automatically add a status check to the commit with a link to
|
// passed, will automatically add a status check to the commit with a link to
|
||||||
// the wpt.fyi page.
|
// the wpt.fyi page.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import { gzip } from "https://deno.land/x/compress@v0.4.1/gzip/mod.ts";
|
import { gzip } from "https://deno.land/x/compress@v0.4.1/gzip/mod.ts";
|
||||||
|
|
||||||
const user = Deno.env.get("WPT_FYI_USER");
|
const user = Deno.env.get("WPT_FYI_USER");
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
import { dirname, fromFileUrl, join, resolve, toFileUrl } from "@std/path";
|
import { dirname, fromFileUrl, join, resolve, toFileUrl } from "@std/path";
|
||||||
import { wait } from "https://deno.land/x/wait@0.1.13/mod.ts";
|
import { wait } from "https://deno.land/x/wait@0.1.13/mod.ts";
|
||||||
export { dirname, fromFileUrl, join, resolve, toFileUrl };
|
export { dirname, fromFileUrl, join, resolve, toFileUrl };
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-console
|
||||||
|
|
||||||
const prTitle = Deno.args[0];
|
const prTitle = Deno.args[0];
|
||||||
|
|
||||||
if (prTitle == null) {
|
if (prTitle == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user