microsoft / microsoft/TypeScript
Show error when JSDoc tags use unknown Symbols
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
Suggestion
Raise error when JSDoc tags reference unknown types
🔍 Search Terms
List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily and help provide feedback.
is:issue is:open in:title jsdoc error
is:issue is:open in:title jsdoc validate
✅ 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
Just like unknown symbols are compilation errors, raise also errors when using unknown symbols within JSDoc comments
📃 Motivating Example
class TestWebsite {}
/** @link {TestWebsite-Bogus} */
/** @see {TestWebsite-Bogus} */
/** @type {TestWebsite-Bous} */
There is no error on those references
💻 Use Cases
Typescript already takes type hints from JSDoc comments. Why not close the loop and also type-check JSDoc??
My most frequent code documentation case is referencing symbols and files within comments. However since these are never validated it is normal that with time and some refactorings those references become invalid.
It would be of a great help getting compilation errors on comment references. After all wrong/bad code documentation is worst than no documentation. JSDoc deserves static validation too!
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 il suggerimento e i relativi esempi JSDoc, quindi individua i test esistenti per il controllo dei tipi e la diagnostica JSDoc; l’issue non indica alcun file o punto di ingresso dei test. Il lavoro è completato quando i simboli sconosciuti a cui fanno riferimento tag JSDoc come @link, @see e @type producono errori di compilazione senza modificare il JavaScript emesso.
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
- 35/100