microsoft / microsoft/TypeScript
Add flip operator refactoring
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
Suggestion
🔍 Search Terms
flip operator, flip operators, refactoring
✅ Viability 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, new syntax sugar for JS, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
⭐ Suggestion
Implement flip operator refactoring for swapping left and right operands and update operator if needed.
This small feature would make some refactorings, that require copy-pasting operands and operators much easier.
📃 Motivating Example
Before:
// harder to understand
if (5 < position) {
// ...
}
After:
// much easier
if (position > 5) {
// ...
}
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
Im Issue werden keine Implementierungsdateien, Tests oder Einstiegspunkte genannt. Beginne damit, den Einstiegspunkt für das Refactoring und die relevanten Tests zu identifizieren, und überprüfe anschließend, dass Operanden und ihre Operatoren vertauscht werden können, ohne das Verhalten des erzeugten JavaScript zu verändern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100