[api-extractor] Apply @module comments to module namespace objects
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
This issue has not been assessed yet.
Description
Summary
When API-extractor creates a namespace in the API rollup file to represent an exported module namespace object, any @module comment in the source file should be applied to the namespace.
Repro steps
index.ts
export * as Text from './Text';
Text.ts
/**
* @module
* Functions for manipulating text.
*/
/**
* Convert line endings to `\n`
*/
export function convertToLf(input: text): string {
return text.replace(/\r\n/g, '\n');
}
/**
* Convert line endings to `\r\n`
*/
export function convertToCrLf(input: text): string {
return text.replace(/\r?\n/g, '\r\n');
}
Will generate
/**
* Convert line endings to `\n`
*/
declare function convertToLf(input: text): string;
/**
* Convert line endings to `\r\n`
*/
declare function convertToCrLf(input: text): string;
declare namespace Text {
export {
convertToLf,
convertToCrLf
}
}
export { Text }
Details
However, it should generate:
/**
* Convert line endings to `\n`
*/
declare function convertToLf(input: text): string;
/**
* Convert line endings to `\r\n`
*/
declare function convertToCrLf(input: text): string;
/**
* Functions for manipulating text.
*/
declare namespace Text {
export {
convertToLf,
convertToCrLf
}
}
## Standard questions
Please answer these questions to help us investigate your issue more quickly:
| Question | Answer |
| -------- | -------- |
| `@microsoft/api-extractor` version? | 7.54.0 |
| Operating system? | Linux |
| API Extractor scenario? | rollups (.d.ts) |
| Would you consider contributing a PR? | No |
| TypeScript compiler version? | 5.8.2 |
| Node.js version (`node -v`)? | 22.16.0 |
- Dominant language
- TypeScript
- Stars
- 6.5k
- Forks
- 708
- Avg merge
- 4d 13h
- Merged PRs (30d)
- 62
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/rushstack
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/rushstack#5971 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
microsoft/rushstack#5902 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/rushstack#5839 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microsoft/rushstack#5683 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Maintainers usually reply within 1 day
All issues in microsoft/rushstack
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
diegosouzapw/OmniRoute#14869 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
Maintainers usually reply within 1 day
-
status: waiting triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
freeCodeCamp/freeCodeCamp#70412 ·
Maintainers usually reply within 1 day
-
Mend: dependency security vulnerability untriaged
Difficulty 1/5 Under an hour Newbie friendliness 88/100
opensearch-project/OpenSearch-Dashboards#12816 ·
Maintainers usually reply within 1 day