microsoft / microsoft/TypeScript
Refactor/Quickfix: Convert parameter property into property declaration
Offen
Dieses Issue hat noch niemand übernommen.
Awaiting More Feedback
Suggestion
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
Search Terms
refactor, quickfix
Suggestion
Provide a way to convert parameter property into property declaration
Examples
class A {
constructor(private a: string) {
}
}
// to
class A {
private a: string
constructor(a: string) {
this.a = a
}
}
Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
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 Implementierungsdateien oder Tests; ermittle daher zunächst den TypeScript-Einstiegspunkt für quick-fix oder refactoring für parameter properties und die vorhandene Testabdeckung. Erledigt ist die Aufgabe, wenn die gezeigte Konstruktorform in eine explizite Property-Deklaration, einen Konstruktorparameter und eine Zuweisung umgewandelt werden kann.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- compilers, developer-experience
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100