mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
fix(lint): support linting jsr pkg without version field (#25230)
This commit is contained in:
parent
b9da6d0d00
commit
35074a10c6
5 changed files with 27 additions and 2 deletions
|
@ -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(),
|
||||
|
|
5
tests/specs/lint/jsr_pkg_no_version/__test__.jsonc
Normal file
5
tests/specs/lint/jsr_pkg_no_version/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "lint",
|
||||
"output": "lint.out",
|
||||
"exitCode": 1
|
||||
}
|
4
tests/specs/lint/jsr_pkg_no_version/deno.json
Normal file
4
tests/specs/lint/jsr_pkg_no_version/deno.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "@scope/pkg",
|
||||
"exports": "./mod.ts"
|
||||
}
|
14
tests/specs/lint/jsr_pkg_no_version/lint.out
Normal file
14
tests/specs/lint/jsr_pkg_no_version/lint.out
Normal file
|
@ -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
|
3
tests/specs/lint/jsr_pkg_no_version/mod.ts
Normal file
3
tests/specs/lint/jsr_pkg_no_version/mod.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
export function test() {
|
||||
return 1 + 2;
|
||||
}
|
Loading…
Reference in a new issue