microsoft / microsoft/TypeScript
Provide type coverage metrics
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
- type coverage
- flow coverage
Suggestion
I'd love it if TypeScript had a tool to capture type coverage metrics, similar to Flow's Type Coverage feature. That coverage data could be used by IDEs (again, currently supported by Flow) to highlight gaps in type coverage. Basically, it should tell us which parts of our code are being evaluated as any.
Assuming it would work like Flow's feature, this could be a separate tsc option or separate cli command. Theirs works for single files and also offers a batch-coverage command for checking directories / whole projects, etc.
Use Cases
- The Type Coverage metric could be used much like test coverage info, helping us to identify gaps in our typing (particularly unexpected gaps caused by insufficient type definitions from library code).
Examples
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
Inizia esaminando la documentazione di Flow Type Coverage e batch-coverage collegata nell’issue, quindi analizza come le opzioni di tsc o i comandi CLI di TypeScript potrebbero esporre metriche equivalenti. Il lavoro è completato quando viene indicato quali parti del codice vengono valutate come any per i singoli file e per la coverage di una directory o dell’intero progetto, con dati utilizzabili dagli IDE.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100