microsoft / microsoft/TypeScript
Permit type alias declarations inside a class
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
I normally want my class declaration to be the first thing in my file:
module foo {
/** My foo class */
export class MyFoo {
}
}
So when I want to declare an alias, I don't like the fact that my class has been pushed down further:
module foo {
type foobar = foo.bar.baz.FooBar;
/** My foo class */
export class MyFoo {
}
}
I suggest the following be permitted:
module foo {
/** My foo class */
export class MyFoo {
type foobar = foo.bar.baz.FooBar;
}
}
Since type foobar is just a compile-time construct, and if people want to write it that way, then they should be permitted to do so. Note that the type foobar is private to the class. It should not be permissible to export foobar.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Das Issue nennt keine Dateien, Tests oder Einstiegspunkte. Beginne mit der Durchsicht der Diskussion und der bestehenden Regeln für Klassenmitglieder und Typ-Aliase; die Aufgabe ist abgeschlossen, wenn festgestellt wurde, ob private Typ-Aliase innerhalb von Klassen akzeptiert werden sollten, während exportierte Aliase weiterhin nicht zulässig sind, mit Abdeckung für die beschriebenen Beispiele.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- compilers
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 25/100