Skip to content

Commit

Permalink
fix(check): support jsdoc @import tag (#26991)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Nov 25, 2024
1 parent 02b480b commit 2b26444
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ deno_cache_dir.workspace = true
deno_config.workspace = true
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
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_lockfile.workspace = true
deno_npm.workspace = true
Expand Down
5 changes: 5 additions & 0 deletions tests/specs/check/jsdoc_import_decl/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"args": "check --allow-import main.js",
"output": "check.out",
"exitCode": 1
}
6 changes: 6 additions & 0 deletions tests/specs/check/jsdoc_import_decl/check.out
Original file line number Diff line number Diff line change
@@ -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 changes: 12 additions & 0 deletions tests/specs/check/jsdoc_import_decl/main.js
Original file line number Diff line number Diff line change
@@ -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("");

0 comments on commit 2b26444

Please sign in to comment.