mirror of
https://github.com/denoland/deno.git
synced 2025-01-04 13:28:47 -05:00
fix(check): support jsdoc @import
tag (#26991)
* https://github.com/denoland/deno_graph/pull/544 Closes https://github.com/denoland/deno/issues/25516
This commit is contained in:
parent
02b480b171
commit
2b26444584
5 changed files with 26 additions and 3 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1664,9 +1664,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "deno_graph"
|
name = "deno_graph"
|
||||||
version = "0.85.0"
|
version = "0.85.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9d097305aba3f119781fe82b4d5a85a1ad10c586a388ee4d754e5bf82901cc5c"
|
checksum = "4c11027d9b4e9ff4f8bcb8316a1a5dd5241dc267380507e177457bc491696189"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
|
|
@ -73,7 +73,7 @@ deno_cache_dir.workspace = true
|
||||||
deno_config.workspace = true
|
deno_config.workspace = true
|
||||||
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
|
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
|
||||||
deno_doc = { version = "0.160.0", features = ["rust", "comrak"] }
|
deno_doc = { version = "0.160.0", features = ["rust", "comrak"] }
|
||||||
deno_graph = { version = "=0.85.0" }
|
deno_graph = { version = "=0.85.1" }
|
||||||
deno_lint = { version = "=0.68.0", features = ["docs"] }
|
deno_lint = { version = "=0.68.0", features = ["docs"] }
|
||||||
deno_lockfile.workspace = true
|
deno_lockfile.workspace = true
|
||||||
deno_npm.workspace = true
|
deno_npm.workspace = true
|
||||||
|
|
5
tests/specs/check/jsdoc_import_decl/__test__.jsonc
Normal file
5
tests/specs/check/jsdoc_import_decl/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"args": "check --allow-import main.js",
|
||||||
|
"output": "check.out",
|
||||||
|
"exitCode": 1
|
||||||
|
}
|
6
tests/specs/check/jsdoc_import_decl/check.out
Normal file
6
tests/specs/check/jsdoc_import_decl/check.out
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
Download http://localhost:4545/add.ts
|
||||||
|
Check file:///[WILDLINE]main.js
|
||||||
|
error: TS2345 [ERROR]: Argument of type 'string' is not assignable to parameter of type '(a: number, b: number) => number'.
|
||||||
|
addHere("");
|
||||||
|
~~
|
||||||
|
at file:///[WILDLINE]main.js:12:9
|
12
tests/specs/check/jsdoc_import_decl/main.js
Normal file
12
tests/specs/check/jsdoc_import_decl/main.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
// @ts-check
|
||||||
|
|
||||||
|
/** @import { add } from "http://localhost:4545/add.ts" */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {typeof add} myValue
|
||||||
|
*/
|
||||||
|
export function addHere(myValue) {
|
||||||
|
return myValue(1, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
addHere("");
|
Loading…
Reference in a new issue