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 comment headers #1

Merged
merged 1 commit into from
Sep 5, 2019
Merged

Conversation

charliesantos
Copy link
Collaborator

Current Issue
If we do something like this where there's import right after the @module comment block, this file will be treated as its own module and will ignore @module Voice.

/**
 * @module Voice
 */

import Test from './test';

/**
 * @external
 */
class Device {
  static get testProp(): string {
    return 'my test value';
  }
}

export default Device;

To fix the above issue without updating typedoc npm module, we would need to add dummy comment block before the import statement like below. The reason why this happens is because latest typescript only treats a comment block at the top of the file when there's no code below it. This is a known issue and discussed here TypeStrong#603

/**
 * @module Voice
 */

/**
 * Imports
 * Dummy comment block
 */
import Test from './test';

/**
 * @external
 */
class Device {
  static get testProp(): string {
    return 'my test value';
  }
}

export default Device;

Fix typedoc module
Ideally, this needs to be fixed in the typedoc npm module. There's a recommended fix mentioned in the github issue above (TypeStrong#603) but it requires removing a piece of code, and no-one knows why that code was there. This PR is applying that fix. I didn't see any issues after applying it and this fix will only exists in our fork.

@ryan-rowland ryan-rowland merged commit 86c486e into master Sep 5, 2019
@ryan-rowland ryan-rowland deleted the support_comment_headers branch September 5, 2019 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants