microsoft / microsoft/TypeScript
Comments on inner properties are stripped
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TS: 2.0.0
// code.ts
/**
* Some foo
*/
export const foo = {
/**
* Some boo
*/
boo = 0
}
expect:
// code.d.ts
/**
* Some foo
*/
export declare foo: {
/**
* Some boo
*/
boo: number;
}
actual:
// code.d.ts
/**
* Some foo
*/
export declare foo: {
boo: number;
}
By the way, is there a way to separately control whether comment should be kept in *.d.ts and *.js?
Currently when tsconfig.json/compilerOptions/removeComments = true, comments are removed from both of them.
Would it be nice to keep the comments in *.d.ts but not *.js?
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
Start with the code.ts and code.d.ts examples and the compilerOptions/removeComments setting described in the issue. Trace declaration output for comments on inner properties, then verify that the expected nested comment is preserved and that comment removal for generated JavaScript and declaration files can be controlled as requested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100