Skip to content

Commit

Permalink
storaged: Type contains_rootfs()
Browse files Browse the repository at this point in the history
This function calls itself recursively, so the type checker cannot infer
its signature. Add one explicitly.

Fixes

> pkg/storaged/crypto/keyslots.jsx(405,44): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.

which is the last remaining instance of that error. So stop ignoring it.
  • Loading branch information
martinpitt authored and mvollmer committed Dec 20, 2024
1 parent 9b877aa commit 3c6ddf1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions pkg/storaged/crypto/keyslots.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ function ensure_non_root_nbde_support(steps, progress, client, block) {
.then(() => ensure_crypto_option(steps, progress, client, block, "_netdev"));
}

/** @type (client: any, path: string) => boolean */
function contains_rootfs(client, path) {
const block = client.blocks[path];
const crypto = client.blocks_crypto[path];
Expand Down
1 change: 0 additions & 1 deletion test/common/typecheck
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ javascript_ignored_codes = [
"TS7019", # Rest parameter '*' implicitly has an 'any[]' type
"TS7022", # '*' implicitly has type 'any'...
"TS7023", # '*' implicitly has return type 'any' because ...
"TS7024", # Function implicitly has return type 'any' because ...
"TS7031", # Binding element '*' implicitly has an 'any' type.
"TS7034", # Variable '*' implicitly has type 'any' in some locations where its type cannot be determined.
"TS7053", # Element implicitly has an 'any' type because expression of type 'any' can't be used to
Expand Down

0 comments on commit 3c6ddf1

Please sign in to comment.