summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-07-12 12:48:53 -0400
committerGitHub <noreply@github.com>2024-07-12 12:48:53 -0400
commit8ee14bd56ac350d65256bdb17cc1e7434ff5b27f (patch)
tree312ae72a8ce8580abed9942c0234aab5a09e3922
parent8cbf81cf0840aa9c2e7c8e845748b422827c9b88 (diff)
refactor: move importMap with imports/scopes diagnostic to deno_config (#24553)
-rw-r--r--Cargo.lock4
-rw-r--r--Cargo.toml2
-rw-r--r--cli/args/mod.rs8
-rw-r--r--tests/specs/import_map/import_map_config/config.out3
-rw-r--r--tests/specs/workspaces/non_fatal_diagnostics/lint.out4
5 files changed, 8 insertions, 13 deletions
diff --git a/Cargo.lock b/Cargo.lock
index d814a4c31..527566539 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1308,9 +1308,9 @@ dependencies = [
[[package]]
name = "deno_config"
-version = "0.21.3"
+version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13ad624cb26f547980ca481b1805c4b29d81c7631e791fe1b63f3cc697722722"
+checksum = "866d351087e70f8db42d04a773b9a96444d2653ef4bb0fb104fe562b819a57c9"
dependencies = [
"anyhow",
"deno_semver",
diff --git a/Cargo.toml b/Cargo.toml
index b6ea178a4..2a9c2b9e4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -101,7 +101,7 @@ console_static_text = "=0.8.1"
data-encoding = "2.3.3"
data-url = "=0.3.0"
deno_cache_dir = "=0.10.0"
-deno_config = { version = "=0.21.3", default-features = false }
+deno_config = { version = "=0.22.0", default-features = false }
dlopen2 = "0.6.1"
ecb = "=0.1.2"
elliptic-curve = { version = "0.13.4", features = ["alloc", "arithmetic", "ecdh", "std", "pem"] }
diff --git a/cli/args/mod.rs b/cli/args/mod.rs
index 60cc97e2d..a1c8efc31 100644
--- a/cli/args/mod.rs
+++ b/cli/args/mod.rs
@@ -887,7 +887,7 @@ impl CliOptions {
};
for diagnostic in workspace.diagnostics() {
- log::warn!("{}", colors::yellow(diagnostic));
+ log::warn!("{} {}", colors::yellow("Warning"), diagnostic);
}
let root_folder = workspace.root_folder().1;
@@ -1789,12 +1789,6 @@ fn resolve_import_map_specifier(
format!("Bad URL (\"{import_map_path}\") for import map.")
})?;
Ok(Some(specifier))
- } else if let Some(config_file) = &maybe_config_file {
- // if the config file is an import map we prefer to use it, over `importMap` field
- if config_file.is_an_import_map() && config_file.json.import_map.is_some() {
- log::warn!("{} \"importMap\" setting is ignored when \"imports\" or \"scopes\" are specified in the config file.", colors::yellow("Warning"));
- }
- Ok(None)
} else {
Ok(None)
}
diff --git a/tests/specs/import_map/import_map_config/config.out b/tests/specs/import_map/import_map_config/config.out
index 72df124a2..c363360ac 100644
--- a/tests/specs/import_map/import_map_config/config.out
+++ b/tests/specs/import_map/import_map_config/config.out
@@ -1,4 +1,5 @@
-Warning "importMap" setting is ignored when "imports" or "scopes" are specified in the config file.
+Warning "importMap" field is ignored when "imports" or "scopes" are specified in the config file.
+ at file:///[WILDLINE]/import_map_config/config.json
Hello from remapped moment!
Hello from remapped moment dir!
Hello from remapped lodash!
diff --git a/tests/specs/workspaces/non_fatal_diagnostics/lint.out b/tests/specs/workspaces/non_fatal_diagnostics/lint.out
index f2fbd1822..864dc47ac 100644
--- a/tests/specs/workspaces/non_fatal_diagnostics/lint.out
+++ b/tests/specs/workspaces/non_fatal_diagnostics/lint.out
@@ -1,5 +1,5 @@
-The "compilerOptions" field can only be specified in the root workspace deno.json file.
+Warning "compilerOptions" field can only be specified in the workspace root deno.json file.
at file:///[WILDLINE]/sub/deno.json
-The "lint.report" field can only be specified in the root workspace deno.json file.
+Warning "lint.report" field can only be specified in the workspace root deno.json file.
at file:///[WILDLINE]/sub/deno.json
Checked 1 file