summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/args/mod.rs3
-rw-r--r--tests/specs/lint/jsr_pkg_no_version/__test__.jsonc5
-rw-r--r--tests/specs/lint/jsr_pkg_no_version/deno.json4
-rw-r--r--tests/specs/lint/jsr_pkg_no_version/lint.out14
-rw-r--r--tests/specs/lint/jsr_pkg_no_version/mod.ts3
5 files changed, 27 insertions, 2 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs
index 89ecc8da7..030b19d80 100644
--- a/cli/args/mod.rs
+++ b/cli/args/mod.rs
@@ -1902,8 +1902,7 @@ pub fn config_to_deno_graph_workspace_member(
};
let version = match &config.json.version {
Some(name) => Some(deno_semver::Version::parse_standard(name)?),
- // todo(#25230): remove
- None => bail!("Missing 'version' field in config file."),
+ None => None,
};
Ok(deno_graph::WorkspaceMember {
base: config.specifier.join("./").unwrap(),
diff --git a/tests/specs/lint/jsr_pkg_no_version/__test__.jsonc b/tests/specs/lint/jsr_pkg_no_version/__test__.jsonc
new file mode 100644
index 000000000..d1783f1dc
--- /dev/null
+++ b/tests/specs/lint/jsr_pkg_no_version/__test__.jsonc
@@ -0,0 +1,5 @@
+{
+ "args": "lint",
+ "output": "lint.out",
+ "exitCode": 1
+}
diff --git a/tests/specs/lint/jsr_pkg_no_version/deno.json b/tests/specs/lint/jsr_pkg_no_version/deno.json
new file mode 100644
index 000000000..50d49ffb6
--- /dev/null
+++ b/tests/specs/lint/jsr_pkg_no_version/deno.json
@@ -0,0 +1,4 @@
+{
+ "name": "@scope/pkg",
+ "exports": "./mod.ts"
+}
diff --git a/tests/specs/lint/jsr_pkg_no_version/lint.out b/tests/specs/lint/jsr_pkg_no_version/lint.out
new file mode 100644
index 000000000..208499590
--- /dev/null
+++ b/tests/specs/lint/jsr_pkg_no_version/lint.out
@@ -0,0 +1,14 @@
+error[no-slow-types]: missing explicit return type in the public API
+ --> [WILDLINE]:1:17
+ |
+1 | export function test() {
+ | ^^^^ this function is missing an explicit return type
+ |
+ = hint: add an explicit return type to the function
+
+ info: all functions in the public API must have an explicit return type
+ docs: https://jsr.io/go/slow-type-missing-explicit-return-type
+
+
+Found 1 problem
+Checked 1 file
diff --git a/tests/specs/lint/jsr_pkg_no_version/mod.ts b/tests/specs/lint/jsr_pkg_no_version/mod.ts
new file mode 100644
index 000000000..02abbfe2f
--- /dev/null
+++ b/tests/specs/lint/jsr_pkg_no_version/mod.ts
@@ -0,0 +1,3 @@
+export function test() {
+ return 1 + 2;
+}