π Search Terms
internal, .d.ts, stripInternal
π Version & Regression Information
This issue appears to be present in all version of TypeScript (tested down to 3.3.3).
β― Playground Link
https://www.typescriptlang.org/play?stripInternal=true&ts=5.3.3#code/KYDwDg9gTgLgBAYwDYEMDOa4DEITgbwCg44B6AKnOJPLgGUALCAVyQBM4AjYONGKAJZgwwNtTi0AAgIB2MYFBkok48qWpomrNgCFgdfkJEcAvHACMAbkLVSpOABUA8gBEnALjgBbFAE9u3igA1jwwDAKY0nIKSkgA-LaUqvRa7BIyEDC0AXyCwqKq6iSaLOwAcpl6BnnGcGYATNYAvkA
π» Code
export class Foo {
/**
* Should be stripped
* @internal
*/
shouldBeStripped = 1;
// TODO: maybe make this @internal?
/**
* Should *not* be stripped
*/
shouldNotBeStripped = 2;
}
π Actual behavior
The compiler should preserve the Foo.shouldNotBeStripped property while removing Foo.shouldBeStripped.
π Expected behavior
Both Foo.shouldNotBeStripped and Foo.shouldBeStripped are removed.
Additional information about the issue
If a class member has an unrelated comment mentioning @internal preceding it, TypeScript will drop that member from the .d.ts output, even though that's not the intent since there's another comment after it. Only the first comment should be checked for @internal.
π Search Terms
internal, .d.ts, stripInternal
π Version & Regression Information
This issue appears to be present in all version of TypeScript (tested down to 3.3.3).
β― Playground Link
https://www.typescriptlang.org/play?stripInternal=true&ts=5.3.3#code/KYDwDg9gTgLgBAYwDYEMDOa4DEITgbwCg44B6AKnOJPLgGUALCAVyQBM4AjYONGKAJZgwwNtTi0AAgIB2MYFBkok48qWpomrNgCFgdfkJEcAvHACMAbkLVSpOABUA8gBEnALjgBbFAE9u3igA1jwwDAKY0nIKSkgA-LaUqvRa7BIyEDC0AXyCwqKq6iSaLOwAcpl6BnnGcGYATNYAvkA
π» Code
π Actual behavior
The compiler should preserve the
Foo.shouldNotBeStrippedproperty while removingFoo.shouldBeStripped.π Expected behavior
Both
Foo.shouldNotBeStrippedandFoo.shouldBeStrippedare removed.Additional information about the issue
If a class member has an unrelated comment mentioning
@internalpreceding it, TypeScript will drop that member from the .d.ts output, even though that's not the intent since there's another comment after it. Only the first comment should be checked for@internal.