microsoft / microsoft/TypeScript
Export a object with comment ,but the comment is missing after build a *.d.ts file
Open
Nobody has claimed this yet.
Domain: Comment Emit
Revisit
Suggestion
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
I export an object,then I build to a declare file like index.d.ts,but the file has no comment about that object.
Source code
//src/cache/index.ts
import * as localStorage from "./localStorage"
export default {
/**
* This is a comment2
*/
localStorage
}
//src/index.ts
import cache from "./cache/index"
export default {
/**
* This is a comment1
*/
cache
}
Index.d.ts
declare const _default: {
/**
* This is a comment1
*/
cache: {
localStorage: typeof import("./cache/localStorage");//#### This field's comment is missing ####
};
};
export default _default;
Contributor guide
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.
Research direction
Reproduce the declaration build from src/index.ts and src/cache/index.ts, then compare the generated index.d.ts with the source comments. Trace the declaration-emission path for the nested localStorage property; done means its comment is preserved in the generated declaration file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100