From 3c6ddf1122a7e64331dba800fd2b5c49f67f5291 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 19 Dec 2024 12:28:50 +0100 Subject: [PATCH] storaged: Type contains_rootfs() 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. --- pkg/storaged/crypto/keyslots.jsx | 1 + test/common/typecheck | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/storaged/crypto/keyslots.jsx b/pkg/storaged/crypto/keyslots.jsx index 7e78ac999132..63b91a713c29 100644 --- a/pkg/storaged/crypto/keyslots.jsx +++ b/pkg/storaged/crypto/keyslots.jsx @@ -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]; diff --git a/test/common/typecheck b/test/common/typecheck index d7f0944a28f8..a8680c37034b 100755 --- a/test/common/typecheck +++ b/test/common/typecheck @@ -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