microsoft / microsoft/TypeScript

tsconfig.json extends field node-style resolution broken

Aperta
#43,245 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Docs
Lingua principale
Go
Stelle
111k
Fork
14.4k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

Bug Report

The docs say (emphasis mine):

The value of extends is a string which contains a path to another configuration file to inherit from. The path may use Node.js style resolution.

This worked up until recently but is currently broken. I can't pin down a specific version where it stopped working as I guess the code that loads the config may be from a dependency of typescript that is shared across different versions.

We've got a module that contains org-wide tsconfig that we want our projects to extend - they could be regular modules, monorepo packages, etc.

Those projects can and do get pulled in as github urls (or https://gitpkg.now.sh/ urls for monorepo packages) for other modules as dependencies during PRs. Those projects are typically written in js but generate types from jsdoc comments using the npm prepare script for the current module to use, which now fails as it can't resolve the extends path.

You can't always predict which node_modules folder will contain the relevant dependency, so doing Node.js style resolution (e.g. stepping up through directories) is essential for our use-case.

🔎 Search Terms
  • tsconfig extending npm package
  • tsconfig extend node_modules
  • tsconfig node_modules
  • tsconfig extend resolve
🕗 Version & Regression Information

Not sure, it was working before Christmas, now it does not.

🙁 Actual behavior

Typescript does not resolve the extends path using Node.js style resolution.

🙂 Expected behavior

Typescript should resolve the extends path using Node.js style resolution.

References:

https://github.com/microsoft/TypeScript/issues/18865
https://github.com/microsoft/TypeScript/issues/30701

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 tracciando la risoluzione di extends di TypeScript e esamina le issue collegate 18865 e 30701 insieme alla documentazione di extends. Il lavoro è completo quando i percorsi di configurazione vengono risolti con una ricerca in stile Node.js, incluse le dipendenze nelle directory node_modules annidate, e lo scenario prepare-script segnalato torna a funzionare.

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

Valutazione

Stack tecnologico
node.js, typescript
Ambito
build-system, compilers
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.