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

Supporting TSDoc in deno doc and dts emit #494

Open
4 tasks
lucacasonato opened this issue May 8, 2024 · 4 comments
Open
4 tasks

Supporting TSDoc in deno doc and dts emit #494

lucacasonato opened this issue May 8, 2024 · 4 comments

Comments

@lucacasonato
Copy link
Member

Right now we only support TS type annotations in .ts files for both deno doc and fast check emit. We do not understand type annotations in TSDoc comments in .js files as of yet. We could do this, but it would require significant effort:

  • New JSDoc / TSDoc parser that can handle parsing type expressions
  • deno doc needs to understand type expressions in TSDoc
  • Fast check needs to understand type expressions in TSDoc
  • Fast check needs to emit type expressions in TSDoc to .d.ts files
@hrgdavor
Copy link

hrgdavor commented May 25, 2024

This is a blocker for me. I hope there more others like me regarding this issue, so there is incentive to tackle this.

I want to be typescript friendly, but refuse to to use it directly. It is my personal preference.

@theengineear
Copy link

^^ Having similar issues. I have a package where I define all types via JSDoc in .js files and then emit .d.ts files. I believe that I should be able to do this in such a way that shouldn’t flag my package as having slow types. I’m struggling with understanding whether I’ve somehow done something wrong or if I’m being incorrectly flagged as having “slow types”.

Thanks!

@hrgdavor
Copy link

hrgdavor commented Nov 5, 2024

Trying not to spam. I am interested in publishing some libraries and using jsr to improve docs and types quelity, but this is show stopper for me. I do see some progress in netflix/x-element that looks promising for this ... looking fwd to more progress.

@sergey-shandar
Copy link

I have the same issue. One of the workarounds would be to generate .d.ts files using tsc before publishing a package. But it looks like I can't associate the generated .d.ts files like I could do in package.json:

...
"exports": {
    "./a": { "types": "./a.d.mts", "import": "./a.mjs" },
...

I have tens of .mjs files in my mono-package, so // @ts-self-types="./types.d.ts could be problematic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Plan
Development

No branches or pull requests

5 participants