microsoft / microsoft/TypeScript
Refactor to extract a part of type property into a new type
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
Search Terms
refactor, extract, types, property
Suggestion
It's common to convert a part of properties into new type when we got too many related property.
Could we provide an automatic way to do this?
Examples
//from
interface A {
/*a*/f1: string
f2: string/*b*/
a1: number
}
// to
interface NewType {
f1: string
f2: string
}
interface A {
/*RENAME*/ newProperty: NewType
a1: number
}
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.
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
Non vengono indicati file sorgente, test o punti di ingresso. Inizia esaminando la trasformazione richiesta dell’interfaccia TypeScript e le capacità di refactoring esistenti; il lavoro sarebbe completato definendo un workflow di estrazione automatica che produca la nuova struttura di tipi e proprietà illustrata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- developer-experience, tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100