microsoft / microsoft/TypeScript
Support evolving the type with assignments for expando object
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
Copied from https://github.com/Microsoft/TypeScript/issues/12278#issuecomment-261000712
OP = @abgivant
I use a similar module pattern in an application I'm working on, and the lack of IntelliSense/definitions for those has been an issue for me as well.
Mine follow this basic pattern:
module.exports = function(x, y, z) {
var exports = {};
exports.method = function() {
// Something that might use x, y, or z
};
return exports;
}
Would it be possible to do something like include an option in the jsconfig.json file to specify a property name or list of names to track when determining module exports?
Maybe something like this?
{
"moduleOptions": {
"exportProperty": ["exports", "this"]
}
}
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 CommonJS-Modulmuster und der vorgeschlagenen moduleOptions-Einstellung in jsconfig.json. Reproduziere das fehlende Verhalten von IntelliSense und Definitionen und verfolge anschließend TypeScript’s Umgang mit Zuweisungen zu expando-Objekten; abgeschlossen bedeutet, dass sich die angeforderten Export-Eigenschaften in den Typinformationen weiterentwickeln und das Konfigurationsverhalten durch Tests abgedeckt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, typescript
- Bereich
- compilers, developer-experience
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100