-
Notifications
You must be signed in to change notification settings - Fork 692
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
Feature request: Support jsdoc style typescript comments in js files #911
Comments
@bendtherules TypeDoc should already support this? Are you passing the |
I tried to use
Which is a bit odd considering this is supported normally in TypeScript. I do wish I had the luxury of time to explore precisely what kind of annotations and code is allowed in TypeDoc to properly group and document stuff but it's a bit tight for me at the moment. For reference, using the default TypeDoc theme results in this: |
Repro repo: https://github.com/bendtherules/repro-typedoc-issue-jsdoc/tree/without-ext-types Trying to run: But it doesn't have any methods of Calculations in the output. It might be just something wrong with the require/module.exports syntax here or a wrong tsconfig.json, but I can't really figure out. |
Hi, just checking back. Is this problem reproducible on someone else's end? |
I was able to get it to work with some slight modifications. I changed the input file to explicitly be the js file. The TS compiler was complaining about overriding the file so I added an npx typedoc --tsconfig ./tsconfig.json --out ./docs ./src/index.js |
Thanks, this works. Forgot to test it out earlier. Should I keep it open as it should automatically pick that up? Or is it outside typedocs's scope (and something that typescript should do itself) ? |
Providing just the input directory should work, and should include all files inside of that directory, so if including If the |
None of the variations of providing folder name like |
Ideally though, files should be automatically picked up using include/exclude provided in tsconfig.json. Providing it in CLI shouldn't be required for js, as it's not required for ts. |
Well, it was fairly easy to track down why js files weren't included when specifying a directory - This will fix your original command, but I'm not sure if the input files will be picked up automatically as ts files apparently are (never realized this...) |
Typescript supports a way to add jsdoc-style comments (that indicate type information) within js files (https://github.com/Microsoft/TypeScript/wiki/JSDoc-support-in-JavaScript). This is quite a valid way to use Typescript without moving to ts files.
But these files don't seem to get picked up or processed by typedoc to generate relevant documentation. Is it possible to support this?
(TS compiler api should already have ways to understand this comments, the way VSCode does)
The text was updated successfully, but these errors were encountered: