microsoft / microsoft/TypeScript

Feat: Non-Detail view for Error Messages

Aperta
#36,701 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Needs Proposal Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

Suggestion

The following is a case where I'm missing a single field from an object:

Screen Shot 2020-02-08 at 6 08 45 PM Screen Shot 2020-02-08 at 6 08 57 PM Screen Shot 2020-02-08 at 6 09 02 PM

The amount of detail in this error message is very useful for extreme scenarios, but in a general day to day scenario, it's a bit overwhelming.

It would be really nice to have detailed messages like this hidden behind a "See More" item, and instead show the simplest form of the error. In this case the error could be

missing prop "fields" of type "object"

I don't need to know what the object type is, or what the parent type is. I can just get that error message later.

Use Cases

Almost 100% of the errors I get in TypeScript would be improved by this. It's very rare that I want to know all the information, and almost always that I just want a simple reminder of what tiny slip up it is.

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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia esaminando gli screenshot dell'issue, il messaggio semplificato proposto e gli obiettivi di progettazione TypeScript collegati nella checklist. Il lavoro è completato quando i messaggi di errore possono presentare una forma concisa mantenendo le informazioni dettagliate dietro un elemento "See More", senza modificare il comportamento a runtime.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, 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
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.