microsoft / microsoft/TypeScript
Class member incorrectly stripped from .d.ts output if @internal is mentioned in unrelated comment
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
🔎 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
💻 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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci il comportamento usando il TypeScript Playground collegato con stripInternal abilitato e la classe fornita. Traccia la gestione dell’output delle dichiarazioni per commenti consecutivi, quindi aggiungi un test di regressione che copra una menzione indipendente di @internal prima di un commento @internal separato. Il lavoro è completato quando viene omesso solo shouldBeStripped, mentre shouldNotBeStripped rimane nell’output .d.ts.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100