summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-08-20 15:14:37 -0400
committerGitHub <noreply@github.com>2024-08-20 15:14:37 -0400
commita7c002ae634b20a2f84c90417327a88c9ac2df99 (patch)
treec21a179412ee70f59eb0c38acfbe5d4998870224
parent2f47b4d1fd8e37a5e45bc1b8f3623708e0f95e2e (diff)
chore: enable no-console dlint rule (#25113)
-rw-r--r--.dlint.json1
-rw-r--r--cli/bench/console.js3
-rw-r--r--cli/bench/encode_into.js3
-rw-r--r--cli/bench/getrandom.js3
-rw-r--r--cli/bench/http/deno_tcp.ts1
-rw-r--r--cli/bench/op_now.js3
-rw-r--r--cli/bench/secure_curves.js3
-rw-r--r--cli/bench/stdio/stdio.js2
-rw-r--r--cli/bench/tty.js3
-rw-r--r--cli/bench/url_parse.js3
-rw-r--r--cli/bench/webstorage.js2
-rw-r--r--cli/bench/write_file.js3
-rw-r--r--ext/cron/01_cron.ts1
-rw-r--r--ext/http/00_serve.ts7
-rw-r--r--ext/kv/01_db.ts1
-rw-r--r--ext/node/polyfills/_utils.ts1
-rw-r--r--ext/node/polyfills/http.ts1
-rw-r--r--ext/node/polyfills/http2.ts4
-rw-r--r--ext/node/polyfills/internal/util/debuglog.ts2
-rw-r--r--ext/node/polyfills/testing.ts1
-rw-r--r--ext/node/polyfills/util.ts1
-rw-r--r--ext/node/polyfills/worker_threads.ts2
-rw-r--r--ext/web/06_streams.js1
-rw-r--r--runtime/js/99_main.js35
-rw-r--r--tests/ffi/tests/event_loop_integration.ts2
-rw-r--r--tests/ffi/tests/ffi_callback_errors.ts2
-rw-r--r--tests/napi/cleanup_hook_test.js2
-rwxr-xr-xtests/node_compat/runner/setup.ts2
-rw-r--r--tests/node_compat/test.ts2
-rw-r--r--tests/node_compat/test/fixtures/child-process-spawn-node.js4
-rw-r--r--tests/unit/console_test.ts2
-rw-r--r--tests/unit/fetch_test.ts3
-rw-r--r--tests/unit/serve_test.ts2
-rw-r--r--tests/unit/timers_test.ts3
-rw-r--r--tests/unit/worker_test.ts2
-rw-r--r--tests/unit_node/_fs/_fs_write_test.ts3
-rw-r--r--tests/unit_node/http2_test.ts2
-rw-r--r--tests/unit_node/http_test.ts2
-rw-r--r--tests/unit_node/net_test.ts2
-rw-r--r--tests/unit_node/process_test.ts3
-rwxr-xr-xtests/wpt/wpt.ts2
-rwxr-xr-xtools/copyright_checker.js2
-rwxr-xr-xtools/lint.js23
-rwxr-xr-xtools/release/00_start_release.ts3
-rwxr-xr-xtools/release/03_publish_crates.ts3
-rw-r--r--tools/release/promote_to_rc.ts2
-rw-r--r--tools/upload_wptfyi.js2
-rw-r--r--tools/util.js3
-rw-r--r--tools/verify_pr_title.js3
49 files changed, 138 insertions, 30 deletions
diff --git a/.dlint.json b/.dlint.json
index d25defffb..f84d2b233 100644
--- a/.dlint.json
+++ b/.dlint.json
@@ -4,6 +4,7 @@
"include": [
"ban-untagged-todo",
"camelcase",
+ "no-console",
"guard-for-in"
],
"exclude": [
diff --git a/cli/bench/console.js b/cli/bench/console.js
index 947061a3b..1d336fbbd 100644
--- a/cli/bench/console.js
+++ b/cli/bench/console.js
@@ -1,3 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-console
+
const count = 100000;
for (let i = 0; i < count; i++) console.log("Hello World");
diff --git a/cli/bench/encode_into.js b/cli/bench/encode_into.js
index 4881f8752..11f5a56d9 100644
--- a/cli/bench/encode_into.js
+++ b/cli/bench/encode_into.js
@@ -1,4 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-console
+
let [total, count] = typeof Deno !== "undefined"
? Deno.args
: [process.argv[2], process.argv[3]];
diff --git a/cli/bench/getrandom.js b/cli/bench/getrandom.js
index 87149afeb..3c3ec4aa1 100644
--- a/cli/bench/getrandom.js
+++ b/cli/bench/getrandom.js
@@ -1,4 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-console
+
let [total, count] = typeof Deno !== "undefined"
? Deno.args
: [process.argv[2], process.argv[3]];
diff --git a/cli/bench/http/deno_tcp.ts b/cli/bench/http/deno_tcp.ts
index bac9ac497..b79591073 100644
--- a/cli/bench/http/deno_tcp.ts
+++ b/cli/bench/http/deno_tcp.ts
@@ -3,6 +3,7 @@
// TODO(bartlomieju): Replace this with a real HTTP server once
// https://github.com/denoland/deno/issues/726 is completed.
// Note: this is a keep-alive server.
+// deno-lint-ignore-file no-console
const addr = Deno.args[0] || "127.0.0.1:4500";
const [hostname, port] = addr.split(":");
const listener = Deno.listen({ hostname, port: Number(port) });
diff --git a/cli/bench/op_now.js b/cli/bench/op_now.js
index ba6be9c3a..bcc3ea3c5 100644
--- a/cli/bench/op_now.js
+++ b/cli/bench/op_now.js
@@ -1,4 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-console
+
const queueMicrotask = globalThis.queueMicrotask || process.nextTick;
let [total, count] = typeof Deno !== "undefined"
? Deno.args
diff --git a/cli/bench/secure_curves.js b/cli/bench/secure_curves.js
index d1e909c4c..02d248b23 100644
--- a/cli/bench/secure_curves.js
+++ b/cli/bench/secure_curves.js
@@ -1,4 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-console
+
let [total, count] = typeof Deno !== "undefined"
? Deno.args
: [process.argv[2], process.argv[3]];
diff --git a/cli/bench/stdio/stdio.js b/cli/bench/stdio/stdio.js
index 7f0e16b4a..81bea835a 100644
--- a/cli/bench/stdio/stdio.js
+++ b/cli/bench/stdio/stdio.js
@@ -2,6 +2,8 @@
//
// 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 buf = new Uint8Array(blocksize);
let size = 0;
diff --git a/cli/bench/tty.js b/cli/bench/tty.js
index 62319c71f..248a90113 100644
--- a/cli/bench/tty.js
+++ b/cli/bench/tty.js
@@ -1,4 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-console
+
const queueMicrotask = globalThis.queueMicrotask || process.nextTick;
let [total, count] = typeof Deno !== "undefined"
? Deno.args
diff --git a/cli/bench/url_parse.js b/cli/bench/url_parse.js
index c9b62107f..367cf73f4 100644
--- a/cli/bench/url_parse.js
+++ b/cli/bench/url_parse.js
@@ -1,4 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-console
+
const queueMicrotask = globalThis.queueMicrotask || process.nextTick;
let [total, count] = typeof Deno !== "undefined"
? Deno.args
diff --git a/cli/bench/webstorage.js b/cli/bench/webstorage.js
index b200ef253..d19f024c6 100644
--- a/cli/bench/webstorage.js
+++ b/cli/bench/webstorage.js
@@ -1,5 +1,7 @@
// 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
// the DENO_DIR cache.
let [total, count] = typeof Deno !== "undefined" ? Deno.args : [];
diff --git a/cli/bench/write_file.js b/cli/bench/write_file.js
index ab1e2280e..104a23a8d 100644
--- a/cli/bench/write_file.js
+++ b/cli/bench/write_file.js
@@ -1,4 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-console
+
const queueMicrotask = globalThis.queueMicrotask || process.nextTick;
let [total, count] = typeof Deno !== "undefined"
? Deno.args
diff --git a/ext/cron/01_cron.ts b/ext/cron/01_cron.ts
index 7592e75ef..017da8ae2 100644
--- a/ext/cron/01_cron.ts
+++ b/ext/cron/01_cron.ts
@@ -157,6 +157,7 @@ function cron(
const _res = isPromise(result) ? (await result) : result;
success = true;
} catch (error) {
+ // deno-lint-ignore no-console
console.error(`Exception in cron handler ${name}`, error);
success = false;
}
diff --git a/ext/http/00_serve.ts b/ext/http/00_serve.ts
index 9c6f80552..02910d580 100644
--- a/ext/http/00_serve.ts
+++ b/ext/http/00_serve.ts
@@ -525,6 +525,7 @@ function mapToCallback(context, callback, onError) {
);
}
} catch (error) {
+ // deno-lint-ignore no-console
console.error("Exception in onError while handling exception", error);
response = internalServerError();
}
@@ -533,6 +534,7 @@ function mapToCallback(context, callback, onError) {
if (innerRequest?.[_upgraded]) {
// We're done here as the connection has been upgraded during the callback and no longer requires servicing.
if (response !== UPGRADE_RESPONSE_SENTINEL) {
+ // deno-lint-ignore no-console
console.error("Upgrade response was not returned from callback");
context.close();
}
@@ -612,6 +614,7 @@ function serve(arg1, arg2) {
const wantsUnix = ObjectHasOwn(options, "path");
const signal = options.signal;
const onError = options.onError ?? function (error) {
+ // deno-lint-ignore no-console
console.error(error);
return internalServerError();
};
@@ -627,6 +630,7 @@ function serve(arg1, arg2) {
if (options.onListen) {
options.onListen(listener.addr);
} else {
+ // deno-lint-ignore no-console
console.log(`Listening on ${path}`);
}
});
@@ -684,6 +688,7 @@ function serve(arg1, arg2) {
const host = StringPrototypeIncludes(addr.hostname, ":")
? `[${addr.hostname}]`
: addr.hostname;
+ // deno-lint-ignore no-console
console.log(`Listening on ${scheme}${host}:${addr.port}/`);
}
};
@@ -729,6 +734,7 @@ function serveHttpOn(context, addr, callback) {
const promiseErrorHandler = (error) => {
// Abnormal exit
+ // deno-lint-ignore no-console
console.error(
"Terminating Deno.serve loop due to unexpected error",
error,
@@ -856,6 +862,7 @@ function registerDeclarativeServer(exports) {
const nThreads = serveWorkerCount > 1
? ` with ${serveWorkerCount} threads`
: "";
+ // deno-lint-ignore no-console
console.debug(
`%cdeno serve%c: Listening on %chttp://${hostname}:${port}/%c${nThreads}`,
"color: green",
diff --git a/ext/kv/01_db.ts b/ext/kv/01_db.ts
index 9aa2036dd..418ce3ff2 100644
--- a/ext/kv/01_db.ts
+++ b/ext/kv/01_db.ts
@@ -318,6 +318,7 @@ class Kv {
const _res = isPromise(result) ? (await result) : result;
success = true;
} catch (error) {
+ // deno-lint-ignore no-console
console.error("Exception in queue handler", error);
} finally {
const promise: Promise<void> = op_kv_finish_dequeued_message(
diff --git a/ext/node/polyfills/_utils.ts b/ext/node/polyfills/_utils.ts
index 78b9bdddc..b50c113e1 100644
--- a/ext/node/polyfills/_utils.ts
+++ b/ext/node/polyfills/_utils.ts
@@ -42,6 +42,7 @@ export function warnNotImplemented(msg?: string) {
const message = msg
? `Warning: Not implemented: ${msg}`
: "Warning: Not implemented";
+ // deno-lint-ignore no-console
console.warn(message);
}
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts
index 920f3a5b0..76291490e 100644
--- a/ext/node/polyfills/http.ts
+++ b/ext/node/polyfills/http.ts
@@ -1836,6 +1836,7 @@ export class ServerImpl extends EventEmitter {
}
setTimeout() {
+ // deno-lint-ignore no-console
console.error("Not implemented: Server.setTimeout()");
}
diff --git a/ext/node/polyfills/http2.ts b/ext/node/polyfills/http2.ts
index baa2c6e21..98edf40f4 100644
--- a/ext/node/polyfills/http2.ts
+++ b/ext/node/polyfills/http2.ts
@@ -127,6 +127,7 @@ type Http2Headers = Record<string, string | string[]>;
const debugHttp2Enabled = false;
function debugHttp2(...args) {
if (debugHttp2Enabled) {
+ // deno-lint-ignore no-console
console.log(...args);
}
}
@@ -1636,16 +1637,19 @@ export class Http2Server extends Server {
this.emit("stream", stream, headers);
return await stream._deferred.promise;
} catch (e) {
+ // deno-lint-ignore no-console
console.log(">>> Error in serveHttpOnConnection", e);
}
return new Response("");
},
() => {
+ // deno-lint-ignore no-console
console.log(">>> error");
},
() => {},
);
} catch (e) {
+ // deno-lint-ignore no-console
console.log(">>> Error in Http2Server", e);
}
},
diff --git a/ext/node/polyfills/internal/util/debuglog.ts b/ext/node/polyfills/internal/util/debuglog.ts
index 9bbaed606..bbaba7b6f 100644
--- a/ext/node/polyfills/internal/util/debuglog.ts
+++ b/ext/node/polyfills/internal/util/debuglog.ts
@@ -30,6 +30,7 @@ export function initializeDebugEnv(debugEnv: string) {
// NODE_DEBUG=http or NODE_DEBUG=http2.
function emitWarningIfNeeded(set: string) {
if ("HTTP" === set || "HTTP2" === set) {
+ // deno-lint-ignore no-console
console.warn(
"Setting the NODE_DEBUG environment variable " +
"to '" + set.toLowerCase() + "' can expose sensitive " +
@@ -50,6 +51,7 @@ function debuglogImpl(
emitWarningIfNeeded(set);
debugImpls[set] = function debug(...args: unknown[]) {
const msg = args.map((arg) => inspect(arg)).join(" ");
+ // deno-lint-ignore no-console
console.error("%s %s: %s", set, String(Deno.pid), msg);
};
} else {
diff --git a/ext/node/polyfills/testing.ts b/ext/node/polyfills/testing.ts
index 92900e632..901c38ed3 100644
--- a/ext/node/polyfills/testing.ts
+++ b/ext/node/polyfills/testing.ts
@@ -28,6 +28,7 @@ class NodeTestContext {
}
diagnostic(message) {
+ // deno-lint-ignore no-console
console.log("DIAGNOSTIC:", message);
}
diff --git a/ext/node/polyfills/util.ts b/ext/node/polyfills/util.ts
index eee171ccf..cb4e6498a 100644
--- a/ext/node/polyfills/util.ts
+++ b/ext/node/polyfills/util.ts
@@ -234,6 +234,7 @@ function timestamp(): string {
*/
// deno-lint-ignore no-explicit-any
export function log(...args: any[]) {
+ // deno-lint-ignore no-console
console.log("%s - %s", timestamp(), ReflectApply(format, undefined, args));
}
diff --git a/ext/node/polyfills/worker_threads.ts b/ext/node/polyfills/worker_threads.ts
index 3519ae217..eaabe9cd7 100644
--- a/ext/node/polyfills/worker_threads.ts
+++ b/ext/node/polyfills/worker_threads.ts
@@ -47,7 +47,7 @@ const {
const debugWorkerThreads = false;
function debugWT(...args) {
if (debugWorkerThreads) {
- // deno-lint-ignore prefer-primordials
+ // deno-lint-ignore prefer-primordials no-console
console.log(...args);
}
}
diff --git a/ext/web/06_streams.js b/ext/web/06_streams.js
index ea3a3110f..69d333c0d 100644
--- a/ext/web/06_streams.js
+++ b/ext/web/06_streams.js
@@ -164,6 +164,7 @@ function resolvePromiseWith(value) {
function rethrowAssertionErrorRejection(e) {
if (e && ObjectPrototypeIsPrototypeOf(AssertionError.prototype, e)) {
queueMicrotask(() => {
+ // deno-lint-ignore no-console
console.error(`Internal Error: ${e.stack}`);
});
}
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js
index 013f4996f..8b0d579ab 100644
--- a/runtime/js/99_main.js
+++ b/runtime/js/99_main.js
@@ -125,12 +125,15 @@ function warnOnDeprecatedApi(apiName, stack, ...suggestions) {
return;
}
+ // deno-lint-ignore no-console
+ const logError = console.error;
+
if (!verboseDeprecatedApiWarning) {
if (ALREADY_WARNED_DEPRECATED.has(apiName)) {
return;
}
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.`,
"color: yellow;",
"font-weight: bold;",
@@ -176,40 +179,40 @@ function warnOnDeprecatedApi(apiName, stack, ...suggestions) {
}
ALREADY_WARNED_DEPRECATED.add(apiName + stack);
- console.error(
+ logError(
`%cwarning: %cUse of deprecated "${apiName}" API. This API will be removed in Deno 2.`,
"color: yellow;",
"font-weight: bold;",
);
- console.error();
- console.error(
+ logError();
+ logError(
"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) {
- console.error("Stack trace:");
+ logError("Stack trace:");
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++) {
const suggestion = suggestions[i];
- console.error(
+ logError(
`%chint: ${suggestion}`,
"font-weight: bold;",
);
}
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.`,
"font-weight: bold;",
);
}
- console.error();
+ logError();
}
function windowClose() {
@@ -716,25 +719,33 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
if (mode === executionModes.serve) {
if (serveIsMain && serveWorkerCount) {
+ // deno-lint-ignore no-console
const origLog = console.log;
+ // deno-lint-ignore no-console
const origError = console.error;
const prefix = `[serve-worker-0 ]`;
+ // deno-lint-ignore no-console
console.log = (...args) => {
return origLog(prefix, ...new primordials.SafeArrayIterator(args));
};
+ // deno-lint-ignore no-console
console.error = (...args) => {
return origError(prefix, ...new primordials.SafeArrayIterator(args));
};
} else if (serveWorkerCount !== null) {
+ // deno-lint-ignore no-console
const origLog = console.log;
+ // deno-lint-ignore no-console
const origError = console.error;
const base = `serve-worker-${serveWorkerCount + 1}`;
// 15 = "serve-worker-nn".length, assuming
// serveWorkerCount < 100
const prefix = `[${StringPrototypePadEnd(base, 15, " ")}]`;
+ // deno-lint-ignore no-console
console.log = (...args) => {
return origLog(prefix, ...new primordials.SafeArrayIterator(args));
};
+ // deno-lint-ignore no-console
console.error = (...args) => {
return origError(prefix, ...new primordials.SafeArrayIterator(args));
};
@@ -757,6 +768,7 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
if (mode === executionModes.serve && !serve) {
if (serveIsMain) {
// Only error if main worker
+ // deno-lint-ignore no-console
console.error(
`%cerror: %cdeno serve requires %cexport default { fetch }%c in the main module, did you mean to run \"deno run\"?`,
"color: yellow;",
@@ -770,6 +782,7 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
if (serve) {
if (mode === executionModes.run) {
+ // deno-lint-ignore no-console
console.error(
`%cwarning: %cDetected %cexport default { fetch }%c, did you mean to run \"deno serve\"?`,
"color: yellow;",
diff --git a/tests/ffi/tests/event_loop_integration.ts b/tests/ffi/tests/event_loop_integration.ts
index d9ada6027..e3914d966 100644
--- a/tests/ffi/tests/event_loop_integration.ts
+++ b/tests/ffi/tests/event_loop_integration.ts
@@ -1,5 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+// deno-lint-ignore-file no-console
+
const targetDir = Deno.execPath().replace(/[^\/\\]+$/, "");
const [libPrefix, libSuffix] = {
darwin: ["lib", "dylib"],
diff --git a/tests/ffi/tests/ffi_callback_errors.ts b/tests/ffi/tests/ffi_callback_errors.ts
index dbd60636c..797ff236c 100644
--- a/tests/ffi/tests/ffi_callback_errors.ts
+++ b/tests/ffi/tests/ffi_callback_errors.ts
@@ -1,5 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+// deno-lint-ignore-file no-console
+
const targetDir = Deno.execPath().replace(/[^\/\\]+$/, "");
const [libPrefix, libSuffix] = {
darwin: ["lib", "dylib"],
diff --git a/tests/napi/cleanup_hook_test.js b/tests/napi/cleanup_hook_test.js
index 0d83bc5b4..017674ad4 100644
--- a/tests/napi/cleanup_hook_test.js
+++ b/tests/napi/cleanup_hook_test.js
@@ -1,5 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+// deno-lint-ignore-file no-console
+
import { assertEquals, loadTestLibrary } from "./common.js";
const properties = loadTestLibrary();
diff --git a/tests/node_compat/runner/setup.ts b/tests/node_compat/runner/setup.ts
index 95fee6a20..37f1aba9b 100755
--- a/tests/node_compat/runner/setup.ts
+++ b/tests/node_compat/runner/setup.ts
@@ -1,6 +1,8 @@
#!/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.
+// deno-lint-ignore-file no-console
+
/** This copies the test files according to the config file `tests/node_compat/config.jsonc` */
import { walk } from "@std/fs/walk";
diff --git a/tests/node_compat/test.ts b/tests/node_compat/test.ts
index b5c9514a3..f6db4ee1a 100644
--- a/tests/node_compat/test.ts
+++ b/tests/node_compat/test.ts
@@ -1,5 +1,7 @@
// 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.
*
diff --git a/tests/node_compat/test/fixtures/child-process-spawn-node.js b/tests/node_compat/test/fixtures/child-process-spawn-node.js
index da2b557c9..d403aabf9 100644
--- a/tests/node_compat/test/fixtures/child-process-spawn-node.js
+++ b/tests/node_compat/test/fixtures/child-process-spawn-node.js
@@ -1,7 +1,5 @@
const assert = require("assert");
-// TODO(kt3k): Uncomment this when util.debuglog is added
-// const debug = require('util').debuglog('test');
-const debug = console.log;
+const debug = require('util').debuglog('test');
function onmessage(m) {
debug("CHILD got message:", m);
diff --git a/tests/unit/console_test.ts b/tests/unit/console_test.ts
index c13362419..63ffff0dc 100644
--- a/tests/unit/console_test.ts
+++ b/tests/unit/console_test.ts
@@ -8,6 +8,8 @@
// std/fmt/colors auto determines whether to put colors in or not. We need
// better infrastructure here so we can properly test the colors.
+// deno-lint-ignore-file no-console
+
import {
assert,
assertEquals,
diff --git a/tests/unit/fetch_test.ts b/tests/unit/fetch_test.ts
index 9b2463bcc..aa4ff3067 100644
--- a/tests/unit/fetch_test.ts
+++ b/tests/unit/fetch_test.ts
@@ -1,4 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-console
+
import {
assert,
assertEquals,
diff --git a/tests/unit/serve_test.ts b/tests/unit/serve_test.ts
index 353621154..827a094dc 100644
--- a/tests/unit/serve_test.ts
+++ b/tests/unit/serve_test.ts
@@ -1,5 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+// deno-lint-ignore-file no-console
+
import { assertMatch, assertRejects } from "@std/assert";
import { Buffer, BufReader, BufWriter } from "@std/io";
import { TextProtoReader } from "../testdata/run/textproto.ts";
diff --git a/tests/unit/timers_test.ts b/tests/unit/timers_test.ts
index 6e829c07f..70619ae35 100644
--- a/tests/unit/timers_test.ts
+++ b/tests/unit/timers_test.ts
@@ -1,4 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-console
+
import {
assert,
assertEquals,
diff --git a/tests/unit/worker_test.ts b/tests/unit/worker_test.ts
index 526618d54..e5966348f 100644
--- a/tests/unit/worker_test.ts
+++ b/tests/unit/worker_test.ts
@@ -1,5 +1,7 @@
// 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
import { assert, assertEquals, assertMatch, assertThrows } from "@std/assert";
diff --git a/tests/unit_node/_fs/_fs_write_test.ts b/tests/unit_node/_fs/_fs_write_test.ts
index a140548e1..2b07d600b 100644
--- a/tests/unit_node/_fs/_fs_write_test.ts
+++ b/tests/unit_node/_fs/_fs_write_test.ts
@@ -1,4 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-console
+
import { write, writeSync } from "node:fs";
import { assertEquals } from "@std/assert";
import { Buffer } from "node:buffer";
diff --git a/tests/unit_node/http2_test.ts b/tests/unit_node/http2_test.ts
index 7cffd0432..8e98bd28d 100644
--- a/tests/unit_node/http2_test.ts
+++ b/tests/unit_node/http2_test.ts
@@ -1,5 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+// deno-lint-ignore-file no-console
+
import * as http2 from "node:http2";
import { Buffer } from "node:buffer";
import { readFile } from "node:fs/promises";
diff --git a/tests/unit_node/http_test.ts b/tests/unit_node/http_test.ts
index ec20ec7d7..2043a0004 100644
--- a/tests/unit_node/http_test.ts
+++ b/tests/unit_node/http_test.ts
@@ -1,5 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+// deno-lint-ignore-file no-console
+
import EventEmitter from "node:events";
import http, { type RequestOptions, type ServerResponse } from "node:http";
import url from "node:url";
diff --git a/tests/unit_node/net_test.ts b/tests/unit_node/net_test.ts
index 521de1e73..f49ff0ef0 100644
--- a/tests/unit_node/net_test.ts
+++ b/tests/unit_node/net_test.ts
@@ -1,5 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+// deno-lint-ignore-file no-console
+
import * as net from "node:net";
import { assert, assertEquals } from "@std/assert";
import * as path from "@std/path";
diff --git a/tests/unit_node/process_test.ts b/tests/unit_node/process_test.ts
index cc9e4dbd4..a647b0369 100644
--- a/tests/unit_node/process_test.ts
+++ b/tests/unit_node/process_test.ts
@@ -1,6 +1,7 @@
-// deno-lint-ignore-file no-undef
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+// deno-lint-ignore-file no-undef no-console
+
import process, {
arch as importedArch,
argv,
diff --git a/tests/wpt/wpt.ts b/tests/wpt/wpt.ts
index 8879de133..c42ff51e6 100755
--- a/tests/wpt/wpt.ts
+++ b/tests/wpt/wpt.ts
@@ -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
// 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.
import {
diff --git a/tools/copyright_checker.js b/tools/copyright_checker.js
index 3c46f3b1e..24afe1dfd 100755
--- a/tools/copyright_checker.js
+++ b/tools/copyright_checker.js
@@ -1,6 +1,8 @@
#!/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.
+// deno-lint-ignore-file no-console
+
import { getSources, ROOT_PATH } from "./util.js";
const copyrightYear = 2024;
diff --git a/tools/lint.js b/tools/lint.js
index aa02a3e2b..8c2e0f594 100755
--- a/tools/lint.js
+++ b/tools/lint.js
@@ -1,5 +1,8 @@
#!/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.
+
+// deno-lint-ignore-file no-console
+
import { buildMode, getPrebuilt, getSources, join, ROOT_PATH } from "./util.js";
import { checkCopyright } from "./copyright_checker.js";
import * as ciFile from "../.github/workflows/ci.generate.ts";
@@ -44,27 +47,19 @@ async function dlint() {
"*.js",
"*.ts",
":!:.github/mtime_cache/action.js",
- ":!:tests/testdata/swc_syntax_error.ts",
- ":!:tests/testdata/error_008_checkjs.js",
":!:cli/bench/testdata/npm/*",
":!:cli/bench/testdata/express-router.js",
":!:cli/bench/testdata/react-dom.js",
":!:cli/compilers/wasm_wrap.js",
":!:cli/tsc/dts/**",
+ ":!:cli/tsc/*typescript.js",
+ ":!:cli/tsc/compiler.d.ts",
+ ":!:runtime/examples/",
":!:target/",
":!:tests/registry/**",
":!:tests/specs/**",
- ":!:tests/testdata/encoding/**",
- ":!:tests/testdata/error_syntax.js",
- ":!: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/testdata/**",
+ ":!:tests/unit_node/testdata/**",
":!:tests/wpt/suite/**",
":!: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,
diff --git a/tools/release/00_start_release.ts b/tools/release/00_start_release.ts
index b5c35ae5a..125a76af6 100755
--- a/tools/release/00_start_release.ts
+++ b/tools/release/00_start_release.ts
@@ -1,5 +1,8 @@
#!/usr/bin/env -S deno run -A --quiet --lock=tools/deno.lock.json
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-console
+
import { $, createOctoKit, semver } from "./deps.ts";
const currentDirPath = $.path(import.meta).parentOrThrow();
diff --git a/tools/release/03_publish_crates.ts b/tools/release/03_publish_crates.ts
index dcad8ed92..ecfb75e79 100755
--- a/tools/release/03_publish_crates.ts
+++ b/tools/release/03_publish_crates.ts
@@ -1,5 +1,8 @@
#!/usr/bin/env -S deno run -A --lock=tools/deno.lock.json
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-console
+
import { DenoWorkspace } from "./deno_workspace.ts";
import { $, getCratesPublishOrder } from "./deps.ts";
diff --git a/tools/release/promote_to_rc.ts b/tools/release/promote_to_rc.ts
index eb4933678..297f5f462 100644
--- a/tools/release/promote_to_rc.ts
+++ b/tools/release/promote_to_rc.ts
@@ -1,6 +1,8 @@
#!/usr/bin/env -S deno run -A --lock=tools/deno.lock.json
// 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 { gray } from "jsr:@std/fmt@1/colors";
import { patchver } from "jsr:@deno/patchver@0.1.0";
diff --git a/tools/upload_wptfyi.js b/tools/upload_wptfyi.js
index b8f6d7c5a..23dd4c660 100644
--- a/tools/upload_wptfyi.js
+++ b/tools/upload_wptfyi.js
@@ -4,6 +4,8 @@
// passed, will automatically add a status check to the commit with a link to
// the wpt.fyi page.
+// deno-lint-ignore-file no-console
+
import { gzip } from "https://deno.land/x/compress@v0.4.1/gzip/mod.ts";
const user = Deno.env.get("WPT_FYI_USER");
diff --git a/tools/util.js b/tools/util.js
index ed322d0d8..99133628c 100644
--- a/tools/util.js
+++ b/tools/util.js
@@ -1,4 +1,7 @@
// 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 { wait } from "https://deno.land/x/wait@0.1.13/mod.ts";
export { dirname, fromFileUrl, join, resolve, toFileUrl };
diff --git a/tools/verify_pr_title.js b/tools/verify_pr_title.js
index d7b393bcd..98cc30aa7 100644
--- a/tools/verify_pr_title.js
+++ b/tools/verify_pr_title.js
@@ -1,4 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-console
+
const prTitle = Deno.args[0];
if (prTitle == null) {