In Visual Studio Code, as the inlay hint shows that it's possible to infer the implicit return type. I have confirmed that TypeScript version used in the editor is 5.2.2 that is consistent with the dependency.
But in the generated type declaration @/packages/module/dist/runtime/composables/utils.d.ts
The return type becomes any.
I'm not sure whether the problem is caused by @unjs/mkdist which is used by @nuxt/module-builder under the hood to generate type declaration files.
Describe the bug
Description
In the distributed package of release v1.6.6, some function signatures have
any
return type.Details
For source
@/packages/module/src/runtime/composables/utils.ts
https://github.com/harlan-zw/nuxt-site-config/blob/b57f7ddb92d666fab82393dcb0aa6d4bb5a8834a/packages/module/src/runtime/composables/utils.ts#L28-L41In Visual Studio Code, as the inlay hint shows that it's possible to infer the implicit return type. I have confirmed that TypeScript version used in the editor is 5.2.2 that is consistent with the dependency.
But in the generated type declaration
@/packages/module/dist/runtime/composables/utils.d.ts
The return type becomes
any
.I'm not sure whether the problem is caused by @unjs/mkdist which is used by @nuxt/module-builder under the hood to generate type declaration files.
Solution
Mark return type explicitly.
Modified source
Generated type declaration
Reproduction
No response
System / Nuxt Info