microsoft / microsoft/TypeScript
Automatic Type Acquisition should give the ability to prioritize jsconfig.json types over node_modules types
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
Feature request
Visual Studio Code should download @types/jest with this jsconfig.json configuration :
{
"typeAcquisition": {
"include": [
"jest"
]
}
}
But Automatic Type Acquisition give priority to Jest types coming from node_modules :
[23:20:24.533] Explicitly included types: ["jest"]
[23:20:24.534] Typing names in '/data/www/jest-vscode-ata/package.json' dependencies: ["jest"]
[23:20:24.578] Searching for typing names in /data/www/jest-vscode-ata/node_modules; all files: [...]
[23:20:24.632] Package 'jest' provides its own types.
Provided Jest types seems to be useless and they are not globally available. Automatic Type Acquisition should give the ability to prioritize jsconfig.json configuration over node_modules types.
Configuration
- VSCode Version: 1.43.2
- OS Version: Debian 10 / Xfce 4.12
Demo repository
- Clone Git repository with following command git clone https://github.com/cedricmn/jest-vscode-ata.git
- Go to project folder and type npm install
- Open index.test.js with Visual Studio Code
- IntelliSense for Jest does not works
Workaround
- Installing @types/jest as dev dependency fix the issue but typing should be Automatic Type Acquisition responsibility
- Installing Jest globally and removing it from dev dependency fix the issue but Jest should be listed as dev dependency
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 im Issue beschriebenen Verhalten von Automatic Type Acquisition, der Einstellung typeAcquisition.include in jsconfig.json und der Reproduktion im Demo-Repository mit npm install und index.test.js. Verfolge, wie explizit eingeschlossene Jest-Typen gegen node_modules aufgelöst werden; fertig ist es, wenn die Konfiguration die angeforderten Typen priorisieren kann und IntelliSense im Demo funktioniert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, typescript, vscode
- Bereich
- developer-experience, tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 25/100