summaryrefslogtreecommitdiff
path: root/cli/graph_util.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-03-07 13:59:57 +0000
committerGitHub <noreply@github.com>2024-03-07 14:59:57 +0100
commitf0ec4fe1b89215ce9e62ebf47d8907dd6336f35e (patch)
tree0e74627f21ebba6393f7f48b5618435af5cd94ad /cli/graph_util.rs
parent588dd5e66961999cfafd4504444e685629a92173 (diff)
fix(publish): silence warnings for sloppy imports and node builtins with env var (#22760)
An undocumented "DENO_DISABLE_PEDANTIC_NODE_WARNINGS" env var can be used to silence warnings for sloppy imports and node builtins without `node:` prefix.
Diffstat (limited to 'cli/graph_util.rs')
-rw-r--r--cli/graph_util.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/graph_util.rs b/cli/graph_util.rs
index f1aa44328..b84cb3bb6 100644
--- a/cli/graph_util.rs
+++ b/cli/graph_util.rs
@@ -4,6 +4,7 @@ use crate::args::jsr_url;
use crate::args::CliOptions;
use crate::args::Lockfile;
use crate::args::TsTypeLib;
+use crate::args::DENO_DISABLE_PEDANTIC_NODE_WARNINGS;
use crate::cache;
use crate::cache::GlobalHttpCache;
use crate::cache::ModuleInfoCache;
@@ -681,9 +682,11 @@ pub fn enhanced_resolution_error_message(error: &ResolutionError) -> String {
let mut message = format!("{error}");
if let Some(specifier) = get_resolution_error_bare_node_specifier(error) {
- message.push_str(&format!(
+ if !*DENO_DISABLE_PEDANTIC_NODE_WARNINGS {
+ message.push_str(&format!(
"\nIf you want to use a built-in Node module, add a \"node:\" prefix (ex. \"node:{specifier}\")."
));
+ }
}
message