microsoft / microsoft/TypeScript
Support @class in JSDoc
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
From https://github.com/Microsoft/vscode/issues/15168
For the following JavaScript code:
/**
* @class
*
* @param {number} x
*/
function Foo(x) {
this.x = x
}
/**
* @param {Foo} foo
*/
const request = function(foo) {
}
The @class jsdoc annotation for Foo does not seem to be recognized, so the type of foo in request is any:

Changing the code to use class fixes the issue (you don't actually need the @class in this case):

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
Beginne mit dem JavaScript- und JSDoc-Beispiel im Issue und verfolge anschließend die JSDoc-Verarbeitung und Typinferenz von TypeScript für die @class-Annotation. Die Aufgabe ist abgeschlossen, wenn der Foo-Konstruktor als Typ erkannt wird, sodass der Parameter foo nicht mehr any ist, und ein Regressionstest das Beispiel abdeckt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, typescript
- Bereich
- compilers
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100