Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit type annotation for all exports #797

Closed
paambaati opened this issue Jul 19, 2024 · 2 comments
Closed

Explicit type annotation for all exports #797

paambaati opened this issue Jul 19, 2024 · 2 comments
Labels
feature 🚀 New feature or request

Comments

@paambaati
Copy link

paambaati commented Jul 19, 2024

Description

When publishing a package auto-generated by openapi-ts to JSR, it complains with this error –

error[missing-explicit-return-type]: missing explicit return type in the public API
  --> /Users/ganeshprasannah/Projects/neon-js-sdk/generated/core/CancelablePromise.ts:83:6
   |
83 |   get [Symbol.toStringTag]() {
   |       ^^^^^^^^^^^^^^^^^^^^ this function is missing an explicit return type
   |
   = hint: add an explicit return type to the function

  info: all functions in the public API must have an explicit return type
  docs: https://jsr.io/go/slow-type-missing-explicit-return-type

error[missing-explicit-type]: missing explicit type in the public API
  --> /Users/ganeshprasannah/Projects/neon-js-sdk/generated/schemas.gen.ts:15:14
   |
15 | export const $Provisioner = {
   |              ^^^^^^^^^^^^ this symbol is missing an explicit type
   |
   = hint: add an explicit type annotation to the symbol

  info: all symbols in the public API must have an explicit type
  docs: https://jsr.io/go/slow-type-missing-explicit-type

JSR, unlike npm, recommends publishing TypeScript code, and will analyze and publish documentation automatically. To be able to do this effectively at scale, JSR recommends explicitly adding type annotations.

Would you folks consider adding this feature, perhaps behind an option flag? Especially considering both Deno (and along with it, JSR) is increasingly being used for production-grade applications, and it would make packages built by openapi-ts very easy to directly publish to JSR.

@paambaati paambaati added the feature 🚀 New feature or request label Jul 19, 2024
@mrlubos
Copy link
Member

mrlubos commented Jul 19, 2024

I think this is related to #493

@paambaati
Copy link
Author

Closing as duplicate of #493.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🚀 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants