microsoft / microsoft/TypeScript
inline comments are striped in emitted declaration files
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript Version: 3.1.3
Search Terms: inline comments striped
tsconfig
{
"compilerOptions": {
"moduleResolution": "node",
"module": "esnext",
"target": "es5",
"lib": [
"dom",
"es2018"
],
"strict": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"suppressImplicitAnyIndexErrors": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"sourceMap": true,
"outDir": "dist/esm5",
"declaration": true,
"declarationDir": "dist/types",
"declarationMap": true,
"stripInternal": true,
"resolveJsonModule": true,
"importHelpers": true
},
"include": [
"./src"
],
"compileOnSave": false,
"buildOnSave": false
}
Code:
// I'll be missing after tsc 😭
/**
* I'll be here after tsc 😎
*/
export const api = () => { /* some code ... */ }
Expected behavior:
Keeping both block and inline comments in declaration files in both transpiled files and declaration files
Actual behavior:
Inline comments are removed in declaration files

And correctly kept within transpiled files

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 by reproducing the issue with the provided tsconfig and TypeScript example, using TypeScript 3.1.3 or typescript@next. Compare the emitted declaration files with the transpiled files; done means inline comments are retained in declaration output alongside block comments.
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
- Clearly specified
- Newbie friendliness
- 42/100