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

Experiment with using TS Compiler instead of jsdoc #102

Open
englercj opened this issue Sep 6, 2019 · 4 comments
Open

Experiment with using TS Compiler instead of jsdoc #102

englercj opened this issue Sep 6, 2019 · 4 comments

Comments

@englercj
Copy link
Owner

englercj commented Sep 6, 2019

I should try using the typescript compiler to parse the JS and generate definitions rather than using jsdoc directly. We've encountered a number of bugs related to how jsdoc parses JS and it not keeping up with JS features. Maybe we can get better results by using TS only and dropping jsdoc.

The idea would be to still use jsdoc comments to generate type defs, but to not use the jsdoc parser directly.

If anyone has thoughts, please share them.

@glen-84
Copy link

glen-84 commented May 29, 2020

This might be one issue to keep in mind: microsoft/TypeScript#25590

i.e. There is no support for the JSDoc overload syntax.

@englercj
Copy link
Owner Author

There are more issues with jsdoc not supporting TS features than the other way around I'm finding. Not to mention the vscode TS service already parses jsdoc to generate intellisense, so generating a file shouldn't be too hard.

@glen-84
Copy link

glen-84 commented May 29, 2020

Unless I'm misunderstanding you, this is already possible and quite easy actually (see an example here).

Unfortunately I ran into 2 blocking issues (noted at the end of the above-mentioned comment).

@englercj
Copy link
Owner Author

I just meant using typescript to parse the jsdoc comments instead of using jsdoc to parse the jsdoc comments.

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

No branches or pull requests

2 participants