-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Comment EmitThe issue relates to the emission of comments when compilingThe issue relates to the emission of comments when compiling
Milestone
Description
Bug Report
I am currently trying to autogenerate .d.ts files for my JavaScript API using --declaration and I am running into problems. All of the files which use a const namespace will have all of their comments removed, including the JSDocs ones. I have set removeComments as false in tsconfig and sanity checked it by a class with comments and all of the comments were retained in the class, but not the namespace.
🔎 Search Terms
Duplicate methods --declaration
namespace .d.ts bug
🕗 Version & Regression Information
4.4.3 but happens with any 4.x.x version I've tried (haven't tried earlier versions).
⏯ Playground Link
The Playground was not playing nicely with emitDeclaration and filenames with .js extension
💻 Code
/**
* Foo namespace
* @namespace
*/
const Foo = {
/** Test function */
foo: function() {},
/** Test property */
bar: 1
}
🙁 Actual behavior
declare namespace Foo {
function foo(): void;
const bar: number;
}
🙂 Expected behavior
/**
* Foo namespace
* @namespace
*/
declare namespace Foo {
/** Test function */
function foo(): void;
/** Test property */
const bar: number;
}
kaheglar, sanjeetsuhag, christianschmitz and bananarama92
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Comment EmitThe issue relates to the emission of comments when compilingThe issue relates to the emission of comments when compiling